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.

201 lines
6.1 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/$(PKG_NAME)/install
  124. $(INSTALL_DIR) $(1)/usr/sbin
  125. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto
  126. ifeq ($(CONFIG_MOSQUITTO_PASSWD),y)
  127. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto_passwd $(1)/usr/sbin
  128. endif
  129. $(INSTALL_DIR) $(1)/etc/mosquitto
  130. $(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf
  131. $(INSTALL_DIR) $(1)/etc/init.d
  132. $(INSTALL_BIN) ./files/mosquitto.init $(1)/etc/init.d/mosquitto
  133. $(INSTALL_DIR) $(1)/usr/bin
  134. $(INSTALL_BIN) ./files/mosquitto.uci.convert $(1)/usr/bin
  135. endef
  136. Package/$(PKG_NAME)-nossl/install = $(Package/$(PKG_NAME)/install)
  137. define Package/mosquitto-client/install
  138. $(INSTALL_DIR) $(1)/usr/bin
  139. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub
  140. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub
  141. endef
  142. Package/mosquitto-client-nossl/install = $(Package/mosquitto-client/install)
  143. # This installs files into ./staging_dir/. so that you can cross compile from the host
  144. define Build/InstallDev
  145. $(INSTALL_DIR) $(1)/usr/include
  146. $(CP) $(PKG_BUILD_DIR)/lib/mosquitto.h $(1)/usr/include
  147. $(INSTALL_DIR) $(1)/usr/lib
  148. $(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  149. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  150. endef
  151. # This installs files on the target. Compare with Build/InstallDev
  152. define Package/libmosquitto/install
  153. $(INSTALL_DIR) $(1)/usr/lib
  154. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  155. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  156. endef
  157. Package/libmosquitto-nossl/install = $(Package/libmosquitto/install)
  158. # Applies to all...
  159. MAKE_FLAGS += WITH_DOCS=no
  160. ifeq ($(BUILD_VARIANT),nossl)
  161. MAKE_FLAGS += WITH_TLS=no WITH_WEBSOCKETS=no
  162. else
  163. MAKE_FLAGS += WITH_WEBSOCKETS=$(if $(CONFIG_MOSQUITTO_LWS),"yes","no")
  164. endif
  165. $(eval $(call BuildPackage,$(PKG_NAME)))
  166. $(eval $(call BuildPackage,$(PKG_NAME)-nossl))
  167. $(eval $(call BuildPackage,libmosquitto))
  168. $(eval $(call BuildPackage,libmosquitto-nossl))
  169. $(eval $(call BuildPackage,mosquitto-client))
  170. $(eval $(call BuildPackage,mosquitto-client-nossl))