wok-next annotate udev/receipt @ rev 3174

udev: avoid ldap lookups during boot
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon May 25 13:11:56 2009 +0200 (2009-05-25)
parents c88d253cc8bb
children 77070ef5bae8
rev   line source
pankso@5 1 # SliTaz package receipt.
pankso@5 2
pankso@5 3 PACKAGE="udev"
pankso@3149 4 VERSION="142"
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@3149 8 DEPENDS="util-linux-ng-blkid"
pankso@3149 9 BUILD_DEPENDS="$DEPENDS util-linux-ng-blkid-dev"
pankso@5 10 MAINTAINER="pankso@slitaz.org"
pankso@5 11 TARBALL="$PACKAGE-$VERSION.tar.gz"
pankso@5 12 WEB_SITE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
pankso@5 13 WGET_URL="http://www.us.kernel.org/pub/linux/utils/kernel/hotplug/$TARBALL"
pankso@5 14
pankso@5 15 # Rules to configure and make the package.
pankso@5 16 compile_rules()
pankso@5 17 {
pankso@5 18 cd $src
pankso@1261 19 ./configure \
pankso@1261 20 --prefix=/usr \
pankso@1270 21 --exec-prefix="" \
pankso@1261 22 --sysconfdir=/etc \
pascal@1535 23 --enable-static \
pascal@1535 24 $CONFIGURE_ARGS &&
pankso@1270 25 make DESTDIR=$PWD/_pkg install
pankso@5 26 }
pankso@5 27
pankso@5 28 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@5 29 genpkg_rules()
pankso@5 30 {
pankso@3149 31 mkdir -p $fs/lib/firmware $fs/etc/udev $fs/usr/lib
pankso@3149 32 for dir in sbin etc lib
pankso@3149 33 do
pankso@3149 34 cp -a $_pkg/$dir $fs
pascal@1878 35 done
pankso@3149 36 cp -a $_pkg/usr/lib/*.so $fs/usr/lib
pankso@789 37
erjo@1988 38 # Copy rules files to udev conf dir
pankso@2085 39 mv $fs/lib/udev/rules.d $fs/etc/udev
pankso@5 40 cp stuff/udev.conf $fs/etc/udev
pankso@5 41 cp stuff/90-permissions.rules $fs/etc/udev/rules.d
pankso@3149 42 cp $src/rules/packages/40-alsa.rules $fs/etc/udev/rules.d
pankso@3149 43 cp $src/rules/packages/40-zaptel.rules $fs/etc/udev/rules.d
pankso@2273 44 # Fix permissions
pankso@3149 45 chmod +x $fs/lib/udev/*
pankso@3149 46 chown -R root.root $fs
pankso@5 47 }
pankso@2085 48
pankso@3149 49 pre_install()
pankso@2085 50 {
pankso@3149 51 # Remove old rules and libs
pankso@3149 52 rm -rf $1/lib/udev/rules.d
pankso@3149 53 rm -rf $1/lib/udev/vol_id
pankso@3149 54 rm -f $1/lib/libvolume_id*
pankso@3149 55 rm -f $1/lib/libudev.so.1.0
pankso@3149 56 rm -f $1/lib/libudev.so.2.0
pankso@2085 57 }
pascal@3174 58
pascal@3174 59 list_udev_group()
pascal@3174 60 {
pascal@3174 61 object=$1
pascal@3174 62 [ -n "$object" ] || object=GROUP
pascal@3174 63 grep $object /etc/udev/rules.d/* | \
pascal@3174 64 sed "s/.*GROUP=\"\\([a-zA-Z0-9]*\\)\".*/\1/" | sort | uniq
pascal@3174 65 }
pascal@3174 66
pascal@3174 67 post_install()
pascal@3174 68 {
pascal@3174 69 # Sanity check for udev+ldap boot
pascal@3174 70 list_udev_group GROUP | while read x ; do
pascal@3174 71 grep -q ^$x: $/etc/group || chroot $1/ addgroup $x
pascal@3174 72 done
pascal@3174 73 list_udev_group OWNER | while read x ; do
pascal@3174 74 grep -q ^$x: $/etc/passwd || chroot $1/ adduser -S -D -H $x
pascal@3174 75 done
pascal@3174 76 }