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.

242 lines
7.6 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.6.12
  11. PKG_RELEASE:=1
  12. PKG_LICENSE:=BSD-3-Clause
  13. PKG_LICENSE_FILES:=LICENSE.txt
  14. PKG_CPE_ID:=cpe:/a:eclipse:mosquitto
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  16. PKG_SOURCE_URL:=https://mosquitto.org/files/source/
  17. PKG_HASH:=548d73d19fb787dd0530334e398fd256ef3a581181678488a741a995c4f007fb
  18. include $(INCLUDE_DIR)/package.mk
  19. define Package/mosquitto/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@etactica.com>
  25. DEPENDS:= +librt
  26. USERID:=mosquitto=200:mosquitto=200
  27. endef
  28. define Package/mosquitto-ssl
  29. $(call Package/mosquitto/default)
  30. TITLE+= (with SSL support)
  31. DEPENDS+= +libopenssl +MOSQUITTO_LWS:libwebsockets-openssl
  32. VARIANT:=ssl
  33. PROVIDES:=mosquitto
  34. endef
  35. define Package/mosquitto-nossl
  36. $(call Package/mosquitto/default)
  37. TITLE+= (without SSL support)
  38. VARIANT:=nossl
  39. PROVIDES:=mosquitto
  40. endef
  41. define Package/mosquitto-ssl/config
  42. source "$(SOURCE)/Config.in"
  43. endef
  44. define Package/mosquitto/default/description
  45. Mosquitto is an open source (BSD licensed) message broker that implements
  46. the MQTT protocol version 3.1 and 3.1.1. MQTT provides a lightweight
  47. method of carrying out messaging using a publish/subscribe model.
  48. This package also includes some basic support for configuring via UCI
  49. endef
  50. define Package/mosquitto-ssl/description
  51. $(call Package/mosquitto/default/description)
  52. This package is built with SSL support. TLS-PSK will be included (in both
  53. the client and broker) if OpenSSL is built with TLS-PSK support.
  54. endef
  55. define Package/mosquitto-nossl/description
  56. $(call Package/mosquitto/default/description)
  57. This package is built WITHOUT SSL support.
  58. endef
  59. define Package/mosquitto-client/default
  60. $(Package/mosquitto/default)
  61. TITLE:= mosquitto - client tools
  62. DEPENDS+=+libcares
  63. PROVIDES:=mosquitto-client
  64. endef
  65. define Package/mosquitto-client-ssl
  66. $(call Package/mosquitto-client/default)
  67. TITLE+= (With SSL support)
  68. DEPENDS+=+libmosquitto-ssl
  69. VARIANT:=ssl
  70. endef
  71. define Package/mosquitto-client-nossl
  72. $(call Package/mosquitto-client/default)
  73. TITLE+= (Without SSL support)
  74. DEPENDS+=+libmosquitto-nossl
  75. VARIANT:=nossl
  76. endef
  77. define Package/mosquitto-client/default/description
  78. Command line client tools for publishing messages to MQTT servers
  79. and subscribing to topics.
  80. endef
  81. define Package/mosquitto-client-ssl/description
  82. $(call Package/mosquitto-client/default/description)
  83. This package is built with SSL support
  84. endef
  85. define Package/mosquitto-client-nossl/description
  86. $(call Package/mosquitto-client/default/description)
  87. This package is built without SSL support
  88. endef
  89. define Package/libmosquitto/default
  90. $(Package/mosquitto/default)
  91. SECTION:=libs
  92. CATEGORY:=Libraries
  93. DEPENDS:=+libpthread +librt +libcares
  94. TITLE:= mosquitto - client library
  95. PROVIDES:=libmosquitto
  96. endef
  97. define Package/libmosquitto-ssl
  98. $(call Package/libmosquitto/default)
  99. TITLE+= (With SSL Support)
  100. DEPENDS+= +libopenssl
  101. VARIANT=ssl
  102. endef
  103. define Package/libmosquitto-nossl
  104. $(call Package/libmosquitto/default)
  105. TITLE+= (Without SSL Support)
  106. VARIANT=nossl
  107. endef
  108. define Package/libmosquitto/default/description
  109. Library required for mosquitto's command line client tools, also for
  110. use by any third party software that wants to communicate with a
  111. mosquitto server.
  112. Should be useable for communicating with any MQTT v3.1/3.1.1 compatible
  113. server, such as IBM's RSMB, in addition to Mosquitto
  114. endef
  115. define Package/libmosquitto-ssl/description
  116. $(call Package/libmosquitto/default/description)
  117. This package is built with SSL support
  118. endef
  119. define Package/libmosquitto-nossl/description
  120. $(call Package/libmosquitto/default/description)
  121. This package is built without SSL support
  122. endef
  123. define Package/libmosquittopp
  124. SECTION:=libs
  125. CATEGORY:=Libraries
  126. DEPENDS:=libmosquitto +libstdcpp
  127. TITLE:= mosquitto - client c++ library
  128. endef
  129. define Package/libmosquittopp/description
  130. C++ Library wrapper for libmosquitto.
  131. endef
  132. define Package/mosquitto-ssl/conffiles
  133. /etc/mosquitto/mosquitto.conf
  134. /etc/config/mosquitto
  135. endef
  136. Package/mosquitto-nossl/conffiles = $(Package/mosquitto-ssl/conffiles)
  137. define Package/mosquitto/install/default
  138. $(INSTALL_DIR) $(1)/usr/sbin
  139. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto
  140. $(INSTALL_DIR) $(1)/etc/mosquitto
  141. $(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf
  142. $(CP) ./files/* $(1)/
  143. endef
  144. define Package/mosquitto-nossl/install
  145. $(call Package/mosquitto/install/default,$(1))
  146. endef
  147. define Package/mosquitto-ssl/install
  148. $(call Package/mosquitto/install/default,$(1))
  149. ifeq ($(CONFIG_MOSQUITTO_PASSWD),y)
  150. $(INSTALL_DIR) $(1)/usr/bin
  151. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto_passwd $(1)/usr/bin
  152. endif
  153. endef
  154. define Package/mosquitto-client-ssl/install
  155. $(INSTALL_DIR) $(1)/usr/bin
  156. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub
  157. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub
  158. endef
  159. Package/mosquitto-client-nossl/install = $(Package/mosquitto-client-ssl/install)
  160. # This installs files into ./staging_dir/. so that you can cross compile from the host
  161. define Build/InstallDev
  162. $(INSTALL_DIR) $(1)/usr/include
  163. $(CP) $(PKG_BUILD_DIR)/lib/mosquitto.h $(1)/usr/include
  164. $(CP) $(PKG_BUILD_DIR)/lib/cpp/mosquittopp.h $(1)/usr/include
  165. $(CP) $(PKG_BUILD_DIR)/src/mosquitto_plugin.h $(1)/usr/include
  166. $(CP) $(PKG_BUILD_DIR)/src/mosquitto_broker.h $(1)/usr/include
  167. $(INSTALL_DIR) $(1)/usr/lib
  168. $(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  169. $(CP) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
  170. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  171. $(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so
  172. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  173. $(CP) $(PKG_BUILD_DIR)/libmosquitto.pc.in $(1)/usr/lib/pkgconfig/libmosquitto.pc
  174. sed -i -e "s#@CMAKE_INSTALL_PREFIX@#/usr#" \
  175. -e "s#@VERSION@#$(PKG_VERSION)#" \
  176. $(1)/usr/lib/pkgconfig/libmosquitto.pc
  177. $(CP) $(PKG_BUILD_DIR)/libmosquittopp.pc.in $(1)/usr/lib/pkgconfig/libmosquittopp.pc
  178. sed -i -e "s#@CMAKE_INSTALL_PREFIX@#/usr#" \
  179. -e "s#@VERSION@#$(PKG_VERSION)#" \
  180. $(1)/usr/lib/pkgconfig/libmosquittopp.pc
  181. endef
  182. # This installs files on the target. Compare with Build/InstallDev
  183. define Package/libmosquitto-ssl/install
  184. $(INSTALL_DIR) $(1)/usr/lib
  185. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  186. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  187. endef
  188. Package/libmosquitto-nossl/install = $(Package/libmosquitto-ssl/install)
  189. define Package/libmosquittopp/install
  190. $(INSTALL_DIR) $(1)/usr/lib
  191. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
  192. $(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so
  193. endef
  194. # Applies to all...
  195. MAKE_FLAGS += WITH_DOCS=no UNAME=Linux
  196. ifeq ($(BUILD_VARIANT),nossl)
  197. MAKE_FLAGS += WITH_TLS=no WITH_WEBSOCKETS=no
  198. else
  199. MAKE_FLAGS += WITH_WEBSOCKETS=$(if $(CONFIG_MOSQUITTO_LWS),"yes","no")
  200. MAKE_FLAGS += WITH_TLS_PSK=$(if $(CONFIG_OPENSSL_WITH_PSK),"yes","no")
  201. endif
  202. $(eval $(call BuildPackage,mosquitto-ssl))
  203. $(eval $(call BuildPackage,mosquitto-nossl))
  204. $(eval $(call BuildPackage,libmosquitto-ssl))
  205. $(eval $(call BuildPackage,libmosquitto-nossl))
  206. $(eval $(call BuildPackage,libmosquittopp))
  207. $(eval $(call BuildPackage,mosquitto-client-ssl))
  208. $(eval $(call BuildPackage,mosquitto-client-nossl))