Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: bacaa89de7
Fetching contributors…

Cannot retrieve contributors at this time

140 lines (113 sloc) 3.1 KB
Name: kvm
Version: 0.0
Release: 0
Summary: Kernel Virtual Machine virtualization environment
Group: System Environment/Kernel
License: GPL
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
ExclusiveArch: i386 x86_64 ia64
Requires: kvm-kmod bridge-utils
%define Distribution %(rpm -q -qf /etc/redhat-release --qf '%%{name}' | cut -d"-" -f 1)
%define os_version %(rpm -q --qf '%%{version}' %{Distribution}-release)
%define os_release %(rpm -q --qf '%%{release}' %{Distribution}-release | cut -d"." -f 1)
%if %([ x"%{Distribution}" = x"fedora" -a x"%{os_version}" = x"5" ] && echo 1 || echo 0)
%define require_gccver 32
%if %([ x"%{Distribution}" = x"fedora" -a 0"%{os_version}" -ge "8" ] && echo 1 || echo 0)
%define qemuldflags --qemu-ldflags=-Wl,--build-id
%define qemuldflags ""
%if %([ x"%{Distribution}" = x"centos" -a x"%{os_version}" = x"4" ] && echo 1 || echo 0)
%define require_gccver 32
%if %([ x"%{Distribution}" = x"redhat" -a x"%{os_release}" = x"5" ] && echo 1 || echo 0)
%define require_gccver 34
%if %( [ x"%{require_gccver}" = x"32" ] && echo 1 || echo 0)
BuildRequires: compat-gcc-32
BuildRequires: compat-gcc-34
BuildRequires: SDL-devel zlib-devel alsa-lib-devel
%define _prebuilt %{?prebuilt:1}%{!?prebuilt:0}
%if !%{_prebuilt}
Source0: kvm.tar.gz
Source1: user.tar.gz
Source2: kernel.tar.gz
Source3: scripts.tar.gz
Source4: Makefile
Source5: configure
Source6: kvm_stat
Source7: libkvm.tar.gz
Source8: extboot.tar.gz
The Kernel Virtual Machine provides a virtualization enviroment for processors
with hardware support for virtualization: Intel's VT-x&VT-i and AMD's AMD-V.
%if !%{_prebuilt}
%setup -T -b 0 -n qemu
%setup -T -b 1 -n user -D
%setup -T -b 2 -n kernel -D
%setup -T -b 7 -n libkvm -D
%setup -T -b 3 -n scripts -D
%setup -T -b 8 -n extboot -D
cd ..
cp %{_sourcedir}/Makefile %{_sourcedir}/configure %{_sourcedir}/kvm_stat .
rm -rf %{buildroot}
%if !%{_prebuilt}
cd ..
./configure --prefix=/usr/kvm %{qemuldflags}
make -C libkvm
make -C user
%ifarch i386 x86_64
make extboot
#(cd qemu;
# ./co
# kpath="$(readlink -f ../kernel/include)"
# upath="$(readlink -f ../user)"
# ./configure --target-list=$(uname -i)-softmmu \
# --extra-cflags="-I$kpath -I$upath" \
# --extra-ldflags="-L$upath" \
# --disable-kqemu --enable-kvm --prefix=/usr/kvm
make -C qemu
%if !%{_prebuilt}
cd ..
cd %{objdir}
make DESTDIR=%{buildroot} install-rpm
%define bindir /usr/bin
%define bin %{bindir}/kvm
%define initdir /etc/init.d
%define confdir /etc/kvm
%define utilsdir /etc/kvm/utils
/sbin/chkconfig --add kvm
/sbin/chkconfig --level 2345 kvm on
/sbin/chkconfig --level 16 kvm off
/usr/sbin/groupadd -fg 444 kvm
if [ "$1" != 0 ]; then
/sbin/service kvm stop
/sbin/chkconfig --level 2345 kvm off
/sbin/chkconfig --del kvm
%{__rm} -rf %{buildroot}
Jump to Line
Something went wrong with that request. Please try again.