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.

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