1 # $Id: PKGBUILD 58211 2009-11-05 23:54:13Z thomas $
\r
2 # Maintainer: Aaron Griffin <aaron@archlinux.org>
\r
3 # Maintainer: Tobias Powalowski <tpowa@archlinux.org>
\r
4 # Maintainer: Thomas Bächler <thomas@archlinux.org>
\r
8 pkgdesc="The userspace dev tools (udev)"
\r
10 url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
\r
13 depends=('glibc' 'coreutils' 'util-linux' 'libusb' 'glib2')
\r
14 provides=('udev=146')
\r
15 makedepends=('kernel26' 'gperf' 'libxslt') #kernel26 needed to build framebuffer blacklist
\r
16 install=udev.install
\r
17 backup=(etc/udev/udev.conf
\r
18 etc/modprobe.d/framebuffer_blacklist.conf)
\r
19 conflicts=('pcmcia-cs' 'hotplug' 'initscripts<2009.07')
\r
21 # older initscripts versions required start_udev
\r
22 options=(!makeflags !libtool)
\r
23 source=(http://www.kernel.org/pub/linux/utils/kernel/hotplug/$pkgname-$pkgver.tar.bz2
\r
24 81-arch.rules load-modules.sh resolve-modalias.c cdsymlinks.sh root-link.sh
\r
25 arch-udev-rules.patch ignore-remove.sh cups-hplip-fix.patch udev-acl.patch)
\r
26 md5sums=('b2a8acefda4fa8a70d45642035abd718'
\r
27 'cc6406e8b67b2b8711942098a66cde6b'
\r
28 'f4951f61438d69894b728212dac7318b'
\r
29 '64a0169dc9d883a63ff9f8f491fdc34a'
\r
30 '2e808ee78d237c478b57af2a68d43769'
\r
31 '2d6dc6842464f107bccc68cd505a6c31'
\r
32 '24207d84eae19d4f08422b89ce6c55c5'
\r
33 '35fa97500243a79b2370fa4684828e69'
\r
34 '8cd53a3d91d2321a646033dc18f29217'
\r
35 'ab409e5fd662d2135220627f1e5ec560')
\r
38 cd $srcdir/$pkgname-$pkgver
\r
39 # fix raw printers, will be fixed in udev-147
\r
40 patch -Np1 -i ../cups-hplip-fix.patch || return 1
\r
41 patch -Np1 -i ../udev-acl.patch || return 1
\r
42 ./configure --prefix="" --mandir=/usr/share/man\
\r
43 --includedir=/usr/include\
\r
44 --libexecdir=/lib/udev\
\r
45 --datarootdir=/usr/share
\r
47 make DESTDIR=$startdir/pkg install
\r
48 # Fix pkgconfig path
\r
49 install -d -m755 $pkgdir/usr/lib
\r
50 mv $pkgdir/lib/pkgconfig $pkgdir/usr/lib
\r
52 # Non-stock rules still go in /etc
\r
53 install -D -m644 $srcdir/81-arch.rules $pkgdir/lib/udev/rules.d/81-arch.rules
\r
55 # install our module loading subsystem
\r
56 install -D -m755 $srcdir/load-modules.sh $pkgdir/lib/udev/load-modules.sh
\r
57 install -d -m755 $pkgdir/bin
\r
58 gcc -Wall $CFLAGS -o $pkgdir/bin/resolve-modalias $srcdir/resolve-modalias.c || return 1
\r
59 # install cdsymlinks.sh
\r
60 install -D -m755 $srcdir/cdsymlinks.sh $pkgdir/lib/udev/cdsymlinks.sh
\r
61 # install root-link.sh
\r
62 install -D -m755 $srcdir/root-link.sh $pkgdir/lib/udev/root-link.sh
\r
63 # install ignore-remove.sh
\r
64 install -D -m755 $srcdir/ignore-remove.sh $pkgdir/lib/udev/ignore-remove.sh
\r
65 # disable error logging to prevent startup failures printed to vc on boot
\r
66 sed -i -e 's|udev_log="err"|udev_log="0"|g' $pkgdir/etc/udev/udev.conf
\r
67 # install additional standard rules files
\r
68 for rule in $srcdir/$pkgname-$pkgver/rules/packages/*.rules; do
\r
69 install -D -m 644 $rule $pkgdir/lib/udev/rules.d/
\r
71 # fix standard udev rules to fit to arch
\r
72 cd $pkgdir/lib/udev/rules.d/
\r
73 patch -Np1 -i $srcdir/arch-udev-rules.patch || return 1
\r
74 # remove .orig files
\r
75 rm -f $pkgdir/lib/udev/rules.d/*.orig
\r
76 # disable persistent cdromsymlinks and network by default
\r
77 # and move it to /etc/udev/rules.d
\r
78 mv $pkgdir/lib/udev/rules.d/75-persistent-net-generator.rules \
\r
79 $pkgdir/etc/udev/rules.d/75-persistent-net-generator.rules.optional
\r
80 mv $pkgdir/lib/udev/rules.d/75-cd-aliases-generator.rules \
\r
81 $pkgdir/etc/udev/rules.d/75-cd-aliases-generator.rules.optional
\r
82 # remove not needed rules
\r
83 rm $pkgdir/lib/udev/rules.d/40-ia64.rules
\r
84 rm $pkgdir/lib/udev/rules.d/40-ppc.rules
\r
85 rm $pkgdir/lib/udev/rules.d/40-s390.rules
\r
87 # create framebuffer blacklist
\r
88 mkdir -p $pkgdir/etc/modprobe.d/
\r
89 for mod in $(find /lib/modules/*/kernel/drivers/video -name '*fb.ko' -exec basename {} .ko \;); do
\r
90 echo "blacklist $mod" >> $pkgdir/etc/modprobe.d/framebuffer_blacklist.conf
\r
93 # create static devices in /lib/udev/devices/
\r
94 mkdir ${pkgdir}/lib/udev/devices
\r
95 mkdir ${pkgdir}/lib/udev/devices/pts
\r
96 mkdir ${pkgdir}/lib/udev/devices/shm
\r
98 mknod -m 0600 ${pkgdir}/lib/udev/devices/console c 5 1 || return 1
\r
99 mknod -m 0666 ${pkgdir}/lib/udev/devices/null c 1 3 || return 1
\r
100 mknod -m 0660 ${pkgdir}/lib/udev/devices/zero c 1 5 || return 1
\r
101 mknod -m 0666 ${pkgdir}/lib/udev/devices/kmsg c 1 11 || return 1
\r
103 ln -snf /proc/self/fd ${pkgdir}/lib/udev/devices/fd || return 1
\r
104 ln -snf /proc/self/fd/0 ${pkgdir}/lib/udev/devices/stdin || return 1
\r
105 ln -snf /proc/self/fd/1 ${pkgdir}/lib/udev/devices/stdout || return 1
\r
106 ln -snf /proc/self/fd/2 ${pkgdir}/lib/udev/devices/stderr || return 1
\r
107 ln -snf /proc/kcore ${pkgdir}/lib/udev/devices/core || return 1
\r
109 # these static devices are created for convenience, to autoload the modules if necessary
\r
111 mknod -m 0660 ${pkgdir}/lib/udev/devices/loop0 b 7 0 || return 1
\r
112 chgrp disk ${pkgdir}/lib/udev/devices/loop0 || return 1
\r
114 mkdir ${pkgdir}/lib/udev/devices/net
\r
115 mknod -m 0666 ${pkgdir}/lib/udev/devices/net/tun c 10 200 || return 1
\r
117 mknod -m 0666 ${pkgdir}/lib/udev/devices/fuse c 10 229 || return 1
\r
119 mknod -m 0600 ${pkgdir}/lib/udev/devices/ppp c 108 0 || return 1
\r
121 # Replace dialout group in rules with uucp group
\r
122 for i in $pkgdir/lib/udev/rules.d/*.rules; do
\r
123 sed -i -e 's#GROUP="dialout"#GROUP="uucp"#g' $i
\r