wok-next annotate eudev/receipt @ rev 20534

Clean default configure options when site script used.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Mar 30 19:31:50 2018 +0300 (2018-03-30)
parents 0e7893ac206d
children 835b3b8ce6ac
rev   line source
al@19741 1 # SliTaz package receipt v2.
tcg@17143 2
tcg@17143 3 PACKAGE="eudev"
al@19866 4 VERSION="3.2.4"
tcg@17143 5 CATEGORY="base-system"
al@19582 6 SHORT_DESC="Programs for dynamic creation of device nodes"
tcg@17143 7 MAINTAINER="tcg.thegamer@gmail.com"
pascal@17147 8 LICENSE="GPL2"
al@19582 9 WEB_SITE="http://dev.gentoo.org/~blueness/eudev/"
al@19863 10 LFS="http://www.linuxfromscratch.org/lfs/view/stable/chapter06/eudev.html"
tcg@17143 11
al@19582 12 TARBALL="$PACKAGE-$VERSION.tar.gz"
al@19582 13 WGET_URL="${WEB_SITE}$TARBALL"
al@19866 14 TARBALL_MD5="66acef4c6094aab4aced7ae83b74b0d2"
al@19582 15
al@19866 16 BUILD_DEPENDS="gobject-introspection-dev util-linux-blkid-dev gperf kmod-dev"
al@19741 17 SPLIT="eudev-dev"
tcg@17143 18
al@20436 19 compile_rules() {
al@19582 20 sed -r -i 's|/usr(/bin/test)|\1|' test/udev-test.pl
al@19741 21 sed -i '/keyboard_lookup_key/d' src/udev/udev-builtin-keyboard.c
al@19582 22 cat > config.cache <<"EOF"
al@19582 23 HAVE_BLKID=1
al@19582 24 BLKID_LIBS="-lblkid"
al@19741 25 BLKID_CFLAGS="-I/include"
al@19582 26 EOF
al@19582 27
tcg@17143 28 ./configure \
al@19582 29 --bindir=/sbin \
al@19582 30 --sbindir=/sbin \
al@19582 31 --libdir=/usr/lib \
al@19582 32 --libexecdir=/lib \
al@19582 33 --with-rootprefix= \
al@19582 34 --with-rootlibdir=/lib \
al@19582 35 --enable-manpages \
al@19582 36 --disable-static \
al@19582 37 --config-cache \
al@19866 38 --enable-kmod \
tcg@17143 39 $CONFIGURE_ARGS &&
tcg@17143 40 make &&
al@20534 41 make install || return 1
al@19741 42
al@19741 43 cp $stuff/*.rules $install/etc/udev/rules.d
al@19866 44 cp -a $stuff/udev/* $install/lib/udev
al@19863 45
al@19866 46 mkdir -p "$install/lib/firmware" "$install/lib/udev/keymaps/force-release"
al@19866 47
al@19866 48 chown -R root:root $install
al@19741 49
al@19741 50 # https://docs.oracle.com/cd/E37670_01/E41138/html/ch07s03.html
al@19741 51 # /lib/udev/rules.d : default rules files. Do not edit these files.
al@19741 52 # /etc/udev/rules.d : customized rules files. You can modify these files
al@19741 53 # Rules files in /etc/udev/rules.d override files of the same name
al@19741 54 # in /lib/udev/rules.d.
tcg@17143 55 }
tcg@17143 56
al@20436 57 genpkg_rules() {
al@19741 58 case $PACKAGE in
al@19741 59 eudev)
al@19741 60 copy @std
al@19866 61 DEPENDS="kmod liblzma util-linux-blkid util-linux-uuid zlib dbus"
al@19880 62 PROVIDE="udev"
al@20436 63 TAGS="LFS"
al@19741 64 ;;
al@19741 65 eudev-dev)
al@19741 66 copy @dev
al@19880 67 PROVIDE="udev-dev"
al@19741 68 ;;
al@19741 69 esac
al@19741 70 }
tcg@17143 71
al@19863 72 post_install_eudev() {
tcg@17143 73 # Create some devices and directories that Udev cannot handle
tcg@17143 74 # due to them being required very early in the boot process
al@19741 75 mkdir -p "$1/lib/udev/devices/pts"
al@19741 76 mkdir -p "$1/lib/udev/devices/shm"
al@19741 77 [ -e "$1/lib/udev/devices/null" ] || mknod -m 0666 "$1/lib/udev/devices/null" c 1 3
tcg@17143 78
al@18663 79 # Sanity check for udev+ldap boot
al@20347 80 grep GROUP= "$1"/etc/udev/rules.d/* "$1"/lib/udev/rules.d/* 2>/dev/null | \
al@19741 81 sed 's/.*GROUP="\([a-zA-Z0-9]*\)".*/\1/' | sort | uniq | \
al@19863 82 while read x; do
al@18663 83 grep -q ^$x: "$1/etc/group" || chroot "$1/" addgroup -S $x
al@18663 84 done
al@18663 85
al@20347 86 grep OWNER= "$1"/etc/udev/rules.d/* "$1"/lib/udev/rules.d/* 2>/dev/null | \
al@19741 87 sed 's/.*OWNER="\([a-zA-Z0-9]*\)".*/\1/' | sort | uniq | \
al@19863 88 while read x; do
al@18663 89 grep -q ^$x: "$1/etc/passwd" || chroot "$1/" adduser -S -D -H $x
al@18663 90 done
tcg@17143 91 }
al@20443 92