Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 1 | SUMMARY = "Open source MQTT v3.1/3.1.1 implemention" |
| 2 | DESCRIPTION = "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. " |
| 3 | HOMEPAGE = "http://mosquitto.org/" |
| 4 | SECTION = "console/network" |
| 5 | LICENSE = "EPL-1.0 | EDL-1.0" |
| 6 | LIC_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 | " |
| 11 | DEPENDS = "uthash" |
| 12 | |
| 13 | SRC_URI = "http://mosquitto.org/files/source/mosquitto-${PV}.tar.gz \ |
| 14 | file://mosquitto.init \ |
| 15 | " |
| 16 | |
| 17 | SRC_URI[md5sum] = "bbbcceb32db3657d9d436a8440a9db1c" |
| 18 | SRC_URI[sha256sum] = "78d7e70c3794dc3a1d484b4f2f8d3addebe9c2da3f5a1cebe557f7d13beb0da4" |
| 19 | |
| 20 | inherit systemd update-rc.d useradd |
| 21 | |
| 22 | PACKAGECONFIG ??= "ssl uuid \ |
| 23 | ${@bb.utils.filter('DISTRO_FEATURES','systemd', d)} \ |
| 24 | " |
| 25 | |
| 26 | PACKAGECONFIG[dns-srv] = "WITH_SRV=yes,WITH_SRV=no,c-ares" |
| 27 | PACKAGECONFIG[ssl] = "WITH_TLS=yes WITH_TLS_PSK=yes,WITH_TLS=no WITH_TLS_PSK=no,openssl" |
| 28 | PACKAGECONFIG[uuid] = "WITH_UUID=yes,WITH_UUID=no,util-linux" |
| 29 | PACKAGECONFIG[systemd] = "WITH_SYSTEMD=yes,WITH_SYSTEMD=no,systemd" |
| 30 | PACKAGECONFIG[websockets] = "WITH_WEBSOCKETS=yes,WITH_WEBSOCKETS=no,libwebsockets" |
| 31 | |
| 32 | EXTRA_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 | |
| 42 | export LIB_SUFFIX = "${@d.getVar('baselib').replace('lib', '')}" |
| 43 | |
| 44 | do_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 | |
| 63 | PACKAGES += "libmosquitto1 libmosquittopp1 ${PN}-clients" |
| 64 | |
| 65 | PACKAGE_BEFORE_PN = "${PN}-examples" |
| 66 | |
| 67 | FILES_${PN} = "${sbindir}/mosquitto \ |
| 68 | ${bindir}/mosquitto_passwd \ |
| 69 | ${sysconfdir}/mosquitto \ |
| 70 | ${sysconfdir}/init.d \ |
| 71 | ${systemd_unitdir}/system/mosquitto.service \ |
| 72 | " |
| 73 | |
| 74 | CONFFILES_${PN} += "${sysconfdir}/mosquitto/mosquitto.conf" |
| 75 | |
| 76 | FILES_libmosquitto1 = "${libdir}/libmosquitto.so.1" |
| 77 | |
| 78 | FILES_libmosquittopp1 = "${libdir}/libmosquittopp.so.1" |
| 79 | |
| 80 | FILES_${PN}-clients = "${bindir}/mosquitto_pub \ |
| 81 | ${bindir}/mosquitto_sub \ |
| 82 | " |
| 83 | |
| 84 | FILES_${PN}-examples = "${sysconfdir}/mosquitto/*.example" |
| 85 | |
| 86 | SYSTEMD_SERVICE_${PN} = "mosquitto.service" |
| 87 | |
| 88 | INITSCRIPT_NAME = "mosquitto" |
| 89 | INITSCRIPT_PARAMS = "defaults 30" |
| 90 | |
| 91 | USERADD_PACKAGES = "${PN}" |
| 92 | USERADD_PARAM_${PN} = "--system --no-create-home --shell /bin/false \ |
| 93 | --user-group mosquitto" |