4 Summary: Kernel Virtual Machine virtualization environment
6 Group: System Environment
/Kernel
8 URL: http
://www.qumranet.com
9 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
11 ExclusiveArch: i386 x86_64
13 Requires: kvm
-kmod bridge
-utils
15 %define Distribution %
(rpm
-q
-qf
/etc
/redhat
-release
--qf '%
%{name}' | cut
-d"
-"
-f
1)
16 %define os_version %
(rpm
-q
--qf '%
%{version}' %{Distribution}-release
)
17 %define os_release %
(rpm
-q
--qf '%
%{release}' %{Distribution}-release | cut
-d"."
-f
1)
19 %if %
([ x"
%{Distribution}" = x"fedora" -a x"%{os_version}"
= x"
5"
] && echo 1 ||
echo 0)
20 %define require_gccver
32
23 %if %
([ x"
%{Distribution}" = x"fedora" -a 0"%{os_version}"
-ge "
8"
] && echo 1 ||
echo 0)
24 %define qemuldflags
--qemu
-ldflags
=-Wl
,--build
-id
26 %define qemuldflags ""
29 %if %
([ x"
%{Distribution}" = x"centos" -a x"%{os_version}"
= x"
4"
] && echo 1 ||
echo 0)
30 %define require_gccver
32
33 %if %
([ x"
%{Distribution}" = x"redhat" -a x"%{os_release}"
= x"
5"
] && echo 1 ||
echo 0)
34 %define require_gccver
34
37 %if %
( [ x"
%{require_gccver}"
= x"
32"
] && echo 1 ||
echo 0)
38 BuildRequires
: compat
-gcc
-32
40 BuildRequires
: compat
-gcc
-34
43 BuildRequires
: SDL
-devel zlib
-devel alsa
-lib
-devel
45 %define _prebuilt
%{?prebuilt:1}%{!?prebuilt:0}
50 Source2: kernel.tar.gz
51 Source3: scripts.tar.gz
55 Source7: libkvm.tar.gz
56 Source8: extboot.tar.gz
60 The Kernel Virtual Machine provides a virtualization enviroment
for processors
61 with hardware support
for virtualization
: Intel's VT and AMD's AMD
-V.
66 %setup -T
-b
0 -n qemu
67 %setup -T
-b
1 -n user
-D
68 %setup -T
-b
2 -n kernel
-D
69 %setup -T
-b
7 -n libkvm
-D
70 %setup -T
-b
3 -n scripts
-D
71 %setup -T
-b
8 -n extboot
-D
73 cp
%{_sourcedir}/Makefile %{_sourcedir}/configure %{_sourcedir}/kvm_stat .
82 .
/configure
--prefix
=/usr
/kvm
%{qemuldflags}
88 # kpath="$(readlink -f ../kernel/include)"
89 # upath="$(readlink -f ../user)"
90 # ./configure --target-list=$(uname -i)-softmmu \
91 # --extra-cflags="-I$kpath -I$upath" \
92 # --extra-ldflags="-L$upath" \
93 # --disable-kqemu --enable-kvm --prefix=/usr/kvm
106 make DESTDIR
=%{buildroot} install-rpm
108 %define bindir
/usr
/bin
109 %define bin
%{bindir}/kvm
110 %define initdir
/etc
/init.d
111 %define confdir
/etc
/kvm
112 %define utilsdir
/etc
/kvm
/utils
115 /sbin
/chkconfig
--add kvm
116 /sbin
/chkconfig
--level
2345 kvm on
117 /sbin
/chkconfig
--level
16 kvm off
118 /usr
/sbin
/groupadd
-fg 444 kvm
121 if [ "$
1"
!= 0 ]; then
122 /sbin
/service kvm stop
123 /sbin
/chkconfig
--level
2345 kvm off
124 /sbin
/chkconfig
--del kvm
128 %{__rm} -rf %{buildroot}
135 /etc
/udev
/rules.d
/*kvm
*.rules