wok-current view udev/receipt @ rev 8974

[q-z]*: use veriable
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Mar 02 11:06:20 2011 +0100 (2011-03-02)
parents 9e1674525e2f
children 8bf4d41a09dd
line source
1 # SliTaz package receipt.
3 PACKAGE="udev"
4 VERSION="166"
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 DEPENDS="glibc-base util-linux-ng-blkid"
9 BUILD_DEPENDS="$DEPENDS util-linux-ng-blkid-dev gperf pkg-config pciutils \
10 acl-dev libgio-dev libgio gobject-introspection usbutils usbutils-dev"
11 MAINTAINER="pankso@slitaz.org"
12 TARBALL="$PACKAGE-$VERSION.tar.bz2"
13 WEB_SITE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
14 WGET_URL="http://www.us.kernel.org/pub/linux/utils/kernel/hotplug/$TARBALL"
16 # Rules to configure and make the package.
17 compile_rules()
18 {
19 gzip -d -c /usr/share/misc/pci.ids.gz > /usr/share/pci.ids
20 cd $src
21 grep -qs 'define u8' extras/*_id/*.c ||
22 sed -i 's|#include <scsi/scsi.h>|#define u8 __u8\n&|' \
23 extras/scsi_id/scsi_serial.c extras/ata_id/ata_id.c
24 ./configure \
25 --prefix=/usr \
26 --exec-prefix="" \
27 --sysconfdir=/etc \
28 --libexecdir=/lib/udev \
29 --with-rootlibdir=/lib \
30 $CONFIGURE_ARGS &&
31 make &&
32 make DESTDIR=$PWD/_pkg install &&
33 rm /usr/share/pci.ids
34 }
36 # Rules to gen a SliTaz package suitable for Tazpkg.
37 genpkg_rules()
38 {
39 mkdir -p $fs/lib/firmware $fs/usr $fs/dev/.udev
41 cp -a $_pkg/sbin $fs
42 cp -a $_pkg/etc $fs
43 cp -a $_pkg/lib/libudev*so* $fs/lib
44 cp -a $_pkg/lib/udev $fs/lib
45 cp -a $_pkg/usr/lib $fs/usr
47 # Copy rules files to udev conf dir
48 mv -f $fs/lib/udev/rules.d $fs/etc/udev
49 cp stuff/udev.conf $fs/etc/udev
50 cp stuff/*.rules $fs/etc/udev/rules.d
51 # Fix permissions
52 chmod +x $fs/lib/udev/*
53 chown -R root.root $fs
54 }
56 pre_install()
57 {
58 # Remove old rules and libs
59 rm -rf $1/lib/udev/rules.d
60 rm -rf $1/lib/udev/vol_id
61 rm -f $1/lib/libvolume_id*
62 rm -f $1/lib/libudev.so.1.0
63 rm -f $1/lib/libudev.so.2.0
64 }
66 list_udev_group()
67 {
68 object=$1
69 [ -n "$object" ] || object=GROUP
70 grep $object /etc/udev/rules.d/* | \
71 sed "s/.*GROUP=\"\\([a-zA-Z0-9]*\\)\".*/\1/" | sort | uniq
72 }
74 post_install()
75 {
76 # Sanity check for udev+ldap boot
77 list_udev_group GROUP | while read x ; do
78 grep -q ^$x: $1/etc/group || chroot $1/ addgroup -S $x
79 done
80 list_udev_group OWNER | while read x ; do
81 grep -q ^$x: $1/etc/passwd || chroot $1/ adduser -S -D -H $x
82 done
83 }