summaryrefslogtreecommitdiff
path: root/recipes-connectivity/mosquitto/mosquitto_1.5.1.bb
blob: 947dcdfe7e6647c8bdfb4c5f79af82d64a54ece8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# This recipe was a merger of the Multitech Daisy 3.5 Recipe with the
# reciped found at:
# http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel-iot-middleware/plain/recipes-connectivity/mosquitto/mosquitto_1.4.10.bb
inherit autotools-brokensep
SUMMARY = "Open source MQTT v3.5 implemention"
DESCRIPTION = "Mosquitto is an open source (BSD licensed) message broker that implements the MQ Telemetry Transport protocol version 3.5. MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model. "
HOMEPAGE = "http://mosquitto.org/"
SECTION = "console/network"
LICENSE = "EPL-1.0 & EDL-1.0"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=62ddc846179e908dc0c8efec4a42ef20"

# util-linux is needed to provide libuuid dependancy
DEPENDS = "c-ares openssl util-linux"

PR = "r3"

SRC_URI = "http://mosquitto.org/files/source/${PN}-${PV}.tar.gz \
           file://mosquitto.init \
           file://mosquitto.conf \
           file://mosquitto.default \
           file://mosquitto.logrotate.conf \
           file://config_mk.patch \
           "
SRC_URI[md5sum] = "f98c99998a36a234f3a9d9b402b991db"
SRC_URI[sha256sum] = "8557bc7ae34dfaf32a0fb56d2491b7a7f731269c88337227233013502df4d5b0"

export LIB_SUFFIX="${@d.getVar('baselib', True).replace('lib', '')}"
inherit autotools update-rc.d

INITSCRIPT_NAME = "mosquitto"
INITSCRIPT_PARAMS = "defaults 70 30"
do_compile() {
    WITH_STATIC_LIBRARIES=1 oe_runmake PREFIX=/usr WITH_STATIC_LIBRARIES=1
}
do_install() {
    # oe_runmake DESTDIR=${D} prefix=/usr install
	oe_runmake install DESTDIR=${D}
	install -m 0755 -d ${D}/usr/lib
    install -m 0644 lib/libmosquitto.a ${D}${libdir}/

    install -d ${D}${sysconfdir}/init.d
    install -d ${D}${sysconfdir}/default
    install -m 0755 ${WORKDIR}/mosquitto.init ${D}${sysconfdir}/init.d/mosquitto
    install -m 0644 ${WORKDIR}/mosquitto.conf ${D}${sysconfdir}/mosquitto/
    install -m 0644 ${WORKDIR}/mosquitto.default ${D}${sysconfdir}/default/mosquitto

    install -d ${D}${sysconfdir}/logrotate.d
    install -m 0644 ${WORKDIR}/mosquitto.logrotate.conf ${D}${sysconfdir}/logrotate.d/mosquitto.conf
}

do_rm_work() {
    echo "skipping"
}


PACKAGES += "libmosquitto1 libmosquittopp1 ${PN}-clients ${PN}-python"

CONFFILES_${PN} = "${sysconfdir}/mosquitto.conf ${sysconfdir}/default/mosquitto"
FILES_${PN} = "${sbindir}/mosquitto \
               ${bindir}/mosquitto_passwd \
               ${sysconfdir}/mosquitto \
               ${systemd_unitdir}/system/mosquitto.service \
               ${sysconfdir}/ \
"

FILES_libmosquitto1 = "${libdir}/libmosquitto.so.1"

FILES_libmosquittopp1 = "${libdir}/libmosquittopp.so.1"

FILES_${PN}-clients = "${bindir}/mosquitto_pub \
                       ${bindir}/mosquitto_sub \
"

FILES_${PN}-staticdev += "${libdir}/libmosquitto.a"

FILES_${PN}-python = "/usr/lib/python2.7/site-packages"

inherit systemd

SYSTEMD_SERVICE_${PN} = "mosquitto.service"