You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

198 lines
6.0 KiB

  1. #
  2. # Copyright (C) 2011-2013 OpenWrt.org
  3. # Copyright (C) 2010 Jo-Philipp Wich <xm@subsignal.org>
  4. #
  5. # This is free software, licensed under the GNU General Public License v2.
  6. # See /LICENSE for more information.
  7. #
  8. include $(TOPDIR)/rules.mk
  9. PKG_NAME:=mosquitto
  10. PKG_VERSION:=1.4.3
  11. PKG_RELEASE:=2
  12. PKG_LICENSE:=BSD-3-Clause
  13. PKG_LICENSE_FILES:=LICENSE.txt
  14. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  15. PKG_SOURCE_URL:=http://mosquitto.org/files/source/
  16. PKG_MD5SUM:=1c1c750525546bc13d8d72e56a0742a7
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/$(PKG_NAME)/default
  20. SECTION:=net
  21. CATEGORY:=Network
  22. TITLE:=mosquitto - an MQTT message broker
  23. URL:=http://www.mosquitto.org/
  24. MAINTAINER:=Karl Palsson <karlp@remake.is>
  25. DEPENDS:= +librt +libuuid
  26. USERID:=mosquitto=200:mosquitto=200
  27. endef
  28. define Package/$(PKG_NAME)
  29. $(call Package/mosquitto/default)
  30. TITLE+= (with SSL support)
  31. DEPENDS+= +libopenssl +MOSQUITTO_LWS:libwebsockets-openssl
  32. VARIANT:=ssl
  33. endef
  34. define Package/$(PKG_NAME)-nossl
  35. $(call Package/$(PKG_NAME)/default)
  36. TITLE+= (without SSL support)
  37. VARIANT:=nossl
  38. endef
  39. define Package/$(PKG_NAME)/config
  40. source "$(SOURCE)/Config.in"
  41. endef
  42. define Package/$(PKG_NAME)/default/description
  43. Mosquitto is an open source (BSD licensed) message broker that implements
  44. the MQTT protocol version 3.1 and 3.1.1. MQTT provides a lightweight
  45. method of carrying out messaging using a publish/subscribe model.
  46. This package also includes some basic support for configuring via UCI
  47. endef
  48. define Package/$(PKG_NAME)/description
  49. $(call Package/$(PKG_NAME)/default/description)
  50. This package is built with SSL support
  51. endef
  52. define Package/$(PKG_NAME)-nossl/description
  53. $(call Package/$(PKG_NAME)/default/description)
  54. This package is built WITHOUT SSL support.
  55. endef
  56. define Package/mosquitto-client/default
  57. $(Package/mosquitto/default)
  58. TITLE:= mosquitto - client tools
  59. DEPENDS+=+libcares
  60. endef
  61. define Package/mosquitto-client
  62. $(call Package/mosquitto-client/default)
  63. TITLE+= (With SSL support)
  64. DEPENDS+=+libmosquitto
  65. VARIANT:=ssl
  66. endef
  67. define Package/mosquitto-client-nossl
  68. $(call Package/mosquitto-client/default)
  69. TITLE+= (Without SSL support)
  70. DEPENDS+=+libmosquitto-nossl
  71. VARIANT:=nossl
  72. endef
  73. define Package/mosquitto-client/default/description
  74. Command line client tools for publishing messages to MQTT servers
  75. and subscribing to topics.
  76. endef
  77. define Package/mosquitto-client/description
  78. $(call Package/mosquitto-client/default/description)
  79. This package is built with SSL support
  80. endef
  81. define Package/mosquitto-client-nossl/description
  82. $(call Package/mosquitto-client/default/description)
  83. This package is built without SSL support
  84. endef
  85. define Package/libmosquitto/default
  86. $(Package/mosquitto/default)
  87. SECTION:=libs
  88. CATEGORY:=Libraries
  89. DEPENDS:=+libpthread +librt +libcares
  90. TITLE:= mosquitto - client library
  91. endef
  92. define Package/libmosquitto
  93. $(call Package/libmosquitto/default)
  94. TITLE+= (With SSL Support)
  95. DEPENDS+= +libopenssl
  96. VARIANT=ssl
  97. endef
  98. define Package/libmosquitto-nossl
  99. $(call Package/libmosquitto/default)
  100. TITLE+= (Without SSL Support)
  101. VARIANT=nossl
  102. endef
  103. define Package/libmosquitto/default/description
  104. Library required for mosquitto's command line client tools, also for
  105. use by any third party software that wants to communicate with a
  106. mosquitto server.
  107. Should be useable for communicating with any MQTT v3.1/3.1.1 compatible
  108. server, such as IBM's RSMB, in addition to Mosquitto
  109. endef
  110. define Package/libmosquitto/description
  111. $(call Package/libmosquitto/default/description)
  112. This package is built with SSL support
  113. endef
  114. define Package/libmosquitto-nossl/description
  115. $(call Package/libmosquitto/default/description)
  116. This package is built without SSL support
  117. endef
  118. define Package/$(PKG_NAME)/conffiles
  119. /etc/mosquitto/mosquitto.conf
  120. /etc/config/mosquitto
  121. endef
  122. Package/$(PKG_NAME)-nossl/conffiles = $(Package/$(PKG_NAME)/conffiles)
  123. define Package/$(PKG_NAME)/install
  124. $(INSTALL_DIR) $(1)/usr/sbin
  125. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto
  126. $(INSTALL_DIR) $(1)/etc/mosquitto
  127. $(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf
  128. $(INSTALL_DIR) $(1)/etc/init.d
  129. $(INSTALL_BIN) ./files/mosquitto.init $(1)/etc/init.d/mosquitto
  130. $(INSTALL_DIR) $(1)/usr/bin
  131. $(INSTALL_BIN) ./files/mosquitto.uci.convert $(1)/usr/bin
  132. endef
  133. Package/$(PKG_NAME)-nossl/install = $(Package/$(PKG_NAME)/install)
  134. define Package/mosquitto-client/install
  135. $(INSTALL_DIR) $(1)/usr/bin
  136. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub
  137. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub
  138. endef
  139. Package/mosquitto-client-nossl/install = $(Package/mosquitto-client/install)
  140. # This installs files into ./staging_dir/. so that you can cross compile from the host
  141. define Build/InstallDev
  142. $(INSTALL_DIR) $(1)/usr/include
  143. $(CP) $(PKG_BUILD_DIR)/lib/mosquitto.h $(1)/usr/include
  144. $(INSTALL_DIR) $(1)/usr/lib
  145. $(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  146. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  147. endef
  148. # This installs files on the target. Compare with Build/InstallDev
  149. define Package/libmosquitto/install
  150. $(INSTALL_DIR) $(1)/usr/lib
  151. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  152. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  153. endef
  154. Package/libmosquitto-nossl/install = $(Package/libmosquitto/install)
  155. # Applies to all...
  156. MAKE_FLAGS += WITH_DOCS=no
  157. ifeq ($(BUILD_VARIANT),nossl)
  158. MAKE_FLAGS += WITH_TLS=no WITH_WEBSOCKETS=no
  159. else
  160. MAKE_FLAGS += WITH_WEBSOCKETS=$(if $(CONFIG_MOSQUITTO_LWS),"yes","no")
  161. endif
  162. $(eval $(call BuildPackage,$(PKG_NAME)))
  163. $(eval $(call BuildPackage,$(PKG_NAME)-nossl))
  164. $(eval $(call BuildPackage,libmosquitto))
  165. $(eval $(call BuildPackage,libmosquitto-nossl))
  166. $(eval $(call BuildPackage,mosquitto-client))
  167. $(eval $(call BuildPackage,mosquitto-client-nossl))