1 # $Id: PKGBUILD 142407 2011-11-09 04:55:55Z tomegun $
2 # Maintainer: Tom Gundersen <teg@jklm.no>
3 # Contributor: Aaron Griffin <aaron@archlinux.org>
4 # Contributor: Tobias Powalowski <tpowa@archlinux.org>
5 # Contributor: Thomas Bächler <thomas@archlinux.org>
6 # Maintainer: Nicky726 <nicky726@gmail.com>
9 pkgname=('selinux-udev')
10 true && pkgname=('selinux-udev' 'selinux-udev-compat')
15 url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
18 options=(!makeflags !libtool)
19 makedepends=('gobject-introspection' 'gperf')
20 #source=(http://www.kernel.org/pub/linux/utils/kernel/hotplug/$pkgbase-$pkgver.tar.bz2
21 source=(http://people.freedesktop.org/~kay/udev/$_origname-$pkgver.tar.bz2
25 cd $srcdir/$_origname-$pkgver
26 ./configure --sysconfdir=/etc\
27 --with-rootlibdir=/lib\
28 --libexecdir=/lib/udev\
30 --with-systemdsystemunitdir=/lib/systemd/system\
31 --disable-rule-generator\
37 package_selinux-udev() {
38 pkgdesc="The SELinux aware userspace dev tools (udev)"
39 depends=('selinux-usr-libselinux' 'selinux-util-linux' 'libusb-compat' 'glib2' 'module-init-tools' 'pciutils')
41 backup=(etc/udev/udev.conf)
42 conflicts=('pcmcia-cs' 'hotplug' 'initscripts<2009.07' "${_origname}")
44 provides=("${_origname}=${pkgver}-${pkgrel}")
46 cd $srcdir/$_origname-$pkgver
47 make DESTDIR=${pkgdir} install
48 # Install our rule for permissions and symlinks
49 install -D -m644 $srcdir/81-arch.rules $pkgdir/lib/udev/rules.d/81-arch.rules
51 # create framebuffer blacklist
52 mkdir -p $pkgdir/lib/modprobe.d/
53 for mod in $(find /lib/modules/*/kernel/drivers/video -name '*fb.ko.gz' -exec basename {} .ko.gz \;); do
55 done | sort -u > $pkgdir/lib/modprobe.d/framebuffer_blacklist.conf
57 # /dev/loop0 is created for convenience, to autoload the module if necessary
58 # may be obsoleted by https://lkml.org/lkml/2011/7/30/111
59 mknod -m 0660 ${pkgdir}/lib/udev/devices/loop0 b 7 0
60 chgrp disk ${pkgdir}/lib/udev/devices/loop0
62 # udevd moved, symlink to make life easy for restarting udevd manually
63 ln -s /lib/udev/udevd ${pkgdir}/sbin/udevd
65 # Replace dialout/tape/cdrom group in rules with uucp/storage/optical group
66 for i in $pkgdir/lib/udev/rules.d/*.rules; do
67 sed -i -e 's#GROUP="dialout"#GROUP="uucp"#g;
68 s#GROUP="tape"#GROUP="storage"#g;
69 s#GROUP="cdrom"#GROUP="optical"#g' $i
73 package_selinux-udev-compat() {
74 pkgdesc="The SELinux aware userspace dev tools (udev) - additional rules for older kernels"
75 depends=('selinux-udev')
76 provides=("${_origname}-compat=${pkgver}-${pkgrel}")
77 conflicts=("${_origname}-compat")
78 cd $srcdir/$_origname-$pkgver
79 install -d -m755 ${pkgdir}/lib/${_origname}/rules.d
80 install -D -m644 ${srcdir}/${_origname}-${pkgver}/rules/misc/30-kernel-compat.rules ${pkgdir}/lib/udev/rules.d/30-kernel-compat.rules
81 # create static devices in /lib/udev/devices/
82 mkdir -p ${pkgdir}/lib/udev/devices/{pts,shm}
84 mknod -m 0600 ${pkgdir}/lib/udev/devices/console c 5 1
85 mknod -m 0666 ${pkgdir}/lib/udev/devices/null c 1 3
86 mknod -m 0660 ${pkgdir}/lib/udev/devices/zero c 1 5
87 mknod -m 0666 ${pkgdir}/lib/udev/devices/kmsg c 1 11
89 ln -snf /proc/self/fd ${pkgdir}/lib/udev/devices/fd
90 ln -snf /proc/self/fd/0 ${pkgdir}/lib/udev/devices/stdin
91 ln -snf /proc/self/fd/1 ${pkgdir}/lib/udev/devices/stdout
92 ln -snf /proc/self/fd/2 ${pkgdir}/lib/udev/devices/stderr
93 ln -snf /proc/kcore ${pkgdir}/lib/udev/devices/core
95 # these static devices are created for convenience, to autoload the modules if necessary
97 mkdir ${pkgdir}/lib/udev/devices/net
98 mknod -m 0666 ${pkgdir}/lib/udev/devices/net/tun c 10 200
100 mknod -m 0666 ${pkgdir}/lib/udev/devices/fuse c 10 229
102 mknod -m 0600 ${pkgdir}/lib/udev/devices/ppp c 108 0
104 md5sums=('2fc9c1efcbde98e3d73ffee7a77aea47'
105 '3da2bb9891592f9438a07bd641465531')