summaryrefslogtreecommitdiffstats
path: root/recipes-core/udev/usb-can-udev-conf_1.0.bb
blob: 6b92d58231b55b49a134e200f2d0d3573a0a37f0 (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
SUMMARY = "USB CAN adapter udev configuration"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"

SRC_URI = "file://60-usb-can.rules \
           file://slcand@.service \
           file://slcand-default \
"

S = "${WORKDIR}/sources"
UNPACKDIR = "${S}"

do_compile[noexec] = "1"

do_install() {
    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
        install -d ${D}${sysconfdir}/udev/rules.d
        install -m 0644 ${UNPACKDIR}/60-usb-can.rules ${D}${sysconfdir}/udev/rules.d/
        install -d ${D}${systemd_system_unitdir}
        install -m 0644 ${UNPACKDIR}/slcand@.service ${D}${systemd_system_unitdir}/
        install -d ${D}${sysconfdir}/default
        install -m 0644 ${UNPACKDIR}/slcand-default ${D}${sysconfdir}/default/slcand
    fi
}

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

RDEPENDS:${PN} += "udev"