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.

208 lines
6.2 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.7
  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:=4cb978502312bff2dcdaab6a433b1bf2
  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/mosquitto/install/default
  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. define Package/mosquitto-nossl/install
  134. $(call Package/mosquitto/install/default,$(1))
  135. endef
  136. define Package/mosquitto/install
  137. $(call Package/mosquitto/install/default,$(1))
  138. ifeq ($(CONFIG_MOSQUITTO_PASSWD),y)
  139. $(INSTALL_DIR) $(1)/usr/bin
  140. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto_passwd $(1)/usr/bin
  141. endif
  142. endef
  143. define Package/mosquitto-client/install
  144. $(INSTALL_DIR) $(1)/usr/bin
  145. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub
  146. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub
  147. endef
  148. Package/mosquitto-client-nossl/install = $(Package/mosquitto-client/install)
  149. # This installs files into ./staging_dir/. so that you can cross compile from the host
  150. define Build/InstallDev
  151. $(INSTALL_DIR) $(1)/usr/include
  152. $(CP) $(PKG_BUILD_DIR)/lib/mosquitto.h $(1)/usr/include
  153. $(INSTALL_DIR) $(1)/usr/lib
  154. $(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  155. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  156. endef
  157. # This installs files on the target. Compare with Build/InstallDev
  158. define Package/libmosquitto/install
  159. $(INSTALL_DIR) $(1)/usr/lib
  160. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  161. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  162. endef
  163. Package/libmosquitto-nossl/install = $(Package/libmosquitto/install)
  164. # Applies to all...
  165. MAKE_FLAGS += WITH_DOCS=no
  166. ifeq ($(BUILD_VARIANT),nossl)
  167. MAKE_FLAGS += WITH_TLS=no WITH_WEBSOCKETS=no
  168. else
  169. MAKE_FLAGS += WITH_WEBSOCKETS=$(if $(CONFIG_MOSQUITTO_LWS),"yes","no")
  170. endif
  171. $(eval $(call BuildPackage,$(PKG_NAME)))
  172. $(eval $(call BuildPackage,$(PKG_NAME)-nossl))
  173. $(eval $(call BuildPackage,libmosquitto))
  174. $(eval $(call BuildPackage,libmosquitto-nossl))
  175. $(eval $(call BuildPackage,mosquitto-client))
  176. $(eval $(call BuildPackage,mosquitto-client-nossl))