blob: ea533d8a02024e5af046b8788713d4343edb9255 [file] [log] [blame]
Brad Bishopb809eb92019-09-18 06:27:43 -04001SUMMARY = "Open source MQTT implementation"
2DESCRIPTION = "Mosquitto is an open source (Eclipse licensed) message broker \
3that implements the MQ Telemetry Transport protocol version 3.1, 3.1.1 and \
45, providing both an MQTT broker and several command-line clients. MQTT \
5provides a lightweight method of carrying out messaging using a \
6publish/subscribe model. "
Brad Bishop19323692019-04-05 15:28:33 -04007HOMEPAGE = "http://mosquitto.org/"
8SECTION = "console/network"
9LICENSE = "EPL-1.0 | EDL-1.0"
10LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=62ddc846179e908dc0c8efec4a42ef20 \
11 file://edl-v10;md5=c09f121939f063aeb5235972be8c722c \
12 file://epl-v10;md5=8d383c379e91d20ba18a52c3e7d3a979 \
13 file://notice.html;md5=a00d6f9ab542be7babc2d8b80d5d2a4c \
14"
15DEPENDS = "uthash"
16
17SRC_URI = "http://mosquitto.org/files/source/mosquitto-${PV}.tar.gz \
18 file://mosquitto.init \
19"
20
Brad Bishope42b3e32020-01-15 22:08:42 -050021SRC_URI[md5sum] = "24a0e567c845b3e41b75e237d200edf8"
22SRC_URI[sha256sum] = "7df23c81ca37f0e070574fe74414403cf25183016433d07add6134366fb45df6"
Brad Bishop19323692019-04-05 15:28:33 -040023
24inherit systemd update-rc.d useradd
25
26PACKAGECONFIG ??= "ssl uuid \
27 ${@bb.utils.filter('DISTRO_FEATURES','systemd', d)} \
28 "
29
30PACKAGECONFIG[dns-srv] = "WITH_SRV=yes,WITH_SRV=no,c-ares"
31PACKAGECONFIG[ssl] = "WITH_TLS=yes WITH_TLS_PSK=yes,WITH_TLS=no WITH_TLS_PSK=no,openssl"
32PACKAGECONFIG[uuid] = "WITH_UUID=yes,WITH_UUID=no,util-linux"
33PACKAGECONFIG[systemd] = "WITH_SYSTEMD=yes,WITH_SYSTEMD=no,systemd"
34PACKAGECONFIG[websockets] = "WITH_WEBSOCKETS=yes,WITH_WEBSOCKETS=no,libwebsockets"
35
36EXTRA_OEMAKE = " \
37 prefix=${prefix} \
38 mandir=${mandir} \
39 localedir=${localedir} \
40 ${PACKAGECONFIG_CONFARGS} \
41 STRIP=/bin/true \
42 WITH_DOCS=no \
43 WITH_BUNDLED_DEPS=no \
44"
45
46export LIB_SUFFIX = "${@d.getVar('baselib').replace('lib', '')}"
47
48do_install() {
49 oe_runmake 'DESTDIR=${D}' install
50
51 install -d ${D}${systemd_unitdir}/system/
52 install -m 0644 ${S}/service/systemd/mosquitto.service.notify ${D}${systemd_unitdir}/system/mosquitto.service
53
54 install -d ${D}${sysconfdir}/mosquitto
55 install -m 0644 ${D}${sysconfdir}/mosquitto/mosquitto.conf.example \
56 ${D}${sysconfdir}/mosquitto/mosquitto.conf
57
58 install -d ${D}${sysconfdir}/init.d/
59 install -m 0755 ${WORKDIR}/mosquitto.init ${D}${sysconfdir}/init.d/mosquitto
60 sed -i -e 's,@SBINDIR@,${sbindir},g' \
61 -e 's,@BASE_SBINDIR@,${base_sbindir},g' \
62 -e 's,@LOCALSTATEDIR@,${localstatedir},g' \
63 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
64 ${D}${sysconfdir}/init.d/mosquitto
65}
66
67PACKAGES += "libmosquitto1 libmosquittopp1 ${PN}-clients"
68
69PACKAGE_BEFORE_PN = "${PN}-examples"
70
71FILES_${PN} = "${sbindir}/mosquitto \
72 ${bindir}/mosquitto_passwd \
73 ${sysconfdir}/mosquitto \
74 ${sysconfdir}/init.d \
75 ${systemd_unitdir}/system/mosquitto.service \
76"
77
78CONFFILES_${PN} += "${sysconfdir}/mosquitto/mosquitto.conf"
79
80FILES_libmosquitto1 = "${libdir}/libmosquitto.so.1"
81
82FILES_libmosquittopp1 = "${libdir}/libmosquittopp.so.1"
83
84FILES_${PN}-clients = "${bindir}/mosquitto_pub \
85 ${bindir}/mosquitto_sub \
Brad Bishopb809eb92019-09-18 06:27:43 -040086 ${bindir}/mosquitto_rr \
Brad Bishop19323692019-04-05 15:28:33 -040087"
88
89FILES_${PN}-examples = "${sysconfdir}/mosquitto/*.example"
90
91SYSTEMD_SERVICE_${PN} = "mosquitto.service"
92
93INITSCRIPT_NAME = "mosquitto"
94INITSCRIPT_PARAMS = "defaults 30"
95
96USERADD_PACKAGES = "${PN}"
97USERADD_PARAM_${PN} = "--system --no-create-home --shell /bin/false \
98 --user-group mosquitto"