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.

229 lines
6.9 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.12
  11. PKG_RELEASE:=1
  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_HASH:=b12e2353f92cb76882ce7b7bddfea022b461b38cbe6e7fb7c969d0daeb379cf7
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  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 +libuuid
  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
  53. endef
  54. define Package/mosquitto-nossl/description
  55. $(call Package/mosquitto/default/description)
  56. This package is built WITHOUT SSL support.
  57. endef
  58. define Package/mosquitto-client/default
  59. $(Package/mosquitto/default)
  60. TITLE:= mosquitto - client tools
  61. DEPENDS+=+libcares
  62. PROVIDES:=mosquitto-client
  63. endef
  64. define Package/mosquitto-client-ssl
  65. $(call Package/mosquitto-client/default)
  66. TITLE+= (With SSL support)
  67. DEPENDS+=+libmosquitto-ssl
  68. VARIANT:=ssl
  69. endef
  70. define Package/mosquitto-client-nossl
  71. $(call Package/mosquitto-client/default)
  72. TITLE+= (Without SSL support)
  73. DEPENDS+=+libmosquitto-nossl
  74. VARIANT:=nossl
  75. endef
  76. define Package/mosquitto-client/default/description
  77. Command line client tools for publishing messages to MQTT servers
  78. and subscribing to topics.
  79. endef
  80. define Package/mosquitto-client-ssl/description
  81. $(call Package/mosquitto-client/default/description)
  82. This package is built with SSL support
  83. endef
  84. define Package/mosquitto-client-nossl/description
  85. $(call Package/mosquitto-client/default/description)
  86. This package is built without SSL support
  87. endef
  88. define Package/libmosquitto/default
  89. $(Package/mosquitto/default)
  90. SECTION:=libs
  91. CATEGORY:=Libraries
  92. DEPENDS:=+libpthread +librt +libcares
  93. TITLE:= mosquitto - client library
  94. PROVIDES:=libmosquitto
  95. endef
  96. define Package/libmosquitto-ssl
  97. $(call Package/libmosquitto/default)
  98. TITLE+= (With SSL Support)
  99. DEPENDS+= +libopenssl
  100. VARIANT=ssl
  101. endef
  102. define Package/libmosquitto-nossl
  103. $(call Package/libmosquitto/default)
  104. TITLE+= (Without SSL Support)
  105. VARIANT=nossl
  106. endef
  107. define Package/libmosquitto/default/description
  108. Library required for mosquitto's command line client tools, also for
  109. use by any third party software that wants to communicate with a
  110. mosquitto server.
  111. Should be useable for communicating with any MQTT v3.1/3.1.1 compatible
  112. server, such as IBM's RSMB, in addition to Mosquitto
  113. endef
  114. define Package/libmosquitto-ssl/description
  115. $(call Package/libmosquitto/default/description)
  116. This package is built with SSL support
  117. endef
  118. define Package/libmosquitto-nossl/description
  119. $(call Package/libmosquitto/default/description)
  120. This package is built without SSL support
  121. endef
  122. define Package/libmosquittopp
  123. SECTION:=libs
  124. CATEGORY:=Libraries
  125. DEPENDS:=+libmosquitto-ssl +libstdcpp
  126. TITLE:= mosquitto - client c++ library
  127. endef
  128. define Package/libmosquittopp/description
  129. C++ Library wrapper for libmosquitto.
  130. endef
  131. define Package/mosquitto-ssl/conffiles
  132. /etc/mosquitto/mosquitto.conf
  133. /etc/config/mosquitto
  134. endef
  135. Package/mosquitto-nossl/conffiles = $(Package/mosquitto-ssl/conffiles)
  136. define Package/mosquitto/install/default
  137. $(INSTALL_DIR) $(1)/usr/sbin
  138. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto
  139. $(INSTALL_DIR) $(1)/etc/mosquitto
  140. $(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf
  141. $(CP) ./files/* $(1)/
  142. endef
  143. define Package/mosquitto-nossl/install
  144. $(call Package/mosquitto/install/default,$(1))
  145. endef
  146. define Package/mosquitto-ssl/install
  147. $(call Package/mosquitto/install/default,$(1))
  148. ifeq ($(CONFIG_MOSQUITTO_PASSWD),y)
  149. $(INSTALL_DIR) $(1)/usr/bin
  150. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto_passwd $(1)/usr/bin
  151. endif
  152. endef
  153. define Package/mosquitto-client-ssl/install
  154. $(INSTALL_DIR) $(1)/usr/bin
  155. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub
  156. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub
  157. endef
  158. Package/mosquitto-client-nossl/install = $(Package/mosquitto-client-ssl/install)
  159. # This installs files into ./staging_dir/. so that you can cross compile from the host
  160. define Build/InstallDev
  161. $(INSTALL_DIR) $(1)/usr/include
  162. $(CP) $(PKG_BUILD_DIR)/lib/mosquitto.h $(1)/usr/include
  163. $(CP) $(PKG_BUILD_DIR)/lib/cpp/mosquittopp.h $(1)/usr/include
  164. $(INSTALL_DIR) $(1)/usr/lib
  165. $(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  166. $(CP) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
  167. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  168. $(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so
  169. endef
  170. # This installs files on the target. Compare with Build/InstallDev
  171. define Package/libmosquitto-ssl/install
  172. $(INSTALL_DIR) $(1)/usr/lib
  173. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  174. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  175. endef
  176. Package/libmosquitto-nossl/install = $(Package/libmosquitto-ssl/install)
  177. define Package/libmosquittopp/install
  178. $(INSTALL_DIR) $(1)/usr/lib
  179. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
  180. $(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so
  181. endef
  182. # Applies to all...
  183. MAKE_FLAGS += WITH_DOCS=no UNAME=Linux
  184. ifeq ($(BUILD_VARIANT),nossl)
  185. MAKE_FLAGS += WITH_TLS=no WITH_WEBSOCKETS=no
  186. else
  187. MAKE_FLAGS += WITH_WEBSOCKETS=$(if $(CONFIG_MOSQUITTO_LWS),"yes","no")
  188. endif
  189. $(eval $(call BuildPackage,mosquitto-ssl))
  190. $(eval $(call BuildPackage,mosquitto-nossl))
  191. $(eval $(call BuildPackage,libmosquitto-ssl))
  192. $(eval $(call BuildPackage,libmosquitto-nossl))
  193. $(eval $(call BuildPackage,libmosquittopp))
  194. $(eval $(call BuildPackage,mosquitto-client-ssl))
  195. $(eval $(call BuildPackage,mosquitto-client-nossl))