lxc: bump to 2.1.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:=1.4.14
13 PKG_RELEASE:=1
14 PKG_LICENSE:=BSD-3-Clause
15 PKG_LICENSE_FILES:=LICENSE.txt
16
17 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
18 PKG_SOURCE_URL:=http://mosquitto.org/files/source/
19 PKG_HASH:=156b1fa731d12baad4b8b22f7b6a8af50ba881fc711b81e9919ec103cf2942d1
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/mosquitto/default
25 SECTION:=net
26 CATEGORY:=Network
27 TITLE:=mosquitto - an MQTT message broker
28 URL:=http://www.mosquitto.org/
29 MAINTAINER:=Karl Palsson <karlp@etactica.com>
30 DEPENDS:= +librt +libuuid
31 USERID:=mosquitto=200:mosquitto=200
32 endef
33
34 define Package/mosquitto-ssl
35 $(call Package/mosquitto/default)
36 TITLE+= (with SSL support)
37 DEPENDS+= +libopenssl +MOSQUITTO_LWS:libwebsockets-openssl
38 VARIANT:=ssl
39 PROVIDES:=mosquitto
40 endef
41
42 define Package/mosquitto-nossl
43 $(call Package/mosquitto/default)
44 TITLE+= (without SSL support)
45 VARIANT:=nossl
46 PROVIDES:=mosquitto
47 endef
48
49 define Package/mosquitto-ssl/config
50 source "$(SOURCE)/Config.in"
51 endef
52
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 and 3.1.1. MQTT provides a lightweight
56 method of carrying out messaging using a publish/subscribe model.
57
58 This package also includes some basic support for configuring via UCI
59 endef
60
61 define Package/mosquitto-ssl/description
62 $(call Package/mosquitto/default/description)
63 This package is built with SSL support
64 endef
65
66 define Package/mosquitto-nossl/description
67 $(call Package/mosquitto/default/description)
68 This package is built WITHOUT SSL support.
69 endef
70
71
72 define Package/mosquitto-client/default
73 $(Package/mosquitto/default)
74 TITLE:= mosquitto - client tools
75 DEPENDS+=+libcares
76 PROVIDES:=mosquitto-client
77 endef
78 define Package/mosquitto-client-ssl
79 $(call Package/mosquitto-client/default)
80 TITLE+= (With SSL support)
81 DEPENDS+=+libmosquitto-ssl
82 VARIANT:=ssl
83 endef
84 define Package/mosquitto-client-nossl
85 $(call Package/mosquitto-client/default)
86 TITLE+= (Without SSL support)
87 DEPENDS+=+libmosquitto-nossl
88 VARIANT:=nossl
89 endef
90
91 define Package/mosquitto-client/default/description
92 Command line client tools for publishing messages to MQTT servers
93 and subscribing to topics.
94 endef
95
96 define Package/mosquitto-client-ssl/description
97 $(call Package/mosquitto-client/default/description)
98 This package is built with SSL support
99 endef
100 define Package/mosquitto-client-nossl/description
101 $(call Package/mosquitto-client/default/description)
102 This package is built without SSL support
103 endef
104
105 define Package/libmosquitto/default
106 $(Package/mosquitto/default)
107 SECTION:=libs
108 CATEGORY:=Libraries
109 DEPENDS:=+libpthread +librt +libcares
110 TITLE:= mosquitto - client library
111 PROVIDES:=libmosquitto
112 endef
113
114 define Package/libmosquitto-ssl
115 $(call Package/libmosquitto/default)
116 TITLE+= (With SSL Support)
117 DEPENDS+= +libopenssl
118 VARIANT=ssl
119 endef
120 define Package/libmosquitto-nossl
121 $(call Package/libmosquitto/default)
122 TITLE+= (Without SSL Support)
123 VARIANT=nossl
124 endef
125
126 define Package/libmosquitto/default/description
127 Library required for mosquitto's command line client tools, also for
128 use by any third party software that wants to communicate with a
129 mosquitto server.
130
131 Should be useable for communicating with any MQTT v3.1/3.1.1 compatible
132 server, such as IBM's RSMB, in addition to Mosquitto
133 endef
134
135 define Package/libmosquitto-ssl/description
136 $(call Package/libmosquitto/default/description)
137 This package is built with SSL support
138 endef
139 define Package/libmosquitto-nossl/description
140 $(call Package/libmosquitto/default/description)
141 This package is built without SSL support
142 endef
143
144 define Package/libmosquittopp
145 SECTION:=libs
146 CATEGORY:=Libraries
147 DEPENDS:=+libmosquitto-ssl +libstdcpp
148 TITLE:= mosquitto - client c++ library
149 endef
150
151 define Package/libmosquittopp/description
152 C++ Library wrapper for libmosquitto.
153 endef
154
155 define Package/mosquitto-ssl/conffiles
156 /etc/mosquitto/mosquitto.conf
157 /etc/config/mosquitto
158 endef
159
160 Package/mosquitto-nossl/conffiles = $(Package/mosquitto-ssl/conffiles)
161
162 define Package/mosquitto/install/default
163 $(INSTALL_DIR) $(1)/usr/sbin
164 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto
165 $(INSTALL_DIR) $(1)/etc/mosquitto
166 $(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf
167 $(CP) ./files/* $(1)/
168 endef
169
170 define Package/mosquitto-nossl/install
171 $(call Package/mosquitto/install/default,$(1))
172 endef
173
174 define Package/mosquitto-ssl/install
175 $(call Package/mosquitto/install/default,$(1))
176 ifeq ($(CONFIG_MOSQUITTO_PASSWD),y)
177 $(INSTALL_DIR) $(1)/usr/bin
178 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto_passwd $(1)/usr/bin
179 endif
180 endef
181
182 define Package/mosquitto-client-ssl/install
183 $(INSTALL_DIR) $(1)/usr/bin
184 $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub
185 $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub
186 endef
187 Package/mosquitto-client-nossl/install = $(Package/mosquitto-client-ssl/install)
188
189 # This installs files into ./staging_dir/. so that you can cross compile from the host
190 define Build/InstallDev
191 $(INSTALL_DIR) $(1)/usr/include
192 $(CP) $(PKG_BUILD_DIR)/lib/mosquitto.h $(1)/usr/include
193 $(CP) $(PKG_BUILD_DIR)/lib/cpp/mosquittopp.h $(1)/usr/include
194 $(INSTALL_DIR) $(1)/usr/lib
195 $(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
196 $(CP) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
197 $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
198 $(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so
199 endef
200
201 # This installs files on the target. Compare with Build/InstallDev
202 define Package/libmosquitto-ssl/install
203 $(INSTALL_DIR) $(1)/usr/lib
204 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.1 $(1)/usr/lib/
205 $(LN) libmosquitto.so.1 $(1)/usr/lib/libmosquitto.so
206 endef
207 Package/libmosquitto-nossl/install = $(Package/libmosquitto-ssl/install)
208
209 define Package/libmosquittopp/install
210 $(INSTALL_DIR) $(1)/usr/lib
211 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/cpp/libmosquittopp.so.1 $(1)/usr/lib/
212 $(LN) libmosquittopp.so.1 $(1)/usr/lib/libmosquittopp.so
213 endef
214
215 # Applies to all...
216 MAKE_FLAGS += WITH_DOCS=no UNAME=Linux
217 ifeq ($(BUILD_VARIANT),nossl)
218 MAKE_FLAGS += WITH_TLS=no WITH_WEBSOCKETS=no
219 else
220 MAKE_FLAGS += WITH_WEBSOCKETS=$(if $(CONFIG_MOSQUITTO_LWS),"yes","no")
221 endif
222
223 $(eval $(call BuildPackage,mosquitto-ssl))
224 $(eval $(call BuildPackage,mosquitto-nossl))
225 $(eval $(call BuildPackage,libmosquitto-ssl))
226 $(eval $(call BuildPackage,libmosquitto-nossl))
227 $(eval $(call BuildPackage,libmosquittopp))
228 $(eval $(call BuildPackage,mosquitto-client-ssl))
229 $(eval $(call BuildPackage,mosquitto-client-nossl))