blob: 13ce3811d47e399241a2a70a7703d7da5d86ccc4 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001SUMMARY = "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"
Brad Bishop316dfdd2018-06-25 12:45:53 -040011DEPENDS = "uthash"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050012
13SRC_URI = "http://mosquitto.org/files/source/mosquitto-${PV}.tar.gz \
Brad Bishop316dfdd2018-06-25 12:45:53 -040014 file://0001-config.mk-allow-prefix-mandir-localedir-from-environ.patch \
15 file://0002-uthash-remove-in-tree-version.patch \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050016 file://mosquitto.service \
17 file://mosquitto.init \
18"
19
20SRC_URI[md5sum] = "6b0966e93f118bc71ad7b61600a6c2d3"
21SRC_URI[sha256sum] = "156b1fa731d12baad4b8b22f7b6a8af50ba881fc711b81e9919ec103cf2942d1"
22
23inherit systemd update-rc.d useradd
24
25PACKAGECONFIG ??= "ssl uuid"
26
27PACKAGECONFIG[dns-srv] = ",,c-ares"
28PACKAGECONFIG[ssl] = ",,openssl"
29PACKAGECONFIG[uuid] = ",,util-linux"
30EXTRA_OEMAKE = "${@bb.utils.contains('PACKAGECONFIG', 'dns-srv', 'WITH_SRV=yes', 'WITH_SRV=no', d)} \
Brad Bishop316dfdd2018-06-25 12:45:53 -040031 STRIP=/bin/true \
Brad Bishopd7bf8c12018-02-25 22:55:05 -050032 WITH_DOCS=no \
33 ${@bb.utils.contains('PACKAGECONFIG', 'ssl', 'WITH_TLS=yes WITH_TLS_PSK=yes', 'WITH_TLS=no WITH_TLS_PSK=no', d)} \
34 ${@bb.utils.contains('PACKAGECONFIG', 'uuid', 'WITH_UUID=yes', 'WITH_UUID=no', d)}"
35
36export LIB_SUFFIX="${@d.getVar('baselib', True).replace('lib', '')}"
37
38do_compile() {
39 oe_runmake PREFIX=${prefix}
40}
41
42do_install() {
43 oe_runmake install DESTDIR=${D}
44 install -d ${D}${libdir}
45 install -m 0644 lib/libmosquitto.a ${D}${libdir}/
46
47 install -d ${D}${systemd_unitdir}/system/
48 install -m 0644 ${WORKDIR}/mosquitto.service ${D}${systemd_unitdir}/system/
49
50 install -d ${D}${sysconfdir}/init.d/
51 install -m 0755 ${WORKDIR}/mosquitto.init ${D}${sysconfdir}/init.d/mosquitto
52 sed -i -e 's,@SBINDIR@,${sbindir},g' \
53 -e 's,@BASE_SBINDIR@,${base_sbindir},g' \
54 -e 's,@LOCALSTATEDIR@,${localstatedir},g' \
55 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
56 ${D}${sysconfdir}/init.d/mosquitto
57}
58
59PACKAGES += "libmosquitto1 libmosquittopp1 ${PN}-clients"
60
61FILES_${PN} = "${sbindir}/mosquitto \
62 ${bindir}/mosquitto_passwd \
63 ${sysconfdir}/mosquitto \
64 ${sysconfdir}/init.d \
65 ${systemd_unitdir}/system/mosquitto.service \
66"
67
68FILES_libmosquitto1 = "${libdir}/libmosquitto.so.1"
69
70FILES_libmosquittopp1 = "${libdir}/libmosquittopp.so.1"
71
72FILES_${PN}-clients = "${bindir}/mosquitto_pub \
73 ${bindir}/mosquitto_sub \
74"
75
76SYSTEMD_SERVICE_${PN} = "mosquitto.service"
77
78INITSCRIPT_NAME = "mosquitto"
79INITSCRIPT_PARAMS = "defaults 30"
80
81USERADD_PACKAGES = "${PN}"
82USERADD_PARAM_${PN} = "--system --no-create-home --shell /bin/false \
83 --user-group mosquitto"