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_LICENSE_FILES
:=LICENSE.txt
16 PKG_CPE_ID
:=cpe
:/a
:eclipse
:mosquitto
18 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
19 PKG_SOURCE_URL
:=https
://mosquitto.org
/files
/source
/
20 PKG_HASH
:=67eaeb4160e5793715c017f53c4f42808d76129b7ad131d765a6a23792e58d5d
22 include $(INCLUDE_DIR
)/package.mk
24 define Package
/mosquitto
/default
27 TITLE
:=mosquitto
- an MQTT message broker
28 URL
:=http
://www.mosquitto.org
/
29 MAINTAINER
:=Karl Palsson
<karlp@etactica.com
>
31 USERID
:=mosquitto
=200:mosquitto
=200
34 define Package
/mosquitto-ssl
35 $(call Package
/mosquitto
/default
)
36 TITLE
+= (with SSL support
)
37 DEPENDS
+= +libopenssl
+MOSQUITTO_LWS
:libwebsockets-openssl
+MOSQUITTO_DYNAMIC_SECURITY
:cJSON
42 define Package
/mosquitto-nossl
43 $(call Package
/mosquitto
/default
)
44 TITLE
+= (without SSL support
)
49 define Package
/mosquitto-ssl
/config
50 source
"$(SOURCE)/Config.in"
53 define Package
/mosquitto
/default
/description
54 Mosquitto is an open source
(BSD licensed
) message broker that implements
55 the MQTT protocol version
3.1, 3.1.1 and
5. MQTT provides a lightweight
56 method of carrying out messaging using a publish
/subscribe model.
58 This package also includes some basic support for configuring via UCI
61 define Package
/mosquitto-ssl
/description
62 $(call Package
/mosquitto
/default
/description
)
63 This package is built with SSL support. TLS-PSK will be included
(in both
64 the client and broker
) if OpenSSL is built with TLS-PSK support.
67 define Package
/mosquitto-nossl
/description
68 $(call Package
/mosquitto
/default
/description
)
69 This package is built WITHOUT SSL support.
73 define Package
/mosquitto-client
/default
74 $(Package
/mosquitto
/default
)
75 TITLE
:= mosquitto
- client tools
76 DEPENDS
+=+libcares
+cJSON
77 PROVIDES
:=mosquitto-client
79 define Package
/mosquitto-client-ssl
80 $(call Package
/mosquitto-client
/default
)
81 TITLE
+= (With SSL support
)
82 DEPENDS
+=+libmosquitto-ssl
85 define Package
/mosquitto-client-nossl
86 $(call Package
/mosquitto-client
/default
)
87 TITLE
+= (Without SSL support
)
88 DEPENDS
+=+libmosquitto-nossl
92 define Package
/mosquitto-client
/default
/description
93 Command line client tools for working with mosquitto.
94 This includes mosquitto_sub
, mosquitto_pub
, mosquitto_rr
95 and the mosquitto_ctrl tool.
98 define Package
/mosquitto-client-ssl
/description
99 $(call Package
/mosquitto-client
/default
/description
)
100 This package is built with SSL support
102 define Package
/mosquitto-client-nossl
/description
103 $(call Package
/mosquitto-client
/default
/description
)
104 This package is built without SSL support
107 define Package
/libmosquitto
/default
108 $(Package
/mosquitto
/default
)
111 DEPENDS
:=+libpthread
+librt
+libcares
112 TITLE
:= mosquitto
- client library
113 PROVIDES
:=libmosquitto
116 define Package
/libmosquitto-ssl
117 $(call Package
/libmosquitto
/default
)
118 TITLE
+= (With SSL Support
)
119 DEPENDS
+= +libopenssl
122 define Package
/libmosquitto-nossl
123 $(call Package
/libmosquitto
/default
)
124 TITLE
+= (Without SSL Support
)
128 define Package
/libmosquitto
/default
/description
129 Library required for mosquitto
's command line client tools, also for
130 use by any third party software that wants to communicate with _any_
133 Should be useable for communicating with any MQTT v3.1/3.1.1/5 compatible
134 server, in addition to Mosquitto.
137 define Package/libmosquitto-ssl/description
138 $(call Package/libmosquitto/default/description)
139 This package is built with SSL support
141 define Package/libmosquitto-nossl/description
142 $(call Package/libmosquitto/default/description)
143 This package is built without SSL support
146 define Package/libmosquittopp
149 DEPENDS:=libmosquitto +libstdcpp
150 TITLE:= mosquitto - client c++ library
153 define Package/libmosquittopp/description
154 C++ Library wrapper for libmosquitto.
157 define Package/mosquitto-ssl/conffiles
158 /etc/mosquitto/mosquitto.conf
159 /etc/config/mosquitto
162 Package/mosquitto-nossl/conffiles = $(Package/mosquitto-ssl/conffiles)
164 define Package/mosquitto/install/default
165 $(INSTALL_DIR) $(1)/usr/sbin
166 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto
167 $(INSTALL_DIR) $(1)/etc/mosquitto
168 $(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf
169 $(CP) ./files/* $(1)/
172 define Package/mosquitto-nossl/install
173 $(call Package/mosquitto/install/default,$(1))
176 define Package/mosquitto-ssl/install
177 $(call Package/mosquitto/install/default,$(1))
178 ifeq ($(CONFIG_MOSQUITTO_PASSWD),y)
179 $(INSTALL_DIR) $(1)/usr/bin
180 $(INSTALL_BIN) $(PKG_BUILD_DIR)/apps/mosquitto_passwd/mosquitto_passwd $(1)/usr/bin
182 ifeq ($(CONFIG_MOSQUITTO_DYNAMIC_SECURITY),y)
183 $(INSTALL_DIR) $(1)/usr/lib
184 $(INSTALL_BIN) $(PKG_BUILD_DIR)/plugins/dynamic-security/mosquitto_dynamic_security.so $(1)/usr/lib
188 define Package/mosquitto-client-nossl/install
189 $(INSTALL_DIR) $(1)/usr/bin
190 $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin
191 $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin
192 $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_rr $(1)/usr/bin
194 define Package/mosquitto-client-ssl/install
195 $(call Package/mosquitto-client-nossl/install,$(1))
196 ifeq ($(CONFIG_MOSQUITTO_CTRL),y)
197 $(INSTALL_BIN) $(PKG_BUILD_DIR)/apps/mosquitto_ctrl/mosquitto_ctrl $(1)/usr/bin
201 # This installs files into ./staging_dir/. so that you can cross compile from the host
202 define Build/InstallDev
203 $(INSTALL_DIR) $(1)/usr/include
204 $(CP) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include
205 $(CP) $(PKG_BUILD_DIR)/lib/cpp/mosquittopp.h $(1)/usr/include
206 $(INSTALL_DIR) $(1)/usr/lib
207 $(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
208 $(CP) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
209 $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
210 $(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so
211 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
212 $(CP) $(PKG_BUILD_DIR)/libmosquitto.pc.in $(1)/usr/lib/pkgconfig/libmosquitto.pc
213 sed -i -e "s#@CMAKE_INSTALL_PREFIX@#/usr#" \
214 -e "s#@VERSION@#$(PKG_VERSION)#" \
215 $(1)/usr/lib/pkgconfig/libmosquitto.pc
216 $(CP) $(PKG_BUILD_DIR)/libmosquittopp.pc.in $(1)/usr/lib/pkgconfig/libmosquittopp.pc
217 sed -i -e "s#@CMAKE_INSTALL_PREFIX@#/usr#" \
218 -e "s#@VERSION@#$(PKG_VERSION)#" \
219 $(1)/usr/lib/pkgconfig/libmosquittopp.pc
222 # This installs files on the target. Compare with Build/InstallDev
223 define Package/libmosquitto-ssl/install
224 $(INSTALL_DIR) $(1)/usr/lib
225 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
226 $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
228 Package/libmosquitto-nossl/install = $(Package/libmosquitto-ssl/install)
230 define Package/libmosquittopp/install
231 $(INSTALL_DIR) $(1)/usr/lib
232 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
233 $(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so
237 MAKE_FLAGS += WITH_DOCS=no UNAME=Linux
238 ifeq ($(BUILD_VARIANT),nossl)
239 MAKE_FLAGS += WITH_TLS=no WITH_WEBSOCKETS=no
241 MAKE_FLAGS += WITH_WEBSOCKETS=$(if $(CONFIG_MOSQUITTO_LWS),"yes","no")
242 MAKE_FLAGS += WITH_TLS_PSK=$(if $(CONFIG_OPENSSL_WITH_PSK),"yes","no")
245 $(eval $(call BuildPackage,mosquitto-ssl))
246 $(eval $(call BuildPackage,mosquitto-nossl))
247 $(eval $(call BuildPackage,libmosquitto-ssl))
248 $(eval $(call BuildPackage,libmosquitto-nossl))
249 $(eval $(call BuildPackage,libmosquittopp))
250 $(eval $(call BuildPackage,mosquitto-client-ssl))
251 $(eval $(call BuildPackage,mosquitto-client-nossl))