#!/bin/bash # # qemu.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # qemu.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="qemu" PACKAGE_EXT="xz" VERSION=${VERSION:=7.1.0} BUILD=${BUILD:=1} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc elif [ -f ../../source/runtime/slackbuildrc ]; then . ../../source/runtime/slackbuildrc fi check_required SRC="$PACKAGE-$VERSION.tar.$PACKAGE_EXT" URL="http://wiki.qemu.org/download/$SRC" get_source $SRC $URL unpack_source $SRC $PACKAGE-$VERSION # check if spice is there if pkg-config --exists spice-server ; then with_spice="--enable-spice" else with_spice="--disable-spice" fi # Enable only x86* and arm emulation for qemu: if you want to build # all the targets available use TARGETS=all if [ "${TARGETS:-all}" = "all" ]; then targets="" else targets="--target-list=i386-softmmu,x86_64-softmmu,i386-linux-user,x86_64-linux-user,arm-softmmu,arm-linux-user,armeb-linux-user" fi KVMGROUP=${KVMGROUP:-users} mkdir build cd build # --libdir is recognized but not advertised in --help CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ ../configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --localstatedir=/var \ --mandir=/usr/man \ --docdir=/usr/doc/$PACKAGE-$VERSION \ --enable-vde \ $with_spice \ $targets make ${NUMJOBS} V=1 make install DESTDIR=$PKG cd .. # let ordinary users use this chmod u+s $PKG/usr/libexec/qemu-bridge-helper # install some udev rules for /dev/kvm mkdir -p $PKG/lib/udev/rules.d/ sed "s/@GROUP@/$KVMGROUP/" $CWD/65-kvm.rules > $PKG/lib/udev/rules.d/65-kvm.rules # create a symlink for qemu-kvm to support aqemu and such frontends # even though qemu now has a gtk gui. if [ "$ARCH" = "i486" ]; then KVMARCH="i386" elif [ "$ARCH" = "i686" ]; then KVMARCH="i386" elif [ "$ARCH" = "x86_64" ]; then KVMARCH="x86_64" fi [ ! -z $KVMARCH ] && ln -s qemu-system-$KVMARCH $PKG/usr/bin/qemu-kvm # Add docs to the proper location mkdir -p $DOCS cp -a COPYING* LICENSE MAINTAINERS README.rst docs/* $DOCS fixup_package $PKG # Clean up the extra stuff: set +u if [ "$1" = "--cleanup" ]; then rm -rf $TMP/$PACKAGE-$VERSION rm -rf $PKG fi