summaryrefslogtreecommitdiffstats
path: root/meta-oe/dynamic-layers/meta-python/recipes-connectivity/thingsboard-gateway/thingsboard-gateway_3.8.3.bb
blob: 806d9d24e0bdaeb4af21d2331091f3c61f4f5b0a (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
SUMMARY = "Open-source IoT platform for data collection, processing, visualization, and device management"
DESCRIPTION = "\
The Thingsboard IoT Gateway is an open-source solution that allows you \
to integrate devices connected to legacy and third-party systems with Thingsboard."
HOMEPAGE = "https://thingsboard.io/"

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"

SRCREV = "7f7e0bf061bf92c2feb12b5098620f118dce364b"
PYPI_SRC_URI = "git://github.com/thingsboard/${BPN};protocol=https;branch=master;tag=${PV}"
PYPI_PACKAGE = "thingsboard-gateway"

inherit pypi setuptools3

RDEPENDS:${PN} += " python3-jsonpath-rw \
                    python3-regex \
                    python3-paho-mqtt \
                    python3-pyyaml \
                    python3-simplejson \
                    python3-requests \
                    python3-pip \
                    python3-pyrsistent \
                    python3-cachetools \
                    python3-orjson \
                    python3-psutil \
                    python3-pybase64 \
                    python3-grpcio \
                    python3-packaging \
                    python3-protobuf \
                    python3-service-identity \
                    python3-termcolor \
                    python3-charset-normalizer \
                    python3-mmh3 \
                    python3-dateutil \
                    python3-setuptools \
                    python3-urllib3 \
                    python3-questionary \
                    python3-pyfiglet \
                    python3-cryptography \
                    python3-pysocks \
"

SRC_URI += "file://thingsboard-gateway.service"

inherit systemd useradd

SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "thingsboard-gateway.service"

USERADD_PACKAGES = "${PN}"
USERADD_PARAM:${PN} = " \
    --system --no-create-home \
    --comment 'ThingsBoard-Gateway Service' \
    --home-dir ${localstatedir}/lib/${BPN} \
    --shell ${base_sbindir}/nologin \
    --gid thingsboard_gateway thingsboard_gateway"
GROUPADD_PARAM:${PN} = "--system thingsboard_gateway"

FILES:${PN} += "/etc \
                /lib \
                /usr \
                ${localstatedir} \
"

do_install:append(){
    install -d ${D}${sysconfdir}/${BPN}/config
    install -m 0644 ${S}/thingsboard_gateway/config/*.json ${D}${sysconfdir}/${BPN}/config
    chown -R thingsboard_gateway:thingsboard_gateway ${D}${sysconfdir}/${BPN}

    install -d ${D}${systemd_system_unitdir}/
    install -m 0644 ${UNPACKDIR}/thingsboard-gateway.service ${D}${systemd_system_unitdir}/thingsboard-gateway.service

    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
        install -d ${D}${sysconfdir}/tmpfiles.d
        echo "d ${localstatedir}/log/${BPN} 0755 thingsboard_gateway thingsboard_gateway -" \
            > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
        echo "d ${localstatedir}/lib/${BPN} 0755 thingsboard_gateway thingsboard_gateway -" \
            >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
    fi
}