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.

192 lines
5.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.3.4
  11. PKG_RELEASE:=1
  12. PKG_LICENSE:=BSD-3-Clause
  13. PKG_LICENSE_FILE:=LICENSE.txt
  14. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  15. PKG_SOURCE_URL:=http://mosquitto.org/files/source/
  16. PKG_MD5SUM:=9d729849efd74c6e3eee17a4a002e1e9
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
  18. include $(INCLUDE_DIR)/package.mk
  19. MAKE_FLAGS+=WITH_MEMORY_TRACKING=no
  20. define Package/$(PKG_NAME)/default
  21. SECTION:=net
  22. CATEGORY:=Network
  23. TITLE:=mosquitto - an MQTT message broker
  24. URL:=http://www.mosquitto.org/
  25. MAINTAINER:=Karl Palsson <karlp@remake.is>
  26. DEPENDS:= +librt
  27. endef
  28. define Package/$(PKG_NAME)
  29. $(call Package/mosquitto/default)
  30. TITLE+= (with SSL support)
  31. DEPENDS+= +libopenssl
  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)/default/description
  40. Mosquitto is an open source (BSD licensed) message broker that implements
  41. the MQTT protocol version 3.1 and 3.1.1. MQTT provides a lightweight
  42. method of carrying out messaging using a publish/subscribe model.
  43. This package also includes some basic support for configuring via UCI
  44. endef
  45. define Package/$(PKG_NAME)/description
  46. $(call Package/$(PKG_NAME)/default/description)
  47. This package is built with SSL support
  48. endef
  49. define Package/$(PKG_NAME)-nossl/description
  50. $(call Package/$(PKG_NAME)/default/description)
  51. This package is built WITHOUT SSL support.
  52. endef
  53. define Package/mosquitto-client/default
  54. $(Package/mosquitto/default)
  55. TITLE:= mosquitto - client tools
  56. DEPENDS+=+libcares
  57. endef
  58. define Package/mosquitto-client
  59. $(call Package/mosquitto-client/default)
  60. TITLE+= (With SSL support)
  61. DEPENDS+=+libmosquitto
  62. VARIANT:=ssl
  63. endef
  64. define Package/mosquitto-client-nossl
  65. $(call Package/mosquitto-client/default)
  66. TITLE+= (Without SSL support)
  67. DEPENDS+=+libmosquitto-nossl
  68. VARIANT:=nossl
  69. endef
  70. define Package/mosquitto-client/default/description
  71. Command line client tools for publishing messages to MQTT servers
  72. and subscribing to topics.
  73. endef
  74. define Package/mosquitto-client/description
  75. $(call Package/mosquitto-client/default/description)
  76. This package is built with SSL support
  77. endef
  78. define Package/mosquitto-client-nossl/description
  79. $(call Package/mosquitto-client/default/description)
  80. This package is built without SSL support
  81. endef
  82. define Package/libmosquitto/default
  83. $(Package/mosquitto/default)
  84. SECTION:=libs
  85. CATEGORY:=Libraries
  86. DEPENDS:=+libpthread +librt +libcares
  87. TITLE:= mosquitto - client library
  88. endef
  89. define Package/libmosquitto
  90. $(call Package/libmosquitto/default)
  91. TITLE+= (With SSL Support)
  92. DEPENDS+= +libopenssl
  93. VARIANT=ssl
  94. endef
  95. define Package/libmosquitto-nossl
  96. $(call Package/libmosquitto/default)
  97. TITLE+= (Without SSL Support)
  98. VARIANT=nossl
  99. endef
  100. define Package/libmosquitto/default/description
  101. Library required for mosquitto's command line client tools, also for
  102. use by any third party software that wants to communicate with a
  103. mosquitto server.
  104. Should be useable for communicating with any MQTT v3.1/3.1.1 compatible
  105. server, such as IBM's RSMB, in addition to Mosquitto
  106. endef
  107. define Package/libmosquitto/description
  108. $(call Package/libmosquitto/default/description)
  109. This package is built with SSL support
  110. endef
  111. define Package/libmosquitto-nossl/description
  112. $(call Package/libmosquitto/default/description)
  113. This package is built without SSL support
  114. endef
  115. define Package/$(PKG_NAME)/conffiles
  116. /etc/mosquitto/mosquitto.conf
  117. /etc/config/mosquitto
  118. endef
  119. Package/$(PKG_NAME)-nossl/conffiles = $(Package/$(PKG_NAME)/conffiles)
  120. define Package/$(PKG_NAME)/install
  121. $(INSTALL_DIR) $(1)/usr/sbin
  122. $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto
  123. $(INSTALL_DIR) $(1)/etc/mosquitto
  124. $(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf
  125. $(INSTALL_DIR) $(1)/etc/init.d
  126. $(INSTALL_BIN) ./files/mosquitto.init $(1)/etc/init.d/mosquitto
  127. $(INSTALL_DIR) $(1)/usr/bin
  128. $(INSTALL_BIN) ./files/mosquitto.uci.convert $(1)/usr/bin
  129. endef
  130. Package/$(PKG_NAME)-nossl/install = $(Package/$(PKG_NAME)/install)
  131. define Package/mosquitto-client/install
  132. $(INSTALL_DIR) $(1)/usr/bin
  133. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub
  134. $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub
  135. endef
  136. Package/mosquitto-client-nossl/install = $(Package/mosquitto-client/install)
  137. # This installs files into ./staging_dir/. so that you can cross compile from the host
  138. define Build/InstallDev
  139. $(INSTALL_DIR) $(1)/usr/include
  140. $(CP) $(PKG_BUILD_DIR)/lib/mosquitto.h $(1)/usr/include
  141. $(INSTALL_DIR) $(1)/usr/lib
  142. $(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  143. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  144. endef
  145. # This installs files on the target. Compare with Build/InstallDev
  146. define Package/libmosquitto/install
  147. $(INSTALL_DIR) $(1)/usr/lib
  148. $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
  149. $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
  150. endef
  151. Package/libmosquitto-nossl/install = $(Package/libmosquitto/install)
  152. # Applies to all...
  153. ifeq ($(BUILD_VARIANT),nossl)
  154. MAKE_FLAGS += WITH_TLS=no
  155. endif
  156. $(eval $(call BuildPackage,$(PKG_NAME)))
  157. $(eval $(call BuildPackage,$(PKG_NAME)-nossl))
  158. $(eval $(call BuildPackage,libmosquitto))
  159. $(eval $(call BuildPackage,libmosquitto-nossl))
  160. $(eval $(call BuildPackage,mosquitto-client))
  161. $(eval $(call BuildPackage,mosquitto-client-nossl))