updated on Wed Jan 11 08:01:35 UTC 2012
[aur-mirror.git] / kvm-git / PKGBUILD
bloba3a28064024b815459c516387aba0ad76dbf4155
1 # Contributor: Bernhard Walle <bernhard.walle@gmx.de>
2 # Contributor: Frederic Bezies <fredbezies@gmail.com>
3 # Based on official Qemu-kvm PKGBUILD
5 pkgname=kvm-git
6 pkgver=20120101
7 pkgrel=1
8 pkgdesc="Qemu-KVM emulator - git version"
9 arch=(i686 x86_64)
10 url="http://www.linux-kvm.org/page/Main_Page"
11 license=('GPL')
12 depends=('libjpeg' 'libpng' 'libsasl' 'curl' 'sdl' 'alsa-lib' 'nss' 'glib2' 'gnutls>=2.4.1' 'bluez' 'vde2' 'util-linux-ng' 'libpulse' 'spice')
13 makedepends=('git' 'texi2html' 'perl')
14 provides=('qemu')
15 conflicts=('qemu')
16 replaces=('kvm')
17 backup=(etc/qemu/target-x86_64.conf)
18 options=(!strip)
19 install='kvm-git.install'
20 source=('kvm-git.install'
21         '65-kvm.rules')
22 noextract=()
23 md5sums=('6540bf1723d0571af45bc11ded95fb7e'
24          'b316a066d2f1bb57d8f5b7ea1d0d1caf')
25 _gitroot="git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git"
26 _gitname="qemu-kvm"
28 build() {
29   cd "$srcdir"
30   msg "Connecting to GIT server...."
32   if [ -d $_gitname ] ; then
33     cd $_gitname && git pull origin
34     msg "The local files are updated."
35   else
36     git clone $_gitroot
37   fi
39   msg "GIT checkout done or server timeout"
40   msg "Starting make..."
42   rm -rf "$srcdir/$_gitname-build"
43   cp -r "$srcdir/$_gitname" "$srcdir/$_gitname-build"
44   cd "$srcdir/$_gitname-build"
46   ./configure --prefix=/usr --audio-drv-list=alsa,oss,sdl,pa \
47   --audio-card-list=ac97,sb16,es1370,adlib --enable-docs \
48   --extra-cflags=-D__EXPORTED__HEADERS__ --disable-werror --python=/usr/bin/python2
49   
50   make 
52   make DESTDIR=${pkgdir} install 
53   # symbolic link for backwards compatibility
54   ln -s qemu-system-x86_64 ${pkgdir}/usr/bin/qemu-kvm
55   # symbolic link for to qemu binary for emulator apps
56   ln -s qemu-system-x86_64 ${pkgdir}/usr/bin/qemu
57   # symbolic link for to qemu binary for emulator apps
58   ln -s qemu-system-x86_64 ${pkgdir}/usr/bin/kvm
59   # fix man page
60   mv ${pkgdir}/usr/share/man/man1/qemu.1 \
61                      ${pkgdir}/usr/share/man/man1/qemu-kvm.1
62   # install udev rules
63   install -D -m644 ${srcdir}/65-kvm.rules \
64                      ${pkgdir}/lib/udev/rules.d/65-kvm.rules
65   # strip scripts directory
66   find ${pkgdir}/usr/bin  -type f -perm -u+w 2>/dev/null | while read binary ; do
67     case "$(file -bi "$binary")" in
68       *application/x-executable*) # Binaries
69       /usr/bin/strip $STRIP_BINARIES "$binary";;
70     esac
71   done