kuksa-dbc-feeder: add recipe and dependencies
[AGL/meta-agl-demo.git] / recipes-connectivity / kuksa-val / kuksa-dbc-feeder_git.bb
1 SUMMARY = "DBC feeder for KUKSA.val, the KUKSA Vehicle Abstraction Layer"
2 HOMEPAGE = "https://github.com/eclipse/kuksa.val"
3 BUGTRACKER = "https://github.com/eclipse/kuksa.val/issues"
4
5 LICENSE = "EPL-2.0"
6 LIC_FILES_CHKSUM = "file://LICENSE;md5=d9fc0efef5228704e7f5b37f27192723"
7
8 DEPENDS = "python3-setuptools-git-versioning-native"
9
10 require kuksa-val.inc
11
12 SRC_URI += "file://0001-dbc2val-add-installation-mechanism.patch \
13             file://0002-dbc2val-usability-improvements.patch \
14             file://config.ini \
15             file://dbc_feeder.json.token \
16             file://mapping.yml \
17             file://agl-vcar.dbc \
18             file://kuksa-dbc-feeder.service \
19 "
20
21 inherit setuptools3 systemd
22
23 SETUPTOOLS_SETUP_PATH = "${S}/kuksa_feeders"
24
25 # This is a bit of a workaround as the sed in distutils.bbclass
26 # will remove the -S already present in the script otherwise,
27 # breaking it.
28 PEP517_INSTALL_PYTHON = "-S python3 -u"
29
30 SYSTEMD_SERVICE:${PN} = "${BPN}.service"
31
32 do_install:append() {
33     install -d ${D}${sysconfdir}/kuksa-dbc-feeder
34     install -m 0644 ${WORKDIR}/config.ini ${D}${sysconfdir}/kuksa-dbc-feeder/
35     # Token should ideally not be readable by other users.
36     # The potential for running the feeder as non-root will take some
37     # investigation.
38     install -m 0600 ${WORKDIR}/dbc_feeder.json.token ${D}${sysconfdir}/kuksa-dbc-feeder/
39     install -m 0644 ${WORKDIR}/mapping.yml ${D}${sysconfdir}/kuksa-dbc-feeder/
40     install -m 0644 ${WORKDIR}/agl-vcar.dbc ${D}${sysconfdir}/kuksa-dbc-feeder/
41     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
42         install -d ${D}${systemd_system_unitdir}
43         install -m 0644 ${WORKDIR}/kuksa-dbc-feeder.service ${D}${systemd_system_unitdir}
44     fi
45 }
46
47 FILES:${PN} += "${systemd_system_unitdir}"
48
49 RDEPENDS:${PN} += " \
50     bash \
51     python3-pyserial \
52     python3-cantools \
53     python3-can \
54     python3-can-j1939 \
55     python3-pyyaml \
56     python3-py-expression-eval \
57     kuksa-viss-client \
58     can-dev-helper \
59 "