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 ia64
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
-x
&VT
-i 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}
90 # kpath="$(readlink -f ../kernel/include)"
91 # upath="$(readlink -f ../user)"
92 # ./configure --target-list=$(uname -i)-softmmu \
93 # --extra-cflags="-I$kpath -I$upath" \
94 # --extra-ldflags="-L$upath" \
95 # --disable-kqemu --enable-kvm --prefix=/usr/kvm
108 make DESTDIR
=%{buildroot} install-rpm
110 %define bindir
/usr
/bin
111 %define bin
%{bindir}/kvm
112 %define initdir
/etc
/init.d
113 %define confdir
/etc
/kvm
114 %define utilsdir
/etc
/kvm
/utils
117 /sbin
/chkconfig
--add kvm
118 /sbin
/chkconfig
--level
2345 kvm on
119 /sbin
/chkconfig
--level
16 kvm off
120 /usr
/sbin
/groupadd
-fg 444 kvm
123 if [ "$
1"
!= 0 ]; then
124 /sbin
/service kvm stop
125 /sbin
/chkconfig
--level
2345 kvm off
126 /sbin
/chkconfig
--del kvm
130 %{__rm} -rf %{buildroot}
137 /etc
/udev
/rules.d
/*kvm
*.rules