# Contributor: William Pitcock # Contributor: Roger Pau Monne # Maintainer: William Pitcock pkgname=xen pkgver=4.2.1 pkgrel=1 pkgdesc="Xen hypervisor" url="http://www.xen.org/" arch="x86 x86_64" license="GPL" depends="syslinux bash screen iproute2" depends_dev="openssl-dev python-dev e2fsprogs-dev gettext zlib-dev ncurses-dev libiconv-dev dev86 texinfo perl iasl pciutils-dev glib-dev yajl-dev" makedepends="$depends_dev" install="" subpackages="$pkgname-doc $pkgname-dev $pkgname-libs $pkgname-hypervisor $pkgname-xend" source="http://bits.xensource.com/oss-xen/release/$pkgver/$pkgname-$pkgver.tar.gz qemu_uclibc_configure.patch librt.patch qemu-xen_paths.patch xenstored.initd xenstored.confd xenconsoled.initd xenconsoled.confd xend.initd xend.confd xendomains.initd xendomains.confd xen-consoles.logrotate xenqemu.confd xenqemu.initd " _builddir="$srcdir"/$pkgname-$pkgver prepare() { local i cd "$_builddir" for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done # remove all -Werror msg "Eradicating -Werror..." find -name '*.mk' -o -name 'Make*' | xargs sed -i -e 's/-Werror//g' unset CFLAGS unset LDFLAGS msg "Running configure..." ./configure || return 1 } build() { cd "$_builddir" # Unset CFLAGS and LDFLAGS because the xen build system # doesn't support them. Instead use .config in xen root # folder if necessary. unset CFLAGS unset LDFLAGS msg "Building hypervisor..." make xen || return 1 msg "Building tools..." make tools || return 1 msg "Building documentation..." make docs || return 1 msg "Building stub domains..." make stubdom || return 1 } package() { cd "$_builddir" unset CFLAGS unset LDFLAGS make -j1 DESTDIR="$pkgdir" install-xen install-tools install-docs \ install-stubdom || return 1 # remove default xencommons rm -rf "$pkgdir"/etc/init.d/xencommons for i in $source; do case $i in *.initd) install -Dm755 "$srcdir"/$i \ "$pkgdir"/etc/init.d/${i%.*};; *.confd) install -Dm644 "$srcdir"/$i \ "$pkgdir"/etc/conf.d/${i%.*};; esac done install -Dm644 "$srcdir"/xen-consoles.logrotate \ "$pkgdir"/etc/xen/xen-consoles.logrotate } libs() { pkgdesc="Libraries for Xen tools" replaces="xen" mkdir -p "$subpkgdir"/usr/lib mv "$pkgdir"/usr/lib/*.so.* \ "$pkgdir"/usr/lib/fs \ "$subpkgdir"/usr/lib/ } hypervisor() { pkgdesc="Xen hypervisor" replaces="xen" mkdir -p "$subpkgdir" mv "$pkgdir"/boot "$subpkgdir"/ } xend() { pkgdesc="Xend toolstack" replaces="xen" depends="udev xen python" mkdir -p "$subpkgdir" sitepackages=`python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"` mkdir -p "$subpkgdir"/"$sitepackages"/xen find "$pkgdir"/"$sitepackages"/xen -maxdepth 1 -mindepth 1 -type d -not -name lowlevel \ -exec mv '{}' "$subpkgdir"/"$sitepackages"/xen \; } md5sums="0d48cbe1767b82aba12517898d4e0408 xen-4.2.1.tar.gz 506e7ab6f9482dc95f230978d340bcd9 qemu_uclibc_configure.patch 2dc5ddf47c53ea168729975046c3c1f9 librt.patch 1ccde6b36a6f9542a16d998204dc9a22 qemu-xen_paths.patch 95d8af17bf844d41a015ff32aae51ba1 xenstored.initd b017ccdd5e1c27bbf1513e3569d4ff07 xenstored.confd ed262f15fb880badb53575539468646c xenconsoled.initd ec2252c72050d7d5870a3a629b873ba6 xenconsoled.confd 1803ddf6877bdf254082365389a4efa9 xend.initd 9261ad0f285836c1b0ea07f306e4586e xend.confd c99e24fe50ac40436040e3b012f23cdc xendomains.initd 9b20e056d475b50586cf9e1fc94e13c4 xendomains.confd 9df68ac65dc3f372f5d61183abdc83ff xen-consoles.logrotate 6a2f777c16678d84039acf670d86fff6 xenqemu.confd f9afbf39e2b5a7d9dde60ebbd249ea7d xenqemu.initd"