wok view udev-light/receipt @ rev 10391

apr: can't cross (use native)
author Christophe Lincoln <pankso@slitaz.org>
date Mon May 23 18:50:47 2011 +0200 (2011-05-23)
parents 3fd8125e53f4
children
line source
1 # SliTaz package receipt.
3 PACKAGE="udev-light"
4 VERSION="170"
5 CATEGORY="base-system"
6 SHORT_DESC="Light Udev version without extras."
7 MAINTAINER="pankso@slitaz.org"
8 SOURCE="udev"
9 TARBALL="$SOURCE-$VERSION.tar.bz2"
10 WEB_SITE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
11 WGET_URL="http://www.us.kernel.org/pub/linux/utils/kernel/hotplug/$TARBALL"
12 PROVIDE="udev"
14 DEPENDS="util-linux-ng-blkid"
15 BUILD_DEPENDS="util-linux-ng-blkid-dev gperf pkg-config pciutils \
16 gobject-introspection-dev"
18 # Rules to configure and make the package.
19 compile_rules()
20 {
21 cd $src
22 grep -qs 'define u8' extras/*_id/*.c ||
23 sed -i 's|#include <scsi/scsi.h>|#define u8 __u8\n&|' \
24 extras/scsi_id/scsi_serial.c extras/ata_id/ata_id.c
25 ./configure $CONFIGURE_ARGS \
26 --prefix=/usr \
27 --exec-prefix="" \
28 --sysconfdir=/etc \
29 --libexecdir=/lib/udev \
30 --with-rootlibdir=/lib \
31 --disable-extras \
32 --with-pci-ids-path=/usr/share/misc/pci.ids.gz &&
33 make && make install
34 }
36 # Rules to gen a SliTaz package suitable for Tazpkg.
37 genpkg_rules()
38 {
39 mkdir -p $fs/lib/firmware $fs/run/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
46 # Copy rules files to udev conf dir
47 mv -f $fs/lib/udev/rules.d $fs/etc/udev
48 cp $WOK/$SOURCE/stuff/udev.conf $fs/etc/udev
49 cp $WOK/$SOURCE/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 }