opt/qemu/Pkgfile
Thomas Penteker 42d84073ff [notify] qemu/qemu-all: add udev rules for /dev/kvm
This change requires you to run the bundled pre-install script, that will a
new group 'kvm' with proper permissions for the /dev/kvm device, to allow
unprivileged users (members of the kvm group) to run kvm-accelerated qemu
instances.

Please note that this change prevents non-root and non-kvm members from using
/dev/kvm acceleration.
2014-06-20 22:29:13 +02:00

48 lines
1.4 KiB
Plaintext

# Description: Fast CPU emulator and virtualizer for the x86 platform
# URL: http://www.qemu.org
# Maintainer: Thomas Penteker, tek at serverop dot de
# Packager: Lucas Hazel, lucas at die dot net dot au
# Depends on: libsdl
# Nice to have: libseccomp libiscsi libusb usbredir
name=qemu
version=2.0.0
release=2
source=(http://wiki.qemu.org/download/qemu-$version.tar.bz2)
build() {
cd $name-$version
./configure --prefix=/usr \
--cc="${CC:=gcc}" \
--host-cc="${CC:=gcc}" \
--sysconfdir=/etc \
--disable-docs \
--libexecdir=/usr/lib/qemu \
--disable-gtk \
--localstatedir=/var \
--target-list=x86_64-linux-user,i386-linux-user,i386-softmmu,x86_64-softmmu
# fix include issues with libcap
sed -i -e '/#include "qemu\/xattr.h"/d' \
-e 's|#include <sys/resource.h>|#include <sys/resource.h>\r\n#include "qemu\/xattr.h"|g' \
fsdev/virtfs-proxy-helper.c
# fix include issues with nspr
echo 'QEMU_CFLAGS+=-I/usr/include/nspr' >> libcacard/Makefile
make ${MAKEFLAGS:=}
make DESTDIR=$PKG install
make qemu.1 qemu-img.1 qemu-nbd.8
install -D -m 644 qemu.1 $PKG/usr/man/man1/qemu.1
install -D -m 644 qemu-img.1 $PKG/usr/man/man1/qemu-img.1
install -D -m 644 qemu-nbd.8 $PKG/usr/man/man8/qemu-nbd.8
install -d $PKG/etc/udev/rules.d/
echo 'KERNEL=="kvm", NAME="kvm", OWNER="root", GROUP="kvm", MODE="0660"' > \
$PKG/etc/udev/rules.d/60-kvm.rules
rm -rf $PKG/usr/share/locale
}