1 # Maintainer: Mark <mark@caffeine-powered.net>
2 # This pkgbuild is a modified xen4 pkgbuild. Most credits go to that maintainer.
7 pkgdesc="Xen 4 (hypervisor tools and doc) HG"
11 depends=('xz-utils' 'bzip2' 'lib32-glibc-devel' 'transfig' 'texlive-core' 'iproute' 'bridge-utils' 'python' 'sdl' 'zlib' 'e2fsprogs' 'bin86' 'pkgconfig' 'iasl' 'gnutls')
12 makedepends=('dev86' 'mercurial' 'git' 'ghostscript')
13 conflicts=('xen' 'xen3' 'xen4' 'xen-hv-tools' 'libxen4')
16 md5sums=('04d7bb8196ec814fe4025f205da88d67')
17 _hgroot="http://xenbits.xen.org/xen-4.0-testing.hg"
18 _hgrepo="xen-4.0-testing"
23 msg "Connecting to Mercurial server...."
25 if [ -d $_hgrepo ] ; then
27 hg pull -u || return 1
28 msg "The local files are updated."
30 hg clone $_hgroot $_hgrepo || return 1
33 msg "Mercurial checkout done or server timeout"
34 msg "Starting make..."
36 rm -rf "$srcdir/$_hgrepo-build"
37 cp -r "$srcdir/$_hgrepo" "$srcdir/$_hgrepo-build"
38 cd "$srcdir/$_hgrepo-build"
40 patch -p1 -i ../xen.patch
42 find ../ -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
43 -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
44 -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
45 -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
46 -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
47 -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
52 make -C tools || return 1
53 make dist-xen || return 1
54 #LDFLAGS="-L/usr/lib/ -L$srcdir/xen-${pkgver}/dist/install/usr/lib -L$srcdir/xen-${pkgver}/dist/install/usr/lib64" make dist-tools || return 1
55 LDFLAGS="-L/usr/lib/ -L$srcdir/$_hgrepo-build/dist/install/usr/lib -L$srcdir/$_hgrepo-build/dist/install/usr/lib64" make dist-tools || return 1
56 make dist-docs || return 1
58 cp -R dist/install/* $pkgdir
60 sed -i 's#XENDOM_CONFIG=/etc/sysconfig/xendomains#XENDOM_CONFIG=/etc/conf.d/xendomains#' $pkgdir/etc/init.d/xendomains
61 sed -i "s#touch /var/lock/subsys/xend#mkdir -p /var/lock/subsys\n touch /var/lock/subsys/xend#" $pkgdir/etc/init.d/xend
63 [ -x "$(which udevadm)" ] && UDEV_VERSION=$(udevadm -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
65 if [ -n "$UDEV_VERSION" ] && [ $UDEV_VERSION -ge 059 ]; then
66 echo " - installing for udev-based system"
67 rm -rf "$pkgdir/etc/hotplug"
69 echo " - installing for hotplug-based system"
70 rm -rf "$pkgdir/etc/udev"
73 [ -d $pkgdir/usr/lib64 ] && ( cd $pkgdir/usr && cp -R lib64/* lib/ && rm -R lib64 )
74 ( cd $pkgdir/etc && mv init.d rc.d ) || return 1
75 ( cd $pkgdir/etc && mv sysconfig conf.d ) || return 1
76 rm -f $pkgdir/usr/share/man/man1/qemu-img.1* \
77 $pkgdir/usr/share/man/man1/qemu.1*