blob: d0758691bd2014ff0ed00efd6b9ee3898a42742e [file] [log] [blame]
Andrew Geisslerd5838332022-05-27 11:33:10 -05001SUMMARY = "eudev is a fork of systemd's udev"
2HOMEPAGE = "https://github.com/eudev-project/eudev"
3DESCRIPTION = "eudev is Gentoo's fork of udev, systemd's device file manager for the Linux kernel. It manages device nodes in /dev and handles all user space actions when adding or removing devices."
4LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
5LICENSE:libudev = "LGPL-2.1-or-later"
6LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
7
8DEPENDS = "gperf-native"
9
10PROVIDES = "udev"
11
Andrew Geissler87f5cff2022-09-30 13:13:31 -050012SRC_URI = "${GITHUB_BASE_URI}/download/v${PV}/${BP}.tar.gz \
Andrew Geisslerd5838332022-05-27 11:33:10 -050013 file://init \
14 file://local.rules \
Andrew Geissler5082cc72023-09-11 08:41:39 -040015 "
Andrew Geisslerd5838332022-05-27 11:33:10 -050016
Patrick Williamsda295312023-12-05 16:48:56 -060017SRC_URI[sha256sum] = "8da4319102f24abbf7fff5ce9c416af848df163b29590e666d334cc1927f006f"
Andrew Geisslerd5838332022-05-27 11:33:10 -050018
Andrew Geissler87f5cff2022-09-30 13:13:31 -050019GITHUB_BASE_URI = "https://github.com/eudev-project/eudev/releases"
Andrew Geisslerd5838332022-05-27 11:33:10 -050020
Patrick Williams2a254922023-08-11 09:48:11 -050021inherit autotools update-rc.d qemu pkgconfig features_check manpages github-releases
Andrew Geisslerd5838332022-05-27 11:33:10 -050022
23CONFLICT_DISTRO_FEATURES = "systemd"
24
25EXTRA_OECONF = " \
26 --sbindir=${base_sbindir} \
27 --with-rootlibdir=${base_libdir} \
28 --with-rootlibexecdir=${nonarch_base_libdir}/udev \
29 --with-rootprefix= \
30"
31
32PACKAGECONFIG ?= "blkid hwdb kmod \
33 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
34"
35PACKAGECONFIG[blkid] = "--enable-blkid,--disable-blkid,util-linux"
36PACKAGECONFIG[hwdb] = "--enable-hwdb,--disable-hwdb"
37PACKAGECONFIG[kmod] = "--enable-kmod,--disable-kmod,kmod"
38PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages"
39PACKAGECONFIG[rule-generator] = "--enable-rule-generator,--disable-rule-generator"
40PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux"
41
42do_install:append() {
43 install -d ${D}${sysconfdir}/init.d
44 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
45 sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev
46 sed -i s%@KMOD@%${base_bindir}/kmod% ${D}${sysconfdir}/init.d/udev
47
48 install -d ${D}${sysconfdir}/udev/rules.d
49 install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
50
51 # Use classic network interface naming scheme
52 touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules
53}
54
55do_install:prepend:class-target () {
56 # Remove references to buildmachine
57 sed -i -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
58 ${B}/src/udev/keyboard-keys-from-name.h
59}
60
61INITSCRIPT_NAME = "udev"
62INITSCRIPT_PARAMS = "start 04 S ."
63
64PACKAGE_BEFORE_PN = "libudev ${PN}-hwdb"
65
66FILES:${PN} += "${nonarch_base_libdir}/udev"
67FILES:libudev = "${base_libdir}/libudev.so.*"
68FILES:${PN}-hwdb = "${sysconfdir}/udev/hwdb.d"
69
70RDEPENDS:${PN}-hwdb += "eudev"
71RDEPENDS:${PN} += "kmod"
72
73RPROVIDES:${PN} = "hotplug udev"
74RPROVIDES:${PN}-hwdb += "udev-hwdb"
75
76PACKAGE_WRITE_DEPS += "qemu-native"
77pkg_postinst:${PN}-hwdb () {
78 if test -n "$D"; then
79 $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX}
80 else
81 udevadm hwdb --update
82 fi
83}
84
85pkg_prerm:${PN}-hwdb () {
86 rm -f $D${sysconfdir}/udev/hwdb.bin
87}