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.

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