updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / udev-git / PKGBUILD
blob5dd8a97e557becf641a5b514137074ef7cac451c
1 # $Id: PKGBUILD 142408 2011-11-09 04:55:56Z tomegun $
2 # Maintainer: Dave Reisner <dreisner@archlinux.org>
3 # Contributor: Tom Gundersen <teg@jklm.no>
4 # Contributor: Aaron Griffin <aaron@archlinux.org>
5 # Contributor: Tobias Powalowski <tpowa@archlinux.org>
6 # Contributor: Thomas Bächler <thomas@archlinux.org>
8 pkgname=udev-git
9 pkgver=20120107
10 pkgrel=1
11 pkgdesc="The userspace dev tools (udev)"
12 arch=('i686' 'x86_64')
13 url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
14 license=('GPL')
15 groups=('base')
16 options=('!makeflags' '!libtool')
17 depends=('util-linux' 'libusb-compat' 'glib2' 'module-init-tools' 'pciutils' 'kmod')
18 makedepends=('git' 'gobject-introspection' 'gperf' 'gtk-doc')
19 conflicts=('udev')
20 provides=('udev=999')
21 backup=('etc/udev/udev.conf')
22 source=('81-arch.rules')
23 md5sums=('3da2bb9891592f9438a07bd641465531')
25 _gitroot='git://git.kernel.org/pub/scm/linux/hotplug/udev.git'
26 _gitname='udev'
28 build() {
29   msg "Connecting to GIT server...."
31   if [[ -d $_gitname ]] ; then
32     cd "$_gitname" && git pull origin
33     msg "The local files are updated."
34   else
35     git clone "$_gitroot" "$_gitname"
36   fi
38   msg "GIT checkout done or server timeout"
39   msg "Starting make..."
41   rm -rf "$srcdir/$_gitname-build"
42   cp -r "$srcdir/$_gitname" "$srcdir/$_gitname-build"
43   cd "$srcdir/$_gitname-build"
45   ./autogen.sh
46   ./configure \
47       --sysconfdir=/etc \
48       --libexecdir=/lib \
49       --sbindir=/sbin \
50       --bindir=/sbin \
51       --with-rootlibdir=/lib \
52       --with-rootprefix=/ \
53       --with-systemdsystemunitdir=/lib/systemd/system \
54       --disable-rule-generator \
55       --enable-udev_acl
57   make
60 check() {
61   make -C "$_gitname-build" check
64 package() {
65   make -C "$_gitname-build" DESTDIR="$pkgdir" install
67   # Install our rule for permissions and symlinks
68   install -D -m644 "$srcdir/81-arch.rules" "$pkgdir/lib/udev/rules.d/81-arch.rules"
70   # create framebuffer blacklist
71   install -dm755 "$pkgdir/lib/modprobe.d"
72   if pushd /lib/modules/ &>/dev/null; then
73     for mod in */kernel/drivers/video/*fb.ko* */kernel/drivers/video/*/*fb.ko*; do
74       mod=${mod%%.ko*}
75       printf 'blacklist %s\n' "${mod##*/}"
76     done | sort -u > "$pkgdir/lib/modprobe.d/framebuffer_blacklist.conf"
77     popd &>/dev/null
78   fi
80   # /dev/loop0 is created for convenience, to autoload the module if necessary
81   # may be obsoleted by https://lkml.org/lkml/2011/7/30/111
82   install -dm755 "$pkgdir/lib/udev/devices"
83   mknod -m 0660 "$pkgdir/lib/udev/devices/loop0" b 7 0
84   chgrp disk "$pkgdir/lib/udev/devices/loop0"
86   # Replace dialout/tape/cdrom group in rules with uucp/storage/optical group
87   for i in "$pkgdir"/lib/udev/rules.d/*.rules; do
88     sed -i 's#GROUP="dialout"#GROUP="uucp"#g;
89             s#GROUP="tape"#GROUP="storage"#g;
90             s#GROUP="cdrom"#GROUP="optical"#g' "$i"
91   done
94 # vim: ft=sh syn=sh et