wok annotate udev/receipt @ rev 24876

magicpoint: ar syntax adaptation)
author Hans-G?nter Theisgen
date Thu Mar 31 11:00:43 2022 +0100 (2022-03-31)
parents 86790a278e70
children 73f36875e5a7
rev   line source
pankso@5 1 # SliTaz package receipt.
pankso@5 2
pankso@5 3 PACKAGE="udev"
pankso@12485 4 VERSION="182"
pascal@1890 5 BUILD_WARNING="Install new udev package and rebuild hal"
pankso@210 6 CATEGORY="base-system"
pankso@5 7 SHORT_DESC="Udev creat automaticly right devices in /dev."
pankso@5 8 MAINTAINER="pankso@slitaz.org"
pascal@15000 9 LICENSE="GPL2"
pankso@12485 10 TARBALL="$PACKAGE-$VERSION.tar.xz"
pankso@12485 11 WEB_SITE="http://www.freedesktop.org/software/systemd/man/udev.html"
pascal@20421 12 WGET_URL="https://www.kernel.org/pub/linux/utils/kernel/hotplug/$TARBALL"
pankso@16067 13 HOST_ARCH="i486 arm"
pankso@5 14
pankso@12485 15 DEPENDS="util-linux-blkid pciids usbids acl kmod"
pascal@19246 16 BUILD_DEPENDS="util-linux-blkid-dev gperf pkg-config pciids acl-dev \
pankso@12485 17 libgio-dev usbutils-dev libusb-dev glib-dev pciids usbids kmod-dev \
pascal@15628 18 libgudev-dev pcre-dev liblzma-dev util-linux-uuid-dev"
pankso@9753 19
pankso@16067 20 # Use build host: gperf
pascal@16069 21 case "$ARCH" in
pascal@16069 22 arm*) BUILD_DEPENDS="util-linux-blkid-dev kmod-dev acl-dev glib-dev"
pascal@16069 23 esac
pankso@16067 24
pascal@24072 25 current_version()
pascal@24072 26 {
pascal@24072 27 wget -O - $(dirname $WGET_URL) 2>/dev/null | \
pascal@24072 28 sed "/rc[0-9]/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|" | sort -Vr | sed q
pascal@24072 29 }
pascal@24072 30
pankso@5 31 # Rules to configure and make the package.
pankso@5 32 compile_rules()
pankso@5 33 {
pankso@16067 34 case "$ARCH" in
pankso@16067 35 arm*)
pankso@16067 36 # ARM Hack
pankso@16067 37 for la in libgthread-2.0.la libglib-2.0.la
pankso@16067 38 do
pankso@16067 39 if grep -q "^libdir='/usr/lib'" /usr/lib/${la}; then
pankso@16067 40 sed -i s"#/usr/lib#/cross/$ARCH/sysroot/usr/lib#" \
pankso@16067 41 /usr/lib/${la}
pankso@16067 42 fi
pankso@16067 43 done ;;
pankso@16067 44 esac
pankso@12485 45 ./configure \
pankso@1270 46 --exec-prefix="" \
pankso@12485 47 --with-rootprefix="" \
pankso@12485 48 --bindir=/sbin \
pankso@1261 49 --sysconfdir=/etc \
pankso@12485 50 --libexecdir=/lib \
pankso@12485 51 --disable-manpages \
pankso@12485 52 --disable-introspection \
pankso@12485 53 --disable-keymap \
pankso@12485 54 --enable-floppy \
pankso@12485 55 --enable-rule_generator \
pankso@12485 56 --with-pci-ids-path=/usr/share/misc/pci.ids.gz \
pankso@12485 57 --with-usb-ids-path=/usr/share/misc/usb.ids.gz \
pankso@12485 58 --with-systemdsystemunitdir=no \
pankso@12485 59 $CONFIGURE_ARGS &&
pankso@10368 60 make && make install
pankso@5 61 }
pankso@5 62
pankso@5 63 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@5 64 genpkg_rules()
pankso@5 65 {
pankso@12976 66 mkdir -p $fs/lib/firmware
pankso@789 67
pankso@12485 68 cp -a $install/sbin $fs
pankso@12485 69 cp -a $install/etc $fs
pankso@12485 70 cp -a $install/lib/libudev*so* $fs/lib
pankso@12485 71 cp -a $install/lib/udev $fs/lib
pankso@12976 72
pankso@12485 73 # Have udevd in PATH
pankso@12485 74 mv $fs/lib/udev/udevd $fs/sbin
rcx@3782 75
pankso@12485 76 # Copy rules files to udev conf dir
pankso@3821 77 mv -f $fs/lib/udev/rules.d $fs/etc/udev
slaxemulator@9685 78 cp $stuff/udev.conf $fs/etc/udev
pankso@10918 79 cp $stuff/*.rules $fs/etc/udev/rules.d
pankso@12976 80
pankso@12976 81 # Create some devices and directories that Udev cannot handle
pankso@12485 82 # due to them being required very early in the boot process
pankso@12485 83 mkdir -p $fs/lib/udev/devices/pts
pankso@12976 84 mkdir -p $fs/lib/udev/devices/shm
pankso@12485 85 mknod -m 0666 $fs/lib/udev/devices/null c 1 3
pankso@12976 86
pankso@2273 87 # Fix permissions
pankso@3149 88 chmod +x $fs/lib/udev/*
pankso@3149 89 chown -R root.root $fs
pankso@5 90 }
pankso@2085 91
pascal@3174 92 list_udev_group()
pascal@3174 93 {
al@18567 94 object=${2:-GROUP}
pascal@18730 95 grep $object "$1/etc/udev/rules.d/"* | \
al@18567 96 sed "s|.*$object=\"\([a-zA-Z0-9]*\)\".*|\1|" | sort | uniq
pascal@3174 97 }
pascal@3174 98
pascal@3174 99 post_install()
pascal@3174 100 {
al@18567 101 # Sanity check for udev+ldap boot
al@18567 102 list_udev_group "$1" GROUP | \
al@18567 103 while read x; do
pascal@18730 104 grep -q ^$x: "$1/etc/group" || chroot "$1/" addgroup -S $x
al@18567 105 done
al@18567 106 list_udev_group "$1" OWNER | \
al@18567 107 while read x; do
pascal@18730 108 grep -q ^$x: "$1/etc/passwd" || chroot "$1/" adduser -S -D -H $x
al@18567 109 done
pascal@3174 110 }