Provide an init.d script for mosquitto MQTT broker
[openwrt/svn-archive/archive.git] / net / mosquitto / Makefile
1 #
2 # Copyright (C) 2011,2012 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:=0.14.4
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:=88750338c2096671c01cf7e461d5c06d
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/mosquitto/default
22 SECTION:=net
23 CATEGORY:=Network
24 TITLE:=mosquitto - an MQTT message broker
25 URL:=http://www.mosquitto.org/
26 endef
27
28 define Package/mosquitto
29 $(Package/mosquitto/default)
30 endef
31
32 define Package/mosquitto/description
33 mosquitto is a message broker that supports v3.1 of the MQ Telemetry
34 Transport protocol. MQTT provides a lightweight method for
35 messaging using a publish/subscribe model.
36 endef
37
38 define Package/mosquitto-client
39 $(Package/mosquitto/default)
40 TITLE:= mosquitto - client tools
41 DEPENDS:= +libmosquitto
42 endef
43
44 define Package/mosquitto-client/description
45 Command line client tools for publishing messages to MQTT servers
46 and subscribing to topics.
47 endef
48
49 define Package/libmosquitto
50 $(Package/mosquitto/default)
51 SECTION:=libs
52 CATEGORY:=Libraries
53 TITLE:= mosquitto - client library
54 endef
55
56 define Package/libmosquitto/description
57 Library required for mosquitto's command line client tools, also for
58 use by any third party software that wants to communicate with a
59 mosquitto server.
60
61 Should be useable for communicating with any MQTT v3.1 compatible
62 server, such as IBM's RSMB, in addition to Mosquitto
63 endef
64
65
66 define Package/mosquitto/conffiles
67 /etc/mosquitto/mosquitto.conf
68 endef
69
70 define Package/mosquitto/install
71 $(INSTALL_DIR) $(1)/usr/sbin
72 $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto
73 $(INSTALL_DIR) $(1)/etc/mosquitto
74 $(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf
75 $(INSTALL_DIR) $(1)/etc/init.d
76 $(INSTALL_BIN) ./files/mosquitto.init $(1)/etc/init.d/mosquitto
77 endef
78
79 define Package/mosquitto-client/install
80 $(INSTALL_DIR) $(1)/usr/bin
81 $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub
82 $(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub
83 endef
84
85 # This installs files into ./staging_dir/. so that you can cross compile from the host
86 define Build/InstallDev
87 $(INSTALL_DIR) $(1)/usr/include
88 $(CP) $(PKG_BUILD_DIR)/lib/mosquitto.h $(1)/usr/include
89 $(INSTALL_DIR) $(1)/usr/lib
90 # This should just get symlinked, but I can't work out the magic syntax :(
91 $(CP) $(PKG_BUILD_DIR)/lib/libmosquitto.so.0 $(1)/usr/lib/libmosquitto.so
92 endef
93
94 # This installs files on the target. Compare with Build/InstallDev
95 define Package/libmosquitto/install
96 $(INSTALL_DIR) $(1)/usr/lib
97 $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/libmosquitto.so.0 $(1)/usr/lib/libmosquitto.so.0
98 endef
99 $(eval $(call BuildPackage,mosquitto))
100 $(eval $(call BuildPackage,libmosquitto))
101 $(eval $(call BuildPackage,mosquitto-client))