blob: b0536124920a20b2bab5c2712eb5cfcef5b3dd9c [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "eudev is a fork of systemd's udev"
2HOMEPAGE = "https://wiki.gentoo.org/wiki/Eudev"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06003DESCRIPTION = "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."
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00004LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
5LICENSE:libudev = "LGPL-2.1-or-later"
Andrew Geissler82c905d2020-04-13 13:39:40 -05006LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
7
8DEPENDS = "glib-2.0 glib-2.0-native gperf-native kmod libxslt-native util-linux"
9
10PROVIDES = "udev"
11
12SRC_URI = "https://dev.gentoo.org/~blueness/${BPN}/${BP}.tar.gz \
13 file://0014-Revert-rules-remove-firmware-loading-rules.patch \
14 file://Revert-udev-remove-userspace-firmware-loading-suppor.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050015 file://init \
Andrew Geissler82c905d2020-04-13 13:39:40 -050016 file://local.rules \
Andrew Geissler82c905d2020-04-13 13:39:40 -050017"
18
Andrew Geissler90fd73c2021-03-05 15:25:55 -060019SRC_URI[md5sum] = "60b135a189523f333cea5f71a3345c8d"
20SRC_URI[sha256sum] = "87bb028d470fd1b85169349b44c55d5b733733dc2d50ddf1196e026725ead034"
Andrew Geissler82c905d2020-04-13 13:39:40 -050021
22inherit autotools update-rc.d qemu pkgconfig features_check
23
24CONFLICT_DISTRO_FEATURES = "systemd"
25
26EXTRA_OECONF = " \
27 --sbindir=${base_sbindir} \
28 --with-rootlibdir=${base_libdir} \
29 --with-rootlibexecdir=${nonarch_base_libdir}/udev \
30 --with-rootprefix= \
31"
32
33PACKAGECONFIG ??= "hwdb"
34PACKAGECONFIG[hwdb] = "--enable-hwdb,--disable-hwdb"
35
Patrick Williams213cb262021-08-07 19:21:33 -050036do_install:append() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050037 install -d ${D}${sysconfdir}/init.d
38 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
39 sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev
40
41 install -d ${D}${sysconfdir}/udev/rules.d
42 install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
43
44 # Use classic network interface naming scheme
45 touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules
46
47 # hid2hci has moved to bluez4. removed in udev as of version 169
48 rm -f ${D}${base_libdir}/udev/hid2hci
Andrew Geissler82c905d2020-04-13 13:39:40 -050049}
50
Patrick Williams213cb262021-08-07 19:21:33 -050051do_install:prepend:class-target () {
Andrew Geissler82c905d2020-04-13 13:39:40 -050052 # Remove references to buildmachine
53 sed -i -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
54 ${B}/src/udev/keyboard-keys-from-name.h
55}
56
57INITSCRIPT_NAME = "udev"
58INITSCRIPT_PARAMS = "start 04 S ."
59
60PACKAGES =+ "libudev"
61PACKAGES =+ "eudev-hwdb"
62
63
Patrick Williams213cb262021-08-07 19:21:33 -050064FILES:${PN} += "${libexecdir} ${nonarch_base_libdir}/udev ${bindir}/udevadm"
65FILES:${PN}-dev = "${datadir}/pkgconfig/udev.pc \
Andrew Geissler82c905d2020-04-13 13:39:40 -050066 ${includedir}/libudev.h ${libdir}/libudev.so \
67 ${includedir}/udev.h ${libdir}/libudev.la \
68 ${libdir}/libudev.a ${libdir}/pkgconfig/libudev.pc"
Patrick Williams213cb262021-08-07 19:21:33 -050069FILES:libudev = "${base_libdir}/libudev.so.*"
70FILES:eudev-hwdb = "${sysconfdir}/udev/hwdb.d"
Andrew Geissler82c905d2020-04-13 13:39:40 -050071
Patrick Williams213cb262021-08-07 19:21:33 -050072RDEPENDS:eudev-hwdb += "eudev"
Andrew Geissler82c905d2020-04-13 13:39:40 -050073
Patrick Williams213cb262021-08-07 19:21:33 -050074RPROVIDES:${PN} = "hotplug udev"
75RPROVIDES:eudev-hwdb += "udev-hwdb"
Andrew Geissler82c905d2020-04-13 13:39:40 -050076
77PACKAGE_WRITE_DEPS += "qemu-native"
Patrick Williams213cb262021-08-07 19:21:33 -050078pkg_postinst:eudev-hwdb () {
Andrew Geissler82c905d2020-04-13 13:39:40 -050079 if test -n "$D"; then
80 $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX}
81 else
82 udevadm hwdb --update
83 fi
84}
85
Patrick Williams213cb262021-08-07 19:21:33 -050086pkg_prerm:eudev-hwdb () {
Andrew Geissler82c905d2020-04-13 13:39:40 -050087 rm -f $D${sysconfdir}/udev/hwdb.bin
88}