blob: d2fa9cf32279e0e5249fc0d4b23b9484455b6f21 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "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. "
7HOMEPAGE = "http://mosquitto.org/"
8SECTION = "console/network"
Andrew Geisslerac970dd2021-02-12 15:32:45 -06009LICENSE = "EPL-2.0 | EDL-1.0"
10LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=ca9a8f366c6babf593e374d0d7d58749 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050011 file://edl-v10;md5=c09f121939f063aeb5235972be8c722c \
Andrew Geisslerac970dd2021-02-12 15:32:45 -060012 file://epl-v20;md5=d9fc0efef5228704e7f5b37f27192723 \
Andrew Geissler69721092021-07-23 12:57:00 -040013 file://NOTICE.md;md5=a7a91b4754c6f7995020d1b49bc829c6 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050014"
Andrew Geisslerac970dd2021-02-12 15:32:45 -060015DEPENDS = "uthash cjson dlt-daemon"
Andrew Geissler82c905d2020-04-13 13:39:40 -050016
17SRC_URI = "http://mosquitto.org/files/source/mosquitto-${PV}.tar.gz \
18 file://mosquitto.init \
19 file://1571.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050020"
21
William A. Kennington III49e95662021-09-15 16:19:36 -070022SRC_URI[sha256sum] = "31cf0065cb431d6f4e57a5f4d56663e839c9d177362eff89582d7cfde191c933"
Andrew Geissler82c905d2020-04-13 13:39:40 -050023
Andrew Geissler5199d832021-09-24 16:47:35 -050024inherit systemd update-rc.d useradd cmake pkgconfig
Andrew Geissler82c905d2020-04-13 13:39:40 -050025
26PACKAGECONFIG ??= "ssl dlt websockets \
27 ${@bb.utils.filter('DISTRO_FEATURES','systemd', d)} \
28 "
29
Andrew Geisslerac970dd2021-02-12 15:32:45 -060030PACKAGECONFIG[manpages] = "-DDOCUMENTATION=ON,-DDOCUMENTATION=OFF,libxslt-native docbook-xsl-stylesheets-native"
Andrew Geissler82c905d2020-04-13 13:39:40 -050031PACKAGECONFIG[dns-srv] = "-DWITH_SRV=ON,-DWITH_SRV=OFF,c-ares"
Andrew Geissler89770b02020-06-13 10:40:47 -050032PACKAGECONFIG[ssl] = "-DWITH_TLS=ON -DWITH_TLS_PSK=ON -DWITH_EC=ON,-DWITH_TLS=OFF -DWITH_TLS_PSK=OFF -DWITH_EC=OFF,openssl"
Andrew Geissler82c905d2020-04-13 13:39:40 -050033PACKAGECONFIG[systemd] = "-DWITH_SYSTEMD=ON,-DWITH_SYSTEMD=OFF,systemd"
34PACKAGECONFIG[websockets] = "-DWITH_WEBSOCKETS=ON,-DWITH_WEBSOCKETS=OFF,libwebsockets"
35PACKAGECONFIG[dlt] = "-DWITH_DLT=ON,-DWITH_DLT=OFF,dlt-daemon"
36
37EXTRA_OECMAKE = " \
38 -DWITH_BUNDLED_DEPS=OFF \
39 -DWITH_ADNS=ON \
40"
41
Patrick Williams213cb262021-08-07 19:21:33 -050042do_install:append() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050043 install -d ${D}${systemd_unitdir}/system/
44 install -m 0644 ${S}/service/systemd/mosquitto.service.notify ${D}${systemd_unitdir}/system/mosquitto.service
45
46 install -d ${D}${sysconfdir}/init.d/
47 install -m 0755 ${WORKDIR}/mosquitto.init ${D}${sysconfdir}/init.d/mosquitto
48 sed -i -e 's,@SBINDIR@,${sbindir},g' \
49 -e 's,@BASE_SBINDIR@,${base_sbindir},g' \
50 -e 's,@LOCALSTATEDIR@,${localstatedir},g' \
51 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
52 ${D}${sysconfdir}/init.d/mosquitto
53}
54
55PACKAGES += "libmosquitto1 libmosquittopp1 ${PN}-clients"
56
57PACKAGE_BEFORE_PN = "${PN}-examples"
58
Patrick Williams213cb262021-08-07 19:21:33 -050059FILES:${PN} = "${sbindir}/mosquitto \
Andrew Geissler82c905d2020-04-13 13:39:40 -050060 ${bindir}/mosquitto_passwd \
Andrew Geisslerac970dd2021-02-12 15:32:45 -060061 ${bindir}/mosquitto_ctrl \
62 ${libdir}/mosquitto_dynamic_security.so \
Andrew Geissler82c905d2020-04-13 13:39:40 -050063 ${sysconfdir}/mosquitto \
64 ${sysconfdir}/init.d \
65 ${systemd_unitdir}/system/mosquitto.service \
66"
67
Patrick Williams213cb262021-08-07 19:21:33 -050068CONFFILES:${PN} += "${sysconfdir}/mosquitto/mosquitto.conf"
Andrew Geissler82c905d2020-04-13 13:39:40 -050069
Patrick Williams213cb262021-08-07 19:21:33 -050070FILES:libmosquitto1 = "${libdir}/libmosquitto.so.*"
Andrew Geissler82c905d2020-04-13 13:39:40 -050071
Patrick Williams213cb262021-08-07 19:21:33 -050072FILES:libmosquittopp1 = "${libdir}/libmosquittopp.so.*"
Andrew Geissler82c905d2020-04-13 13:39:40 -050073
Patrick Williams213cb262021-08-07 19:21:33 -050074FILES:${PN}-clients = "${bindir}/mosquitto_pub \
Andrew Geissler82c905d2020-04-13 13:39:40 -050075 ${bindir}/mosquitto_sub \
76 ${bindir}/mosquitto_rr \
77"
78
Patrick Williams213cb262021-08-07 19:21:33 -050079FILES:${PN}-examples = "${sysconfdir}/mosquitto/*.example"
Andrew Geissler82c905d2020-04-13 13:39:40 -050080
Patrick Williams213cb262021-08-07 19:21:33 -050081SYSTEMD_SERVICE:${PN} = "mosquitto.service"
Andrew Geissler82c905d2020-04-13 13:39:40 -050082
83INITSCRIPT_NAME = "mosquitto"
84INITSCRIPT_PARAMS = "defaults 30"
85
86USERADD_PACKAGES = "${PN}"
Patrick Williams213cb262021-08-07 19:21:33 -050087USERADD_PARAM:${PN} = "--system --no-create-home --shell /bin/false \
Andrew Geissler82c905d2020-04-13 13:39:40 -050088 --user-group mosquitto"
Andrew Geissler89770b02020-06-13 10:40:47 -050089
90BBCLASSEXTEND += "native nativesdk"