summaryrefslogtreecommitdiffstats
path: root/LICENSE.MIT
blob: a6919eb7e1fdbda5d53fd9d8e0f7114f2274457b (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
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Note:
Individual files contain the following tag instead of the full license text.

    SPDX-License-Identifier: MIT

This enables machine processing of license information based on the SPDX
License Identifiers that are here available: http://spdx.org/licenses/
/ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
SUMMARY = "CAN provider for KUKSA.val, the KUKSA Vehicle Abstraction Layer"
HOMEPAGE = "https://github.com/eclipse-kuksa"
BUGTRACKER = "https://github.com/eclips-kuksa/kuksa-can-provider/issues"

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=175792518e4ac015ab6696d16c4f607e"

DEPENDS = "python3-setuptools-git-versioning-native"

PV = "0.4.3+git${SRCPV}"

SRC_URI = "git://github.com/eclipse-kuksa/kuksa-can-provider.git;protocol=https;branch=main \
           file://0001-dbc2val-add-installation-mechanism.patch \
           file://0002-dbc2val-usability-improvements.patch \
           file://0003-dbc2val-fix-token-file-configuration-option.patch \
           file://0004-Enable-val2dbc-for-sensor-values.patch \
           file://kuksa-can-provider.service \
	   file://kuksa-can-provider.default \
           "
SRCREV = "d5fdcfa7574ce69059b6f449629571db0982c1cf"

S = "${WORKDIR}/git"

inherit setuptools3 systemd update-alternatives

SYSTEMD_SERVICE:${PN} = "${BPN}.service"

do_install:append() {
    install -d ${D}${sysconfdir}/default
    install -m 0644 ${WORKDIR}/kuksa-can-provider.default ${D}${sysconfdir}/default/
    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
        install -d ${D}${systemd_system_unitdir}
        install -m 0644 ${WORKDIR}/kuksa-can-provider.service ${D}${systemd_system_unitdir}
    fi

    # Install tweaked copy of the example configuration, the .ini file
    # and the upstream demo/test files it references are packaged
    # separately from the library and daemon to make it easy to replace
    # them.
    install -d ${D}${sysconfdir}/kuksa-can-provider
    sed -e 's|^mapping =.*|mapping = /usr/share/vss/vss.json|' \
        -e 's|^dbcfile =.*|dbcfile = /usr/share/dbc/Model3CAN.dbc|' \
        -e 's|^candumpfile =.*|dbcfile = /usr/share/can/candump.log|' \
        -e 's|^dbc_default_file =.*|dbc_default_file = /etc/kuksa-can-provider/dbc_default_values.json|' \
	${S}/config/dbc_feeder.ini > ${D}${sysconfdir}/kuksa-can-provider/config.ini
    install -m 0644 ${S}/dbc_default_values.json ${D}${sysconfdir}/kuksa-can-provider/
    install -d ${D}${datadir}/dbc
    install -m 0644 ${S}/Model3CAN.dbc ${D}${datadir}/dbc/
    install -d ${D}${datadir}/can
    install -m 0644 ${S}/candump.log ${D}${datadir}/can/
}

ALTERNATIVE_LINK_NAME[kuksa-can-provider.env] = "${sysconfdir}/default/kuksa-can-provider"

FILES:${PN} += "${systemd_system_unitdir}"

# NOTE:
# Since the environment file is used by the systemd unit, it is packaged
# with the it in the main package, and the alternative scheme is set up
# against that. Replacement configuration packages can still configure
# the alternative as required.
ALTERNATIVE_TARGET_${PN} = "${sysconfdir}/default/kuksa-can-provider.default"

PACKAGE_BEFORE_PN += "${PN}-conf-example"

FILES:${PN}-conf-example += " \
    ${sysconfdir}/kuksa-can-provider/config.ini \
    ${sysconfdir}/kuksa-can-provider/dbc_default_values.json \
    ${datadir}/dbc/Model3CAN.dbc \
    ${datadir}/can/candump.log \
"
RPROVIDES:${PN}-conf-example = "kuksa-can-provider-conf"

RDEPENDS:${PN} += " \
    bash \
    python3-pyserial \
    python3-cantools \
    python3-can \
    python3-can-j1939 \
    python3-pyyaml \
    python3-py-expression-eval \
    kuksa-client \
    kuksa-can-provider-conf \
"