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.

225 lines
6.7 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.10
  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_MD5SUM:=61839b47b58c5799aab76584f13ed66f
  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@etactica.com>
  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/libmosquittopp
  119. SECTION:=libs
  120. CATEGORY:=Libraries
  121. DEPENDS:=+libmosquitto +libstdcpp
  122. TITLE:= mosquitto - client c++ library
  123. endef
  124. define Package/libmosquittopp/description
  125. C++ Library wrapper for libmosquitto.
  126. endef
  127. define Package/$(PKG_NAME)/conffiles
  128. /etc/mosquitto/mosquitto.conf
  129. /etc/config/mosquitto
  130. endef
  131. Package/$(PKG_NAME)-nossl/conffiles = $(Package/$(PKG_NAME)/conffiles)
  132. define Package/mosquitto/install/default
  133. $(INSTALL_DIR) $(1)/usr/sbin
  134. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto
  135. $(INSTALL_DIR) $(1)/etc/mosquitto
  136. $(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf
  137. $(CP) ./files/* $(1)/
  138. endef
  139. define Package/mosquitto-nossl/install
  140. $(call Package/mosquitto/install/default,$(1))
  141. endef
  142. define Package/mosquitto/install
  143. $(call Package/mosquitto/install/default,$(1))
  144. ifeq ($(CONFIG_MOSQUITTO_PASSWD),y)
  145. $(INSTALL_DIR) $(1)/usr/bin
  146. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto_passwd $(1)/usr/bin
  147. endif
  148. endef
  149. define Package/mosquitto-client/install
  150. $(INSTALL_DIR) $(1)/usr/bin
  151. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub
  152. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub
  153. endef
  154. Package/mosquitto-client-nossl/install = $(Package/mosquitto-client/install)
  155. # This installs files into ./staging_dir/. so that you can cross compile from the host
  156. define Build/InstallDev
  157. $(INSTALL_DIR) $(1)/usr/include
  158. $(CP) $(PKG_BUILD_DIR)/lib/mosquitto.h $(1)/usr/include
  159. $(CP) $(PKG_BUILD_DIR)/lib/cpp/mosquittopp.h $(1)/usr/include
  160. $(INSTALL_DIR) $(1)/usr/lib
  161. $(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  162. $(CP) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
  163. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  164. $(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so
  165. endef
  166. # This installs files on the target. Compare with Build/InstallDev
  167. define Package/libmosquitto/install
  168. $(INSTALL_DIR) $(1)/usr/lib
  169. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  170. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  171. endef
  172. Package/libmosquitto-nossl/install = $(Package/libmosquitto/install)
  173. define Package/libmosquittopp/install
  174. $(INSTALL_DIR) $(1)/usr/lib
  175. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
  176. $(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so
  177. endef
  178. # Applies to all...
  179. MAKE_FLAGS += WITH_DOCS=no
  180. ifeq ($(BUILD_VARIANT),nossl)
  181. MAKE_FLAGS += WITH_TLS=no WITH_WEBSOCKETS=no
  182. else
  183. MAKE_FLAGS += WITH_WEBSOCKETS=$(if $(CONFIG_MOSQUITTO_LWS),"yes","no")
  184. endif
  185. $(eval $(call BuildPackage,$(PKG_NAME)))
  186. $(eval $(call BuildPackage,$(PKG_NAME)-nossl))
  187. $(eval $(call BuildPackage,libmosquitto))
  188. $(eval $(call BuildPackage,libmosquitto-nossl))
  189. $(eval $(call BuildPackage,libmosquittopp))
  190. $(eval $(call BuildPackage,mosquitto-client))
  191. $(eval $(call BuildPackage,mosquitto-client-nossl))