summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-connectivity/mosquitto/files
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-09-01 16:02:32 +1200
committerMartin Jansa <Martin.Jansa@gmail.com>2017-09-07 10:57:36 +0200
commite1b4dc72435bc3d61d2465c198207b9186894a05 (patch)
tree3e4556eee7cac8bbfdc7362bcf8917079ffd7fd0 /meta-oe/recipes-connectivity/mosquitto/files
parent863d7a963908a1f38bd152e67c3620737cb21c8a (diff)
downloadmeta-openembedded-e1b4dc72435bc3d61d2465c198207b9186894a05.tar.gz
mosquitto: add from meta-intel-iot-middleware and update
The following improvements have been made over the recipe that was in meta-intel-iot-middleware (a layer which is no longer actively maintained): * Upgrade to 1.4.14 * Use correct LICENSE value (license changed back in version 1.4) * Add files containing the actual license terms to LIC_FILES_CHKSUM * Make optional dependencies optional through PACKAGECONFIG (c-ares dependency now defaults to disabled) * Use ${prefix} instead of /usr * Drop python package since the python client was removed in 1.4 * SUMMARY and DESCRIPTION now reflect that it also supports MQTT 3.1.1 * Add brief description and Upstream-Status to build.patch * Drop PR = "r0" * Drop unnecessary setting of FILES_${PN}-staticdev since the default already includes this file * Move SRC_URI checksums next to SRC_URI * Move inherit of systemd further up Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-connectivity/mosquitto/files')
-rw-r--r--meta-oe/recipes-connectivity/mosquitto/files/build.patch94
-rw-r--r--meta-oe/recipes-connectivity/mosquitto/files/mosquitto.init89
-rw-r--r--meta-oe/recipes-connectivity/mosquitto/files/mosquitto.service15
3 files changed, 198 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/mosquitto/files/build.patch b/meta-oe/recipes-connectivity/mosquitto/files/build.patch
new file mode 100644
index 000000000..0d0912b7a
--- /dev/null
+++ b/meta-oe/recipes-connectivity/mosquitto/files/build.patch
@@ -0,0 +1,94 @@
1From ebd7c8e548e9b8e096ee4c390173db9a701f2604 Mon Sep 17 00:00:00 2001
2From: Bruno Bottazzini <bruno.bottazzini@intel.com>
3Date: Wed, 23 Mar 2016 11:18:26 -0300
4Subject: [PATCH] build
5
6Disable stripping and allow easily overriding prefix
7
8Upstream-Status: Pending
9
10Signed-off-by: Bruno Bottazzini <bruno.bottazzini@intel.com>
11---
12 client/Makefile | 4 ++--
13 config.mk | 2 +-
14 lib/Makefile | 2 +-
15 lib/cpp/Makefile | 2 +-
16 src/Makefile | 4 ++--
17 5 files changed, 7 insertions(+), 7 deletions(-)
18
19diff --git a/client/Makefile b/client/Makefile
20index bd65355..4e5a640 100644
21--- a/client/Makefile
22+++ b/client/Makefile
23@@ -24,8 +24,8 @@ client_shared.o : client_shared.c client
24
25 install : all
26 $(INSTALL) -d ${DESTDIR}$(prefix)/bin
27- $(INSTALL) -s --strip-program=${CROSS_COMPILE}${STRIP} mosquitto_pub ${DESTDIR}${prefix}/bin/mosquitto_pub
28- $(INSTALL) -s --strip-program=${CROSS_COMPILE}${STRIP} mosquitto_sub ${DESTDIR}${prefix}/bin/mosquitto_sub
29+ $(INSTALL) mosquitto_pub ${DESTDIR}${prefix}/bin/mosquitto_pub
30+ $(INSTALL) mosquitto_sub ${DESTDIR}${prefix}/bin/mosquitto_sub
31
32 uninstall :
33 -rm -f ${DESTDIR}${prefix}/bin/mosquitto_pub
34diff --git a/config.mk b/config.mk
35index c0f175f..3427b83 100644
36--- a/config.mk
37+++ b/config.mk
38@@ -241,7 +241,7 @@ ifeq ($(WITH_DOCS),yes)
39 endif
40
41 INSTALL?=install
42-prefix=/usr/local
43+prefix?=/usr
44 mandir=${prefix}/share/man
45 localedir=${prefix}/share/locale
46 STRIP?=strip
47diff --git a/lib/Makefile b/lib/Makefile
48index 825fcea..9b7c05c 100644
49--- a/lib/Makefile
50+++ b/lib/Makefile
51@@ -25,7 +25,7 @@ all : libmosquitto.so.${SOVERSION} libmo
52
53 install : all
54 $(INSTALL) -d ${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/
55- $(INSTALL) -s --strip-program=${CROSS_COMPILE}${STRIP} libmosquitto.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.so.${SOVERSION}
56+ $(INSTALL) libmosquitto.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.so.${SOVERSION}
57 ln -sf libmosquitto.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquitto.so
58 $(INSTALL) -d ${DESTDIR}${prefix}/include/
59 $(INSTALL) mosquitto.h ${DESTDIR}${prefix}/include/mosquitto.h
60diff --git a/lib/cpp/Makefile b/lib/cpp/Makefile
61index 8b627d3..cdb2923 100644
62--- a/lib/cpp/Makefile
63+++ b/lib/cpp/Makefile
64@@ -10,7 +10,7 @@ all : libmosquittopp.so.${SOVERSION}
65
66 install : all
67 $(INSTALL) -d ${DESTDIR}$(prefix)/lib${LIB_SUFFIX}/
68- $(INSTALL) -s --strip-program=${CROSS_COMPILE}${STRIP} libmosquittopp.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so.${SOVERSION}
69+ $(INSTALL) libmosquittopp.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so.${SOVERSION}
70 ln -sf libmosquittopp.so.${SOVERSION} ${DESTDIR}${prefix}/lib${LIB_SUFFIX}/libmosquittopp.so
71 $(INSTALL) -d ${DESTDIR}${prefix}/include/
72 $(INSTALL) mosquittopp.h ${DESTDIR}${prefix}/include/mosquittopp.h
73diff --git a/src/Makefile b/src/Makefile
74index 2cfb7d4..9a97644 100644
75--- a/src/Makefile
76+++ b/src/Makefile
77@@ -103,12 +103,12 @@ mosquitto_passwd.o : mosquitto_passwd.c
78
79 install : all
80 $(INSTALL) -d ${DESTDIR}$(prefix)/sbin
81- $(INSTALL) -s --strip-program=${CROSS_COMPILE}${STRIP} mosquitto ${DESTDIR}${prefix}/sbin/mosquitto
82+ $(INSTALL) mosquitto ${DESTDIR}${prefix}/sbin/mosquitto
83 $(INSTALL) -d ${DESTDIR}$(prefix)/include
84 $(INSTALL) mosquitto_plugin.h ${DESTDIR}${prefix}/include/mosquitto_plugin.h
85 ifeq ($(WITH_TLS),yes)
86 $(INSTALL) -d ${DESTDIR}$(prefix)/bin
87- $(INSTALL) -s --strip-program=${CROSS_COMPILE}${STRIP} mosquitto_passwd ${DESTDIR}${prefix}/bin/mosquitto_passwd
88+ $(INSTALL) mosquitto_passwd ${DESTDIR}${prefix}/bin/mosquitto_passwd
89 endif
90
91 uninstall :
92--
932.7.1
94
diff --git a/meta-oe/recipes-connectivity/mosquitto/files/mosquitto.init b/meta-oe/recipes-connectivity/mosquitto/files/mosquitto.init
new file mode 100644
index 000000000..d2a27b273
--- /dev/null
+++ b/meta-oe/recipes-connectivity/mosquitto/files/mosquitto.init
@@ -0,0 +1,89 @@
1#! /bin/sh
2
3# Based on the Debian initscript for mosquitto
4
5### BEGIN INIT INFO
6# Provides: mosquitto
7# Required-Start: $remote_fs $syslog
8# Required-Stop: $remote_fs $syslog
9# Default-Start: 2 3 4 5
10# Default-Stop: 0 1 6
11# Short-Description: mosquitto MQTT v3.1 message broker
12# Description:
13# This is a message broker that supports version 3.1 of the MQ Telemetry
14# Transport (MQTT) protocol.
15#
16# MQTT provides a method of carrying out messaging using a publish/subscribe
17# model. It is lightweight, both in terms of bandwidth usage and ease of
18# implementation. This makes it particularly useful at the edge of the network
19# where a sensor or other simple device may be implemented using an arduino for
20# example.
21### END INIT INFO
22
23set -e
24
25PIDFILE=@LOCALSTATEDIR@/run/mosquitto.pid
26DAEMON=@SBINDIR@/mosquitto
27
28# start and stop the mosquitto MQTT message broker
29
30test -x ${DAEMON} || exit 0
31
32umask 022
33
34. @SYSCONFDIR@/init.d/functions
35
36export PATH="${PATH:+$PATH:}@SBINDIR@:@BASE_SBINDIR@"
37
38case "$1" in
39 start)
40 echo "Starting Mosquitto message broker" "mosquitto"
41 if start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} ; then
42 exit 0
43 else
44 exit 1
45 fi
46 ;;
47 stop)
48 echo "Stopping Mosquitto message broker" "mosquitto"
49 if start-stop-daemon --stop --quiet --oknodo --pidfile ${PIDFILE}; then
50 rm -f ${PIDFILE}
51 exit 0
52 else
53 exit 1
54 fi
55 ;;
56
57
58 reload|force-reload)
59 if [ -f ${PIDFILE} ] ; then
60 echo "Reloading configuration for mosquitto"
61 pid=`cat ${PIDFILE}`
62 kill -HUP $pid
63 else
64 echo "mosquitto does not seem to be running"
65 fi
66 ;;
67
68 restart)
69 echo "Restarting Mosquitto message broker" "mosquitto"
70 if start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile ${PIDFILE}; then
71 rm -f ${PIDFILE}
72 fi
73 if start-stop-daemon --start --quiet --oknodo --background --make-pidfile --pidfile ${PIDFILE} --exec ${DAEMON} -- -c @SYSCONFDIR@/mosquitto/mosquitto.conf ; then
74 exit 0
75 else
76 exit 1
77 fi
78 ;;
79
80 status)
81 status ${DAEMON} && exit 0 || exit $?
82 ;;
83
84 *)
85 echo "Usage: $0 {start|stop|reload|force-reload|restart|status}"
86 exit 1
87esac
88
89exit 0
diff --git a/meta-oe/recipes-connectivity/mosquitto/files/mosquitto.service b/meta-oe/recipes-connectivity/mosquitto/files/mosquitto.service
new file mode 100644
index 000000000..25f68fae0
--- /dev/null
+++ b/meta-oe/recipes-connectivity/mosquitto/files/mosquitto.service
@@ -0,0 +1,15 @@
1[Unit]
2Description=Mosquitto - lightweight server implementation of the MQTT and MQTT-SN protocols
3ConditionPathExists=/etc/mosquitto/mosquitto.conf
4After=network.target
5
6[Service]
7Type=simple
8ExecStartPre=/bin/rm -f /var/run/mosquitto.pid
9ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
10ExecReload=/bin/kill -HUP $MAINPID
11PIDFile=/var/run/mosquitto.pid
12Restart=on-failure
13
14[Install]
15WantedBy=multi-user.target