aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/mosquitto/mosquitto_1.5.1.bb
blob: 52252787d1046a07fb0fecb51c3de294da5d1e6f (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
SUMMARY = "Open source MQTT v3.1/3.1.1 implemention"
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. "
HOMEPAGE = "http://mosquitto.org/"
SECTION = "console/network"
LICENSE = "EPL-1.0 | EDL-1.0"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=62ddc846179e908dc0c8efec4a42ef20 \
                    file://edl-v10;md5=c09f121939f063aeb5235972be8c722c \
                    file://epl-v10;md5=8d383c379e91d20ba18a52c3e7d3a979 \
                    file://notice.html;md5=a00d6f9ab542be7babc2d8b80d5d2a4c \
"
DEPENDS = "uthash"

SRC_URI = "http://mosquitto.org/files/source/mosquitto-${PV}.tar.gz \
           file://0002-uthash-remove-in-tree-version.patch \
           file://mosquitto.init \
"

SRC_URI[md5sum] = "f98c99998a36a234f3a9d9b402b991db"
SRC_URI[sha256sum] = "8557bc7ae34dfaf32a0fb56d2491b7a7f731269c88337227233013502df4d5b0"

inherit systemd update-rc.d useradd

PACKAGECONFIG ??= "ssl uuid \
                  ${@bb.utils.filter('DISTRO_FEATURES','systemd', d)} \
                  "

PACKAGECONFIG[dns-srv] = ",,c-ares"
PACKAGECONFIG[ssl] = ",,openssl"
PACKAGECONFIG[uuid] = ",,util-linux"
PACKAGECONFIG[systemd] = "WITH_SYSTEMD=yes,WITH_SYSTEMD=no,systemd"
PACKAGECONFIG[websockets] = ",,libwebsockets"

EXTRA_OEMAKE = " \
    prefix=${prefix} \
    mandir=${mandir} \
    localedir=${localedir} \
    ${@bb.utils.contains('PACKAGECONFIG', 'dns-srv', 'WITH_SRV=yes', 'WITH_SRV=no', d)} \
    ${@bb.utils.contains('PACKAGECONFIG', 'ssl', 'WITH_TLS=yes WITH_TLS_PSK=yes', 'WITH_TLS=no WITH_TLS_PSK=no', d)} \
    ${@bb.utils.contains('PACKAGECONFIG', 'uuid', 'WITH_UUID=yes', 'WITH_UUID=no', d)} \
    ${@bb.utils.contains('PACKAGECONFIG', 'websockets', 'WITH_WEBSOCKETS=yes', 'WITH_WEBSOCKETS=no', d)} \
    ${PACKAGECONFIG_CONFARGS} \
    STRIP=/bin/true \
    WITH_DOCS=no \
"

export LIB_SUFFIX = "${@d.getVar('baselib', True).replace('lib', '')}"

do_install() {
    oe_runmake 'DESTDIR=${D}' install

    install -d ${D}${systemd_unitdir}/system/
    install -m 0644 ${S}/service/systemd/mosquitto.service.notify ${D}${systemd_unitdir}/system/mosquitto.service

    install -d ${D}${sysconfdir}/mosquitto
    install -m 0644 ${D}${sysconfdir}/mosquitto/mosquitto.conf.example \
                    ${D}${sysconfdir}/mosquitto/mosquitto.conf

    install -d ${D}${sysconfdir}/init.d/
    install -m 0755 ${WORKDIR}/mosquitto.init ${D}${sysconfdir}/init.d/mosquitto
    sed -i -e 's,@SBINDIR@,${sbindir},g' \
        -e 's,@BASE_SBINDIR@,${base_sbindir},g' \
        -e 's,@LOCALSTATEDIR@,${localstatedir},g' \
        -e 's,@SYSCONFDIR@,${sysconfdir},g' \
        ${D}${sysconfdir}/init.d/mosquitto
}

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

PACKAGE_BEFORE_PN = "${PN}-examples"

FILES_${PN} = "${sbindir}/mosquitto \
               ${bindir}/mosquitto_passwd \
               ${sysconfdir}/mosquitto \
               ${sysconfdir}/init.d \
               ${systemd_unitdir}/system/mosquitto.service \
"

CONFFILES_${PN} += "${sysconfdir}/mosquitto/mosquitto.conf"

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

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

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

FILES_${PN}-examples = "${sysconfdir}/mosquitto/*.example"

SYSTEMD_SERVICE_${PN} = "mosquitto.service"

INITSCRIPT_NAME = "mosquitto"
INITSCRIPT_PARAMS = "defaults 30"

USERADD_PACKAGES = "${PN}"
USERADD_PARAM_${PN} = "--system --no-create-home --shell /bin/false \
                       --user-group mosquitto"
paule/rootfs-log-check-oe'>paule/rootfs-log-check-oe OpenEmbedded Core user contribution treesGrokmirror user
summaryrefslogtreecommitdiffstats
path: root/scripts/oe-find-native-sysroot
blob: 5146bbf99990f2f6429f48e2a1542333bab5e3e0 (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
#
# Find a native sysroot to use - either from an in-tree OE build or
# from a toolchain installation. It then ensures the variable
# $OECORE_NATIVE_SYSROOT is set to the sysroot's base directory, and sets
# $PSEUDO to the path of the pseudo binary.
#
# This script is intended to be run within other scripts by source'ing
# it, e.g:
#
# SYSROOT_SETUP_SCRIPT=`which oe-find-native-sysroot`
# . $SYSROOT_SETUP_SCRIPT <recipe>
#
# This script will terminate execution of your calling program unless
# you set a variable $SKIP_STRICT_SYSROOT_CHECK to a non-empty string
# beforehand.
#
# Copyright (c) 2010 Linux Foundation
#
# SPDX-License-Identifier: GPL-2.0-only
#

if [ "$1" = '--help' -o "$1" = '-h' -o $# -ne 1 ] ; then
    echo 'Usage: oe-find-native-sysroot <recipe> [-h|--help]'
    echo ''
    echo 'OpenEmbedded find-native-sysroot - helper script to set'
    echo 'environment variables OECORE_NATIVE_SYSROOT and PSEUDO'
    echo 'to the path of the native sysroot directory and pseudo'
    echo 'executable binary'
    echo ''
    echo 'options:'
    echo '  recipe              its STAGING_DIR_NATIVE is used as native sysroot'
    echo '  -h, --help          show this help message and exit'
    echo ''
    exit 2
fi

# Global vars
BITBAKE_E=""
set_oe_native_sysroot(){
    echo "Running bitbake -e $1"
    BITBAKE_E="`bitbake -e $1`"
    OECORE_NATIVE_SYSROOT=`echo "$BITBAKE_E" | grep ^STAGING_DIR_NATIVE= | cut -d '"' -f2`

    if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
        # This indicates that there was an error running bitbake -e that
        # the user needs to be informed of
        echo "There was an error running bitbake to determine STAGING_DIR_NATIVE"
        echo "Here is the output from bitbake -e $1"
        echo $BITBAKE_E
        exit 1
    fi
}

if [ "x$OECORE_NATIVE_SYSROOT" = "x" ]; then
    BITBAKE=`which bitbake 2> /dev/null`
    if [ "x$BITBAKE" != "x" ]; then
        if [ "$UID" = "0" ]; then
            # Root cannot run bitbake unless sanity checking is disabled
            if [ ! -d "./conf" ]; then
                echo "Error: root cannot run bitbake by default, and I cannot find a ./conf directory to be able to disable sanity checking"
                exit 1
            fi
            touch conf/sanity.conf
            set_oe_native_sysroot $1
            rm -f conf/sanity.conf
        else
            set_oe_native_sysroot $1
        fi
    else
        echo "Error: Unable to locate bitbake command."
        echo "Did you forget to source the build environment setup script?"

        if [ -z "$SKIP_STRICT_SYSROOT_CHECK" ]; then
            exit 1
        fi
    fi
fi

if [ ! -e "$OECORE_NATIVE_SYSROOT/" ]; then
    echo "Error: $OECORE_NATIVE_SYSROOT doesn't exist."

    if [ "x$OECORE_DISTRO_VERSION" = "x" ]; then
        if [[ $1 =~ .*native.* ]]; then
            echo "Have you run 'bitbake $1 -caddto_recipe_sysroot'?"
        else
            echo "Have you run 'bitbake $1 '?"
        fi
    else
        echo "This shouldn't happen - something is wrong with your toolchain installation"
    fi

    if [ -z "$SKIP_STRICT_SYSROOT_CHECK" ]; then
        exit 1
    fi
fi

# Set up pseudo command
pseudo="$OECORE_NATIVE_SYSROOT/usr/bin/pseudo"
if [ -e "$pseudo" ]; then
    echo "PSEUDO=$pseudo"
    PSEUDO="$pseudo"
fi