2 # Copyright (C) 2011-2013 OpenWrt.org
3 # Copyright (C) 2010 Jo-Philipp Wich <xm@subsignal.org>
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
9 include $(TOPDIR
)/rules.mk
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
16 PKG_SOURCE_URL
:=https
://mosquitto.org
/files
/source
/
17 PKG_HASH
:=d665fe7d0032881b1371a47f34169ee4edab67903b2cd2b4c083822823f4448a
20 PKG_LICENSE_FILES
:=LICENSE.txt
21 PKG_CPE_ID
:=cpe
:/a
:eclipse
:mosquitto
23 include $(INCLUDE_DIR
)/package.mk
24 include $(INCLUDE_DIR
)/cmake.mk
26 define Package
/mosquitto
/default
29 TITLE
:=mosquitto
- an MQTT message broker
30 URL
:=http
://www.mosquitto.org
/
31 MAINTAINER
:=Karl Palsson
<karlp@etactica.com
>
33 USERID
:=mosquitto
=200:mosquitto
=200
36 define Package
/mosquitto-ssl
37 $(call Package
/mosquitto
/default
)
38 TITLE
+= (with SSL support
)
39 DEPENDS
+= +libopenssl
+MOSQUITTO_LWS
:libwebsockets-openssl
+MOSQUITTO_DYNAMIC_SECURITY
:cJSON
44 define Package
/mosquitto-nossl
45 $(call Package
/mosquitto
/default
)
46 TITLE
+= (without SSL support
)
51 define Package
/mosquitto-ssl
/config
52 source
"$(SOURCE)/Config.in"
55 define Package
/mosquitto
/default
/description
56 Mosquitto is an open source
(BSD licensed
) message broker that implements
57 the MQTT protocol version
3.1, 3.1.1 and
5. MQTT provides a lightweight
58 method of carrying out messaging using a publish
/subscribe model.
60 This package also includes some basic support for configuring via UCI
63 define Package
/mosquitto-ssl
/description
64 $(call Package
/mosquitto
/default
/description
)
65 This package is built with SSL support. TLS-PSK will be included
(in both
66 the client and broker
) if OpenSSL is built with TLS-PSK support.
69 define Package
/mosquitto-nossl
/description
70 $(call Package
/mosquitto
/default
/description
)
71 This package is built WITHOUT SSL support.
75 define Package
/mosquitto-client
/default
76 $(Package
/mosquitto
/default
)
77 TITLE
:= mosquitto
- client tools
78 DEPENDS
+=+libcares
+cJSON
79 PROVIDES
:=mosquitto-client
81 define Package
/mosquitto-client-ssl
82 $(call Package
/mosquitto-client
/default
)
83 TITLE
+= (With SSL support
)
84 DEPENDS
+=+libmosquitto-ssl
87 define Package
/mosquitto-client-nossl
88 $(call Package
/mosquitto-client
/default
)
89 TITLE
+= (Without SSL support
)
90 DEPENDS
+=+libmosquitto-nossl
94 define Package
/mosquitto-client
/default
/description
95 Command line client tools for working with mosquitto.
96 This includes mosquitto_sub
, mosquitto_pub
, mosquitto_rr
97 and the mosquitto_ctrl tool.
100 define Package
/mosquitto-client-ssl
/description
101 $(call Package
/mosquitto-client
/default
/description
)
102 This package is built with SSL support
104 define Package
/mosquitto-client-nossl
/description
105 $(call Package
/mosquitto-client
/default
/description
)
106 This package is built without SSL support
109 define Package
/libmosquitto
/default
110 $(Package
/mosquitto
/default
)
113 DEPENDS
:=+libpthread
+librt
+libcares
114 TITLE
:= mosquitto
- client library
115 PROVIDES
:=libmosquitto
118 define Package
/libmosquitto-ssl
119 $(call Package
/libmosquitto
/default
)
120 TITLE
+= (With SSL Support
)
121 DEPENDS
+= +libopenssl
124 define Package
/libmosquitto-nossl
125 $(call Package
/libmosquitto
/default
)
126 TITLE
+= (Without SSL Support
)
130 define Package
/libmosquitto
/default
/description
131 Library required for mosquitto
's command line client tools, also for
132 use by any third party software that wants to communicate with _any_
135 Should be useable for communicating with any MQTT v3.1/3.1.1/5 compatible
136 server, in addition to Mosquitto.
139 define Package/libmosquitto-ssl/description
140 $(call Package/libmosquitto/default/description)
141 This package is built with SSL support
143 define Package/libmosquitto-nossl/description
144 $(call Package/libmosquitto/default/description)
145 This package is built without SSL support
148 define Package/libmosquittopp
151 DEPENDS:=libmosquitto +libstdcpp
152 TITLE:= mosquitto - client c++ library
155 define Package/libmosquittopp/description
156 C++ Library wrapper for libmosquitto.
159 define Package/mosquitto-ssl/conffiles
160 /etc/mosquitto/mosquitto.conf
161 /etc/config/mosquitto
164 Package/mosquitto-nossl/conffiles = $(Package/mosquitto-ssl/conffiles)
166 define Package/mosquitto/install/default
167 $(INSTALL_DIR) $(1)/usr/sbin
168 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mosquitto $(1)/usr/sbin
169 $(INSTALL_DIR) $(1)/etc/mosquitto
170 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/usr/etc/mosquitto/mosquitto.conf $(1)/etc/mosquitto
171 $(CP) ./files/* $(1)/
174 define Package/mosquitto-nossl/install
175 $(call Package/mosquitto/install/default,$(1))
178 define Package/mosquitto-ssl/install
179 $(call Package/mosquitto/install/default,$(1))
180 ifeq ($(CONFIG_MOSQUITTO_PASSWD),y)
181 $(INSTALL_DIR) $(1)/usr/bin
182 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mosquitto_passwd $(1)/usr/bin
184 ifeq ($(CONFIG_MOSQUITTO_DYNAMIC_SECURITY),y)
185 $(INSTALL_DIR) $(1)/usr/lib
186 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/mosquitto_dynamic_security.so $(1)/usr/lib
190 define Package/mosquitto-client-nossl/install
191 $(INSTALL_DIR) $(1)/usr/bin
192 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mosquitto_pub $(1)/usr/bin
193 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mosquitto_sub $(1)/usr/bin
194 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mosquitto_rr $(1)/usr/bin
196 define Package/mosquitto-client-ssl/install
197 $(call Package/mosquitto-client-nossl/install,$(1))
198 ifeq ($(CONFIG_MOSQUITTO_CTRL),y)
199 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mosquitto_ctrl $(1)/usr/bin
203 # This installs files into ./staging_dir/. so that you can cross compile from the host
204 define Build/InstallDev
205 $(INSTALL_DIR) $(1)/usr/include
206 $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include
207 $(INSTALL_DIR) $(1)/usr/lib
208 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmosquitto.so* $(1)/usr/lib/
209 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmosquittopp.so* $(1)/usr/lib/
210 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
211 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
214 # This installs files on the target. Compare with Build/InstallDev
215 define Package/libmosquitto-ssl/install
216 $(INSTALL_DIR) $(1)/usr/lib
217 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libmosquitto.so.* $(1)/usr/lib/
219 Package/libmosquitto-nossl/install = $(Package/libmosquitto-ssl/install)
221 define Package/libmosquittopp/install
222 $(INSTALL_DIR) $(1)/usr/lib
223 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libmosquittopp.so.* $(1)/usr/lib/
228 -DDOCUMENTATION=OFF \
230 -DWITH_BUNDLED_DEPS=ON \
232 -DWITH_PERSISTENCE=ON \
240 ifeq ($(BUILD_VARIANT),nossl)
241 CMAKE_OPTIONS += -DWITH_TLS=OFF -DWITH_WEBSOCKETS=OFF
243 CMAKE_OPTIONS += -DWITH_TLS_PSK=O$(if $(CONFIG_OPENSSL_WITH_PSK),N,FF)
244 CMAKE_OPTIONS += -DWITH_WEBSOCKETS=O$(if $(CONFIG_MOSQUITTO_LWS),N,FF)
247 $(eval $(call BuildPackage,mosquitto-ssl))
248 $(eval $(call BuildPackage,mosquitto-nossl))
249 $(eval $(call BuildPackage,libmosquitto-ssl))
250 $(eval $(call BuildPackage,libmosquitto-nossl))
251 $(eval $(call BuildPackage,libmosquittopp))
252 $(eval $(call BuildPackage,mosquitto-client-ssl))
253 $(eval $(call BuildPackage,mosquitto-client-nossl))