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