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.

198 lines
5.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
  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:=cd879f5964311501ba8e2275add71484
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  18. include $(INCLUDE_DIR)/package.mk
  19. MAKE_FLAGS+=WITH_DOCS=no
  20. MAKE_FLAGS+=WITH_WEBSOCKETS=$(if $(CONFIG_MOSQUITTO_LWS),"yes","no")
  21. define Package/$(PKG_NAME)/default
  22. SECTION:=net
  23. CATEGORY:=Network
  24. TITLE:=mosquitto - an MQTT message broker
  25. URL:=http://www.mosquitto.org/
  26. MAINTAINER:=Karl Palsson <karlp@remake.is>
  27. DEPENDS:= +librt +libuuid
  28. USERID:=mosquitto=200:mosquitto=200
  29. endef
  30. define Package/$(PKG_NAME)
  31. $(call Package/mosquitto/default)
  32. TITLE+= (with SSL support)
  33. DEPENDS+= +libopenssl +MOSQUITTO_LWS:libwebsockets-openssl
  34. VARIANT:=ssl
  35. endef
  36. define Package/$(PKG_NAME)-nossl
  37. $(call Package/$(PKG_NAME)/default)
  38. TITLE+= (without SSL support)
  39. VARIANT:=nossl
  40. endef
  41. define Package/$(PKG_NAME)/config
  42. source "$(SOURCE)/Config.in"
  43. endef
  44. define Package/$(PKG_NAME)/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/$(PKG_NAME)/description
  51. $(call Package/$(PKG_NAME)/default/description)
  52. This package is built with SSL support
  53. endef
  54. define Package/$(PKG_NAME)-nossl/description
  55. $(call Package/$(PKG_NAME)/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
  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. endef
  94. define Package/libmosquitto
  95. $(call Package/libmosquitto/default)
  96. TITLE+= (With SSL Support)
  97. DEPENDS+= +libopenssl
  98. VARIANT=ssl
  99. endef
  100. define Package/libmosquitto-nossl
  101. $(call Package/libmosquitto/default)
  102. TITLE+= (Without SSL Support)
  103. VARIANT=nossl
  104. endef
  105. define Package/libmosquitto/default/description
  106. Library required for mosquitto's command line client tools, also for
  107. use by any third party software that wants to communicate with a
  108. mosquitto server.
  109. Should be useable for communicating with any MQTT v3.1/3.1.1 compatible
  110. server, such as IBM's RSMB, in addition to Mosquitto
  111. endef
  112. define Package/libmosquitto/description
  113. $(call Package/libmosquitto/default/description)
  114. This package is built with SSL support
  115. endef
  116. define Package/libmosquitto-nossl/description
  117. $(call Package/libmosquitto/default/description)
  118. This package is built without SSL support
  119. endef
  120. define Package/$(PKG_NAME)/conffiles
  121. /etc/mosquitto/mosquitto.conf
  122. /etc/config/mosquitto
  123. endef
  124. Package/$(PKG_NAME)-nossl/conffiles = $(Package/$(PKG_NAME)/conffiles)
  125. define Package/$(PKG_NAME)/install
  126. $(INSTALL_DIR) $(1)/usr/sbin
  127. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto
  128. $(INSTALL_DIR) $(1)/etc/mosquitto
  129. $(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf
  130. $(INSTALL_DIR) $(1)/etc/init.d
  131. $(INSTALL_BIN) ./files/mosquitto.init $(1)/etc/init.d/mosquitto
  132. $(INSTALL_DIR) $(1)/usr/bin
  133. $(INSTALL_BIN) ./files/mosquitto.uci.convert $(1)/usr/bin
  134. endef
  135. Package/$(PKG_NAME)-nossl/install = $(Package/$(PKG_NAME)/install)
  136. define Package/mosquitto-client/install
  137. $(INSTALL_DIR) $(1)/usr/bin
  138. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub
  139. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub
  140. endef
  141. Package/mosquitto-client-nossl/install = $(Package/mosquitto-client/install)
  142. # This installs files into ./staging_dir/. so that you can cross compile from the host
  143. define Build/InstallDev
  144. $(INSTALL_DIR) $(1)/usr/include
  145. $(CP) $(PKG_BUILD_DIR)/lib/mosquitto.h $(1)/usr/include
  146. $(INSTALL_DIR) $(1)/usr/lib
  147. $(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  148. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  149. endef
  150. # This installs files on the target. Compare with Build/InstallDev
  151. define Package/libmosquitto/install
  152. $(INSTALL_DIR) $(1)/usr/lib
  153. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  154. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  155. endef
  156. Package/libmosquitto-nossl/install = $(Package/libmosquitto/install)
  157. # Applies to all...
  158. ifeq ($(BUILD_VARIANT),nossl)
  159. MAKE_FLAGS += WITH_TLS=no
  160. endif
  161. $(eval $(call BuildPackage,$(PKG_NAME)))
  162. $(eval $(call BuildPackage,$(PKG_NAME)-nossl))
  163. $(eval $(call BuildPackage,libmosquitto))
  164. $(eval $(call BuildPackage,libmosquitto-nossl))
  165. $(eval $(call BuildPackage,mosquitto-client))
  166. $(eval $(call BuildPackage,mosquitto-client-nossl))