wok-current view udev/receipt @ rev 25672
patch tazpkg, upgrade core pkgs first
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Sun Mar 03 17:58:42 2024 +0000 (5 months ago) |
parents | a23978bfa665 |
children |
line source
1 # SliTaz package receipt.
3 PACKAGE="udev"
4 VERSION="182"
5 BUILD_WARNING="Install new udev package and rebuild hal"
6 CATEGORY="base-system"
7 SHORT_DESC="Udev creat automaticly right devices in /dev."
8 MAINTAINER="pankso@slitaz.org"
9 LICENSE="GPL2"
10 TARBALL="$PACKAGE-$VERSION.tar.xz"
11 WEB_SITE="https://www.freedesktop.org/software/systemd/man/udev.html"
12 WGET_URL="https://www.kernel.org/pub/linux/utils/kernel/hotplug/$TARBALL"
13 HOST_ARCH="i486 arm"
15 DEPENDS="util-linux-blkid pciids usbids acl kmod"
16 BUILD_DEPENDS="util-linux-blkid-dev gperf pkg-config pciids acl-dev \
17 libgio-dev usbutils-dev libusb-dev glib-dev pciids usbids kmod-dev \
18 pcre-dev liblzma-dev util-linux-uuid-dev python3-dev"
20 # Need avoid loop, rebuild after with libgudev-dev
22 # Use build host: gperf
23 case "$ARCH" in
24 arm*) BUILD_DEPENDS="util-linux-blkid-dev kmod-dev acl-dev glib-dev"
25 esac
27 current_version()
28 {
29 wget -O - $(dirname $WGET_URL) 2>/dev/null | \
30 sed "/rc[0-9]/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|" | sort -Vr | sed q
31 }
33 # Rules to configure and make the package.
34 compile_rules()
35 {
36 case "$ARCH" in
37 arm*)
38 # ARM Hack
39 for la in libgthread-2.0.la libglib-2.0.la
40 do
41 if grep -q "^libdir='/usr/lib'" /usr/lib/${la}; then
42 sed -i s"#/usr/lib#/cross/$ARCH/sysroot/usr/lib#" \
43 /usr/lib/${la}
44 fi
45 done ;;
46 esac
48 # Patch for gcc >= 6
49 # see https://github.com/openwrt/packages/issues/2293
50 patch -p1 < $stuff/udev-gcc6.patch
52 # Patch for glibc >= 2.28
53 # see https://svn.exactcode.de/t2/trunk/package/filesystem/udev/hotfix-glibc2.18.patch
54 patch -p1 < $stuff/udev-glibc2.28.patch
56 LDFLAGS='-lrt' ./configure \
57 --exec-prefix="" \
58 --with-rootprefix="" \
59 --bindir=/sbin \
60 --sysconfdir=/etc \
61 --libexecdir=/lib \
62 --disable-manpages \
63 --disable-introspection \
64 --disable-keymap \
65 --enable-floppy \
66 --enable-rule_generator \
67 --with-pci-ids-path=/usr/share/misc/pci.ids.gz \
68 --with-usb-ids-path=/usr/share/misc/usb.ids.gz \
69 --with-systemdsystemunitdir=no \
70 $CONFIGURE_ARGS &&
71 make && make install
72 }
74 # Rules to gen a SliTaz package suitable for Tazpkg.
75 genpkg_rules()
76 {
77 mkdir -p $fs/lib/firmware
79 cp -a $install/sbin $fs
80 cp -a $install/etc $fs
81 cp -a $install/lib/libudev*so* $fs/lib
82 cp -a $install/lib/udev $fs/lib
84 # Have udevd in PATH
85 mv $fs/lib/udev/udevd $fs/sbin
87 # Copy rules files to udev conf dir
88 mv -f $fs/lib/udev/rules.d $fs/etc/udev
89 cp $stuff/udev.conf $fs/etc/udev
90 cp $stuff/*.rules $fs/etc/udev/rules.d
92 # Create some devices and directories that Udev cannot handle
93 # due to them being required very early in the boot process
94 mkdir -p $fs/lib/udev/devices/pts
95 mkdir -p $fs/lib/udev/devices/shm
96 mknod -m 0666 $fs/lib/udev/devices/null c 1 3
98 # Fix permissions
99 chmod +x $fs/lib/udev/*
100 chown -R root.root $fs
101 }
103 list_udev_group()
104 {
105 object=${2:-GROUP}
106 grep $object "$1/etc/udev/rules.d/"* | \
107 sed "s|.*$object=\"\([a-zA-Z0-9]*\)\".*|\1|" | sort | uniq
108 }
110 post_install()
111 {
112 # Sanity check for udev+ldap boot
113 list_udev_group "$1" GROUP | \
114 while read x; do
115 grep -q ^$x: "$1/etc/group" || chroot "$1/" addgroup -S $x
116 done
117 list_udev_group "$1" OWNER | \
118 while read x; do
119 grep -q ^$x: "$1/etc/passwd" || chroot "$1/" adduser -S -D -H $x
120 done
121 }