1 # Maintainer: Stefano Facchini <stefano.facchini@gmail.com>
3 # $Id: PKGBUILD 55818 2011-09-22 13:29:51Z spupykin $
4 # by Sergej Pupykin <pupykin.s+arch@gmail.com>
9 pkgdesc="API for controlling virtualization engines (openvz,kvm,qemu,virtualbox,xen,etc)"
10 arch=('i686' 'x86_64')
11 url="http://libvirt.org/"
13 depends=('e2fsprogs' 'gnutls' 'iptables' 'libxml2' 'parted' 'polkit' 'python2'
14 'avahi' 'yajl' 'libpciaccess' 'udev' 'dbus-core' 'libxau' 'libxdmcp' 'libpcap'
15 'curl' 'libsasl' 'libgcrypt' 'libgpg-error' 'openssl' 'libxcb' 'gcc-libs'
17 makedepends=('git' 'pkgconfig' 'lvm2')
18 optdepends=('bridge-utils: for briged networking (default)'
19 'dnsmasq: for NAT/DHCP for guests'
21 'openbsd-netcat: for remote management over ssh'
24 options=('emptydirs' '!libtool')
25 backup=('etc/conf.d/libvirtd'
26 'etc/conf.d/libvirtd-guests'
27 'etc/libvirt/libvirtd.conf'
28 'etc/libvirt/qemu.conf'
29 'etc/sasl2/libvirt.conf')
30 install="libvirt.install"
36 libvirtd-guests.conf.d
40 md5sums=('c43244c40a0437038c82089618e7beaa'
41 '3ed0e24f5b5e25bf553f5427d64915e6'
42 '6f36bf189ef0e5847038787d13535420'
43 'bc2971dacdbac967fc3474e50affc345'
44 '38cac6ba7468de69e787fde64a0f1a36'
45 'db95aecdf2ccf3693fef5821cdcb7eba'
46 '5745bb8d0b254abb7a3528c66e03b0f9')
48 _gitroot="git://libvirt.org/libvirt.git"
53 msg "Connecting to GIT server...."
55 if [[ -d "$_gitname" ]]; then
56 cd "$_gitname" && git pull origin
57 msg "The local files are updated."
59 git clone "$_gitroot" "$_gitname"
62 msg "GIT checkout done or server timeout"
63 msg "Starting build..."
65 rm -rf "$srcdir/$_gitname-build"
66 git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
67 cd "$srcdir/$_gitname-build"
73 export PYTHON=`which python2`
74 for file in $(find . -name '*.py' -print); do
75 sed -i 's_#!.*/usr/bin/python_#!/usr/bin/python2_' $file
76 sed -i 's_#!.*/usr/bin/env.*python_#!/usr/bin/env python2_' $file
79 # for more information on authentication see http://libvirt.org/auth.html
80 # If you wish to have unix-permissions based access rather than only polkit
81 # access, create a group called libvirt and uncomment the line below:
82 # patch -Np1 -i "$srcdir"/unixperms.patch
84 [ $NOEXTRACT -eq 1 ] || patch -Np1 -i "$srcdir"/openbsd-netcat.patch
86 # fixes for yajl 2.0 API changes
87 # [ $NOEXTRACT -eq 1 ] || patch -Np1 -i "$srcdir/yajl-2.x.patch"
90 [ -f Makefile ] || ./autogen.sh --prefix=/usr --libexec=/usr/lib/libvirt \
91 --with-storage-lvm --without-xen --with-udev --without-hal
92 find -name Makefile -exec sed -i 's#-L /usr#-L/usr#' {} \;
97 cd "$srcdir/$_gitname-build"
98 make DESTDIR="$pkgdir/" install
100 install -D -m755 "$srcdir"/libvirtd.rc.d "$pkgdir"/etc/rc.d/libvirtd
101 install -D -m644 "$srcdir"/libvirtd.conf.d "$pkgdir"/etc/conf.d/libvirtd
103 install -D -m755 "$srcdir"/libvirtd-guests.rc.d "$pkgdir"/etc/rc.d/libvirtd-guests
104 install -D -m644 "$srcdir"/libvirtd-guests.conf.d "$pkgdir"/etc/conf.d/libvirtd-guests
106 rm -rf $pkgdir/var/run