Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [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 | " |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 11 | DEPENDS = "uthash" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 12 | |
| 13 | SRC_URI = "http://mosquitto.org/files/source/mosquitto-${PV}.tar.gz \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 14 | file://0001-config.mk-allow-prefix-mandir-localedir-from-environ.patch \ |
| 15 | file://0002-uthash-remove-in-tree-version.patch \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 16 | file://mosquitto.service \ |
| 17 | file://mosquitto.init \ |
| 18 | " |
| 19 | |
| 20 | SRC_URI[md5sum] = "6b0966e93f118bc71ad7b61600a6c2d3" |
| 21 | SRC_URI[sha256sum] = "156b1fa731d12baad4b8b22f7b6a8af50ba881fc711b81e9919ec103cf2942d1" |
| 22 | |
| 23 | inherit systemd update-rc.d useradd |
| 24 | |
| 25 | PACKAGECONFIG ??= "ssl uuid" |
| 26 | |
| 27 | PACKAGECONFIG[dns-srv] = ",,c-ares" |
| 28 | PACKAGECONFIG[ssl] = ",,openssl" |
| 29 | PACKAGECONFIG[uuid] = ",,util-linux" |
| 30 | EXTRA_OEMAKE = "${@bb.utils.contains('PACKAGECONFIG', 'dns-srv', 'WITH_SRV=yes', 'WITH_SRV=no', d)} \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 31 | STRIP=/bin/true \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 32 | 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 | |
| 36 | export LIB_SUFFIX="${@d.getVar('baselib', True).replace('lib', '')}" |
| 37 | |
| 38 | do_compile() { |
| 39 | oe_runmake PREFIX=${prefix} |
| 40 | } |
| 41 | |
| 42 | do_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 | |
| 59 | PACKAGES += "libmosquitto1 libmosquittopp1 ${PN}-clients" |
| 60 | |
| 61 | FILES_${PN} = "${sbindir}/mosquitto \ |
| 62 | ${bindir}/mosquitto_passwd \ |
| 63 | ${sysconfdir}/mosquitto \ |
| 64 | ${sysconfdir}/init.d \ |
| 65 | ${systemd_unitdir}/system/mosquitto.service \ |
| 66 | " |
| 67 | |
| 68 | FILES_libmosquitto1 = "${libdir}/libmosquitto.so.1" |
| 69 | |
| 70 | FILES_libmosquittopp1 = "${libdir}/libmosquittopp.so.1" |
| 71 | |
| 72 | FILES_${PN}-clients = "${bindir}/mosquitto_pub \ |
| 73 | ${bindir}/mosquitto_sub \ |
| 74 | " |
| 75 | |
| 76 | SYSTEMD_SERVICE_${PN} = "mosquitto.service" |
| 77 | |
| 78 | INITSCRIPT_NAME = "mosquitto" |
| 79 | INITSCRIPT_PARAMS = "defaults 30" |
| 80 | |
| 81 | USERADD_PACKAGES = "${PN}" |
| 82 | USERADD_PARAM_${PN} = "--system --no-create-home --shell /bin/false \ |
| 83 | --user-group mosquitto" |