Skip to content

Commit 05bb86c

Browse files
author
Alex J Lennon
committed
Update uwb-mqtt-publisher recipe for new directory structure (src/, config/, systemd/)
1 parent f436b13 commit 05bb86c

File tree

1 file changed

+35
-10
lines changed

1 file changed

+35
-10
lines changed

recipes-connectivity/uwb-mqtt-publisher/uwb-mqtt-publisher_1.0.bb

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ DESCRIPTION = "A service that reads UWB positioning data from serial and publish
33
LICENSE = "CLOSED"
44
LIC_FILES_CHKSUM = ""
55

6-
SRC_URI = "file://mqtt-live-publisher.py \
6+
SRC_URI = "git://github.com/DynamicDevices/uwb-mqtt-publisher.git;protocol=https;branch=main \
77
file://uwb-mqtt-publisher.service \
88
file://uwb-mqtt-publisher.conf \
99
file://uwb-mqtt-publisher.default"
1010

11-
S = "${WORKDIR}"
11+
SRCREV = "${AUTOREV}"
12+
PV = "1.0+git${SRCPV}"
13+
14+
S = "${WORKDIR}/git"
1215

1316
# Runtime dependencies
1417
RDEPENDS:${PN} = "python3 \
@@ -24,25 +27,47 @@ SYSTEMD_AUTO_ENABLE:${PN} = "enable"
2427

2528
# Install files
2629
do_install() {
27-
# Install the Python script
30+
# Install the Python scripts from git repository (now in src/ directory)
2831
install -d ${D}${bindir}
29-
install -m 0755 ${WORKDIR}/mqtt-live-publisher.py ${D}${bindir}/uwb-mqtt-publisher
32+
install -m 0755 ${S}/src/mqtt-live-publisher.py ${D}${bindir}/uwb-mqtt-publisher
33+
install -m 0644 ${S}/src/uwb_network_converter.py ${D}${bindir}/uwb_network_converter.py
34+
install -m 0644 ${S}/src/lora_tag_cache.py ${D}${bindir}/lora_tag_cache.py
35+
36+
# Install anchor configuration from git repository (now in config/ directory)
37+
install -d ${D}${sysconfdir}
38+
install -m 0644 ${S}/config/uwb_anchors.json ${D}${sysconfdir}/uwb_anchors.json
3039

31-
# Install systemd service file
40+
# Install systemd service file (from local files directory or git repository)
3241
install -d ${D}${systemd_system_unitdir}
33-
install -m 0644 ${WORKDIR}/uwb-mqtt-publisher.service ${D}${systemd_system_unitdir}
42+
# Try local file first, fall back to git repository
43+
if [ -f ${WORKDIR}/uwb-mqtt-publisher.service ]; then
44+
install -m 0644 ${WORKDIR}/uwb-mqtt-publisher.service ${D}${systemd_system_unitdir}
45+
else
46+
install -m 0644 ${S}/systemd/uwb-mqtt-publisher.service ${D}${systemd_system_unitdir}
47+
fi
3448

35-
# Install configuration files
49+
# Install configuration files (from local files directory or git repository)
3650
install -d ${D}${sysconfdir}/uwb-mqtt-publisher
37-
install -m 0644 ${WORKDIR}/uwb-mqtt-publisher.conf ${D}${sysconfdir}/uwb-mqtt-publisher/
51+
if [ -f ${WORKDIR}/uwb-mqtt-publisher.conf ]; then
52+
install -m 0644 ${WORKDIR}/uwb-mqtt-publisher.conf ${D}${sysconfdir}/uwb-mqtt-publisher/
53+
else
54+
install -m 0644 ${S}/config/uwb-mqtt-publisher.conf ${D}${sysconfdir}/uwb-mqtt-publisher/
55+
fi
3856

39-
# Install default environment file
57+
# Install default environment file (from local files directory or git repository)
4058
install -d ${D}${sysconfdir}/default
41-
install -m 0644 ${WORKDIR}/uwb-mqtt-publisher.default ${D}${sysconfdir}/default/uwb-mqtt-publisher
59+
if [ -f ${WORKDIR}/uwb-mqtt-publisher.default ]; then
60+
install -m 0644 ${WORKDIR}/uwb-mqtt-publisher.default ${D}${sysconfdir}/default/uwb-mqtt-publisher
61+
else
62+
install -m 0644 ${S}/config/uwb-mqtt-publisher.default ${D}${sysconfdir}/default/uwb-mqtt-publisher
63+
fi
4264
}
4365

4466
# Package files
4567
FILES:${PN} += "${bindir}/uwb-mqtt-publisher \
68+
${bindir}/uwb_network_converter.py \
69+
${bindir}/lora_tag_cache.py \
70+
${sysconfdir}/uwb_anchors.json \
4671
${systemd_system_unitdir}/uwb-mqtt-publisher.service \
4772
${sysconfdir}/uwb-mqtt-publisher/ \
4873
${sysconfdir}/default/uwb-mqtt-publisher"

0 commit comments

Comments
 (0)