# Maintainer: Natanael Copa pkgname=qemu pkgver=1.3.1 pkgrel=0 pkgdesc="QEMU is a generic machine emulator and virtualizer" url="http://qemu,org/" arch="all" license="GPL-2 LGPL-2" makedepends="zlib-dev sdl-dev alsa-lib-dev gnutls-dev ncurses-dev glib-dev libjpeg-turbo-dev libpng-dev vde2-dev spice-dev paxctl curl-dev libcap-dev libcap-ng-dev libaio-dev usbredir-dev util-linux-dev" depends= install="qemu.pre-install" subpackages=" $pkgname-alpha $pkgname-arm $pkgname-cris $pkgname-i386 $pkgname-lm32 $pkgname-m68k $pkgname-microblaze $pkgname-microblazeel $pkgname-mips $pkgname-mips64 $pkgname-mips64el $pkgname-mipsel $pkgname-ppc $pkgname-ppc64 $pkgname-ppcemb $pkgname-sh4 $pkgname-s390x $pkgname-sh4eb $pkgname-sparc $pkgname-sparc64 $pkgname-x86_64 $pkgname-xtensa $pkgname-xtensaeb $pkgname-or32 $pkgname-unicore32 $pkgname-img " source="http://wiki.qemu-project.org/download/qemu-$pkgver.tar.bz2 80-kvm.rules" prepare() { cd "$srcdir"/$pkgname-$pkgver for i in $source; do case $i in *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; esac done # avoid fdt till an updated release appears sed -i -e 's:fdt="yes":fdt="no":' configure # prevent docs to get automatically installed sed -i '/$(DESTDIR)$(docdir)/d' Makefile # Alter target makefiles to accept CFLAGS sed -i 's/^\(C\|OP_C\|HELPER_C\)FLAGS=/\1FLAGS+=/' \ Makefile Makefile.target tests/Makefile sed -i 's/^VL_LDFLAGS=$/VL_LDFLAGS=-Wl,-z,execheap/' \ Makefile.target } build() { cd "$srcdir"/$pkgname-$pkgver ./configure --prefix=/usr \ --audio-drv-list=oss,alsa,sdl \ --audio-card-list=ac97,sb16,es1370,adlib,hda \ --enable-vde \ --enable-spice \ --enable-virtfs \ --enable-curl \ --enable-cap-ng \ --enable-linux-aio \ --enable-usb-redir \ --enable-guest-agent \ --enable-uuid \ --disable-bsd-user \ --disable-linux-user \ --disable-werror \ --cc="${CC:-gcc}" \ || return 1 make || return 1 # tests fails on x86 # http://lists.gnu.org/archive/html/qemu-devel/2012-11/msg01429.html # http://web.archiveorange.com/archive/v/21oVv8wOfpQGkyy8EK0N # make check || return 1 } package() { cd "$srcdir"/$pkgname-$pkgver make DESTDIR="$pkgdir" install || return 1 install -Dm644 "$srcdir"/80-kvm.rules \ "$pkgdir"/lib/udev/rules.d/80-kvm.rules || return 1 paxctl -c -m "$pkgdir"/usr/bin/qemu-system-* || return 1 } _subsys() { pkgdesc="Qemu $1 system emulator" depends="qemu" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/qemu-system-$1 "$subpkgdir"/usr/bin/ } alpha() { _subsys alpha; } arm() { _subsys arm; } cris() { _subsys cris; } i386() { _subsys i386; } lm32() { _subsys lm32; } m68k() { _subsys m68k; } microblaze() { _subsys microblaze; } microblazeel() { _subsys microblazeel; } mips() { _subsys mips; } mips64() { _subsys mips64; } mips64el() { _subsys mips64el; } mipsel() { _subsys mipsel; } ppc() { _subsys ppc; } ppc64() { _subsys ppc64; } ppcemb() { _subsys ppcemb; } s390x() { _subsys s390x; } sh4() { _subsys sh4; } sh4eb() { _subsys sh4eb; } sparc() { _subsys sparc; } sparc64() { _subsys sparc64; } x86_64() { _subsys x86_64; } xtensa() { _subsys xtensa; } xtensaeb() { _subsys xtensaeb; } or32() { _subsys or32; } unicore32() { _subsys unicore32; } img() { pkgdesc="QEMU command line tool for manipulating disk images" replaces="qemu" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/qemu-img \ "$pkgdir"/usr/bin/qemu-io \ "$subpkgdir"/usr/bin/ # we exploit the fact that -img subpackage are craeted last # and check that we done have new systems that belongs in # subpackage local _bins= _ret=0 for i in "$pkgdir"/usr/bin/qemu-system-*; do if [ -r "$i" ]; then error "Please create a subpackage for ${i##*/}" _ret=1 fi done return $_err } md5sums="5dbc6c22f47efca71dfaae0dd80dcf9e qemu-1.3.1.tar.bz2 66660f143235201249dc0648b39b86ee 80-kvm.rules"