banip: release 0.9.6-1
[feed/packages.git] / net / mosquitto / Makefile
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
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=mosquitto
12 PKG_VERSION:=2.0.18
13 PKG_RELEASE:=3
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=https://mosquitto.org/files/source/
17 PKG_HASH:=d665fe7d0032881b1371a47f34169ee4edab67903b2cd2b4c083822823f4448a
18
19 PKG_LICENSE:=EPL-2.0
20 PKG_LICENSE_FILES:=LICENSE.txt
21 PKG_CPE_ID:=cpe:/a:eclipse:mosquitto
22
23 include $(INCLUDE_DIR)/package.mk
24 include $(INCLUDE_DIR)/cmake.mk
25
26 define Package/mosquitto/default
27 SECTION:=net
28 CATEGORY:=Network
29 TITLE:=mosquitto - an MQTT message broker
30 URL:=http://www.mosquitto.org/
31 MAINTAINER:=Karl Palsson <karlp@etactica.com>
32 DEPENDS:= +librt
33 USERID:=mosquitto=200:mosquitto=200
34 endef
35
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
40 VARIANT:=ssl
41 PROVIDES:=mosquitto
42 endef
43
44 define Package/mosquitto-nossl
45 $(call Package/mosquitto/default)
46 TITLE+= (without SSL support)
47 VARIANT:=nossl
48 PROVIDES:=mosquitto
49 endef
50
51 define Package/mosquitto-ssl/config
52 source "$(SOURCE)/Config.in"
53 endef
54
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.
59
60 This package also includes some basic support for configuring via UCI
61 endef
62
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.
67 endef
68
69 define Package/mosquitto-nossl/description
70 $(call Package/mosquitto/default/description)
71 This package is built WITHOUT SSL support.
72 endef
73
74
75 define Package/mosquitto-client/default
76 $(Package/mosquitto/default)
77 TITLE:= mosquitto - client tools
78 DEPENDS+=+libcares +cJSON
79 PROVIDES:=mosquitto-client
80 endef
81 define Package/mosquitto-client-ssl
82 $(call Package/mosquitto-client/default)
83 TITLE+= (With SSL support)
84 DEPENDS+=+libmosquitto-ssl
85 VARIANT:=ssl
86 endef
87 define Package/mosquitto-client-nossl
88 $(call Package/mosquitto-client/default)
89 TITLE+= (Without SSL support)
90 DEPENDS+=+libmosquitto-nossl
91 VARIANT:=nossl
92 endef
93
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.
98 endef
99
100 define Package/mosquitto-client-ssl/description
101 $(call Package/mosquitto-client/default/description)
102 This package is built with SSL support
103 endef
104 define Package/mosquitto-client-nossl/description
105 $(call Package/mosquitto-client/default/description)
106 This package is built without SSL support
107 endef
108
109 define Package/libmosquitto/default
110 $(Package/mosquitto/default)
111 SECTION:=libs
112 CATEGORY:=Libraries
113 DEPENDS:=+libpthread +librt +libcares
114 TITLE:= mosquitto - client library
115 PROVIDES:=libmosquitto
116 endef
117
118 define Package/libmosquitto-ssl
119 $(call Package/libmosquitto/default)
120 TITLE+= (With SSL Support)
121 DEPENDS+= +libopenssl
122 VARIANT=ssl
123 endef
124 define Package/libmosquitto-nossl
125 $(call Package/libmosquitto/default)
126 TITLE+= (Without SSL Support)
127 VARIANT=nossl
128 endef
129
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_
133 MQTT server.
134
135 Should be useable for communicating with any MQTT v3.1/3.1.1/5 compatible
136 server, in addition to Mosquitto.
137 endef
138
139 define Package/libmosquitto-ssl/description
140 $(call Package/libmosquitto/default/description)
141 This package is built with SSL support
142 endef
143 define Package/libmosquitto-nossl/description
144 $(call Package/libmosquitto/default/description)
145 This package is built without SSL support
146 endef
147
148 define Package/libmosquittopp
149 SECTION:=libs
150 CATEGORY:=Libraries
151 DEPENDS:=libmosquitto +libstdcpp
152 TITLE:= mosquitto - client c++ library
153 endef
154
155 define Package/libmosquittopp/description
156 C++ Library wrapper for libmosquitto.
157 endef
158
159 define Package/mosquitto-ssl/conffiles
160 /etc/mosquitto/mosquitto.conf
161 /etc/config/mosquitto
162 endef
163
164 Package/mosquitto-nossl/conffiles = $(Package/mosquitto-ssl/conffiles)
165
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)/
172 endef
173
174 define Package/mosquitto-nossl/install
175 $(call Package/mosquitto/install/default,$(1))
176 endef
177
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
183 endif
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
187 endif
188 endef
189
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
195 endef
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
200 endif
201 endef
202
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
212 endef
213
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/
218 endef
219 Package/libmosquitto-nossl/install = $(Package/libmosquitto-ssl/install)
220
221 define Package/libmosquittopp/install
222 $(INSTALL_DIR) $(1)/usr/lib
223 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libmosquittopp.so.* $(1)/usr/lib/
224 endef
225
226 # Applies to all...
227 CMAKE_OPTIONS += \
228 -DDOCUMENTATION=OFF \
229 -DWITH_ADNS=OFF \
230 -DWITH_BUNDLED_DEPS=ON \
231 -DWITH_DLT=OFF \
232 -DWITH_PERSISTENCE=ON \
233 -DWITH_PIC=ON \
234 -DWITH_SOCKS=ON \
235 -DWITH_SRV=ON \
236 -DWITH_SYSTEMD=OFF \
237 -DWITH_SYS_TREE=ON \
238 -DWITH_THREADING=ON
239
240 ifeq ($(BUILD_VARIANT),nossl)
241 CMAKE_OPTIONS += -DWITH_TLS=OFF -DWITH_WEBSOCKETS=OFF
242 else
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)
245 endif
246
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))