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