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.

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