[packages] mosquitto: [PATCH] Add support for the mosquitto MQTT message broker,...
[openwrt/svn-archive/archive.git] / net / mosquitto / Makefile
1 #
2 # Copyright (C) 2010 Jo-Philipp Wich <xm@subsignal.org>
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=mosquitto
11 PKG_VERSION:=0.12
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 PKG_SOURCE_URL:=http://mosquitto.org/files/source/
16 PKG_MD5SUM:=e21ecb18dc8f9c3103fab95bbf8cffc7
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/mosquitto/default
21 SECTION:=net
22 CATEGORY:=Network
23 TITLE:=mosquitto - an MQTT message broker
24 URL:=http://www.mosquitto.org/
25 endef
26
27 define Package/mosquitto
28 $(Package/mosquitto/default)
29 endef
30
31 define Package/mosquitto/description
32 mosquitto is a message broker that supports v3.1 of the MQ Telemetry
33 Transport protocol. MQTT provides a lightweight method for
34 messaging using a publish/subscribe model.
35 endef
36
37 define Package/mosquitto-client
38 $(Package/mosquitto/default)
39 TITLE:= mosquitto - client tools
40 DEPENDS:= +libmosquitto
41 endef
42
43 define Package/mosquitto-client/description
44 Command line client tools for publishing messages to MQTT servers
45 and subscribing to topics.
46 endef
47
48 define Package/libmosquitto
49 $(Package/mosquitto/default)
50 SECTION:=libs
51 CATEGORY:=Libraries
52 TITLE:= mosquitto - client library
53 endef
54
55 define Package/libmosquitto/description
56 Library required for mosquitto's command line client tools, also for
57 use by any third party software that wants to communicate with a
58 mosquitto server.
59
60 Should be useable for communicating with any MQTT v3.1 compatible
61 server, such as IBM's RSMB, in addition to Mosquitto
62 endef
63
64
65 define Package/mosquitto/conffiles
66 /etc/mosquitto/mosquitto.conf
67 endef
68
69 define Package/mosquitto/install
70 $(INSTALL_DIR) $(1)/usr/sbin
71 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto
72 $(INSTALL_DIR) $(1)/etc/mosquitto
73 $(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf
74 endef
75
76 define Package/mosquitto-client/install
77 $(INSTALL_DIR) $(1)/usr/bin
78 $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub
79 $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub
80 endef
81
82 # This installs files into ./staging_dir/. so that you can cross compile from the host
83 define Build/InstallDev
84 $(INSTALL_DIR) $(1)/usr/include
85 $(CP) $(PKG_BUILD_DIR)/lib/mosquitto.h $(1)/usr/include
86 $(INSTALL_DIR) $(1)/usr/lib
87 # This should just get symlinked, but I can't work out the magic syntax :(
88 $(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.0 $(1)/usr/lib/libmosquitto.so
89 endef
90
91 # This installs files on the target. Compare with Build/InstallDev
92 define Package/libmosquitto/install
93 $(INSTALL_DIR) $(1)/usr/lib
94 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.0 $(1)/usr/lib/libmosquitto.so.0
95 endef
96 $(eval $(call BuildPackage,mosquitto))
97 $(eval $(call BuildPackage,libmosquitto))
98 $(eval $(call BuildPackage,mosquitto-client))