1 |
%define name xen |
2 |
%define version 4.1.2 |
3 |
%define release %mkrel 3 |
4 |
%define major 3.0 |
5 |
%define libname %mklibname %{name} %{major} |
6 |
%define develname %mklibname %{name} -d |
7 |
|
8 |
Name: %{name} |
9 |
Version: %{version} |
10 |
Release: %{release} |
11 |
Summary: The basic tools for managing XEN virtual machines |
12 |
Group: System/Kernel and hardware |
13 |
License: GPL |
14 |
Source0: http://bits.xensource.com/oss-xen/release/%{version}/%{name}-%{version}.tar.gz |
15 |
Source1: %{name}.modules |
16 |
Source2: qemu-xen-4.0.0-rc4.tar.gz |
17 |
Source3: http://www.hyperrealm.com/libconfig/libconfig-1.3.2.tar.gz |
18 |
# stubdoms |
19 |
Source10: zlib-1.2.3.tar.gz |
20 |
Source11: newlib-1.16.0.tar.gz |
21 |
Source12: grub-0.97.tar.gz |
22 |
Source13: lwip-1.3.0.tar.gz |
23 |
Source14: pciutils-2.2.9.tar.bz2 |
24 |
Source15: ocaml-3.11.0.tar.gz |
25 |
Source16: ipxe-git-v1.0.0.tar.gz |
26 |
# initscripts |
27 |
Source20: init.xenstored |
28 |
Source21: init.xenconsoled |
29 |
Source22: init.blktapctrl |
30 |
Source23: init.xend |
31 |
Source30: sysconfig.xenstored |
32 |
Source31: sysconfig.xenconsoled |
33 |
Source32: sysconfig.blktapctrl |
34 |
Patch0: xen-4.1.2-fix-stubdom-Makefile.patch |
35 |
# fedora patches |
36 |
Patch3: xen-xenstore-cli.patch |
37 |
Patch5: xen-net-disable-iptables-on-bridge.patch |
38 |
Patch10: xen-no-werror.patch |
39 |
Patch11: xen-4.0.1-gcc45.patch |
40 |
Patch12: xen-4.0.1-gcc451.patch |
41 |
Patch13: xen-4.0.1-py2.7.patch |
42 |
# debian patch |
43 |
Patch20: fix_buffer_underflow_CVE-2012-0029.patch |
44 |
Requires: python |
45 |
Requires: python-twisted-core |
46 |
Requires: python-pyxml |
47 |
Requires: module-init-tools |
48 |
Requires: iptables |
49 |
Requires: bridge-utils |
50 |
Requires: glibc-xen |
51 |
Requires: grub |
52 |
Requires: kernel-server |
53 |
Requires: %{libname} = %{version}-%{release} |
54 |
BuildRequires: SDL-devel |
55 |
BuildRequires: libx11-devel |
56 |
BuildRequires: gtk2-devel |
57 |
BuildRequires: curl-devel |
58 |
Buildrequires: dev86-devel |
59 |
BuildRequires: libext2fs-devel |
60 |
BuildRequires: ncurses-devel |
61 |
BuildRequires: libpython-devel >= 2.4 |
62 |
BuildRequires: zlib-devel |
63 |
BuildRequires: bzip2-devel |
64 |
BuildRequires: lzma-devel |
65 |
BuildRequires: pciutils-devel |
66 |
BuildRequires: libidn-devel |
67 |
BuildRequires: openssl-devel |
68 |
BuildRequires: gnutls-devel |
69 |
BuildRequires: libgcrypt-devel |
70 |
BuildRequires: brlapi-devel |
71 |
BuildRequires: e2fsprogs-devel |
72 |
BuildRequires: libuuid-devel |
73 |
BuildRequires: ocaml |
74 |
BuildRequires: ocaml-findlib-devel |
75 |
BuildRequires: iasl |
76 |
BuildRequires: vde-devel |
77 |
BuildRequires: libaio-devel |
78 |
BuildRequires: gettext |
79 |
BuildRequires: libconfig-devel |
80 |
# documentation |
81 |
BuildRequires: ghostscript |
82 |
BuildRequires: transfig |
83 |
BuildRequires: texinfo |
84 |
BuildRequires: tetex-latex |
85 |
BuildRequires: texi2html |
86 |
Obsoletes: xen-uptodate |
87 |
Requires: xen-hypervisor = %{version} |
88 |
|
89 |
%description |
90 |
The basic tools for managing XEN virtual machines. |
91 |
|
92 |
%package -n ocaml-xen |
93 |
Summary: OCaml bindings for Xen |
94 |
Group: Development/Other |
95 |
Obsoletes: xen-ocaml < %{version}-%{release} |
96 |
|
97 |
%description -n ocaml-xen |
98 |
This package contains the Ocaml bindings for Xen |
99 |
|
100 |
%package hypervisor |
101 |
Summary: Libraries for Xen tools |
102 |
Group: System/Kernel and hardware |
103 |
|
104 |
%description hypervisor |
105 |
This package contains the Xen hypervisor |
106 |
|
107 |
%package doc |
108 |
Summary: XEN documentation |
109 |
Group: System/Kernel and hardware |
110 |
Obsoletes: xen-uptodate-doc |
111 |
|
112 |
%description doc |
113 |
XEN documentation. |
114 |
|
115 |
%package -n %{libname} |
116 |
Summary: Libraries for %{name} |
117 |
Group: System/Libraries |
118 |
Conflicts: %{name} < 3.1.0-5 |
119 |
|
120 |
%description -n %{libname} |
121 |
This package contains the libraries needed to run programs dynamically |
122 |
linked with Xen libraries. |
123 |
|
124 |
%package -n %{develname} |
125 |
Summary: Static libraries and header files for %{name} |
126 |
Group: Development/C |
127 |
Requires: %{libname} = %{version}-%{release} |
128 |
Provides: %{name}-devel = %{version}-%{release} |
129 |
Conflicts: %{name} < 3.1.0-5 |
130 |
|
131 |
%description -n %{develname} |
132 |
This package contains the static development libraries and headers needed |
133 |
to compile applications linked with Xen libraries. |
134 |
|
135 |
%prep |
136 |
%setup -q |
137 |
%patch0 -p 1 |
138 |
#patch3 -p 1 |
139 |
#patch5 -p 1 |
140 |
%patch10 -p 1 |
141 |
#patch11 -p 1 |
142 |
%patch12 -p1 |
143 |
#patch13 -p1 |
144 |
|
145 |
# stub domain |
146 |
cp %{SOURCE10} stubdom |
147 |
cp %{SOURCE11} stubdom |
148 |
cp %{SOURCE12} stubdom |
149 |
cp %{SOURCE13} stubdom |
150 |
cp %{SOURCE14} stubdom |
151 |
cp %{SOURCE15} stubdom |
152 |
|
153 |
cp %{SOURCE16} tools/firmware/etherboot/ipxe.tar.gz |
154 |
|
155 |
# qemu |
156 |
tar xf %{SOURCE2} -C tools |
157 |
pushd tools/ioemu-qemu-xen |
158 |
%patch20 -p1 |
159 |
popd |
160 |
|
161 |
%build |
162 |
# clean all stuff |
163 |
export CFLAGS="%{optflags}" |
164 |
%make prefix=/usr dist-xen |
165 |
%make prefix=/usr dist-tools |
166 |
make prefix=/usr dist-docs |
167 |
unset CFLAGS |
168 |
make dist-stubdom |
169 |
|
170 |
%install |
171 |
rm -rf %{buildroot} |
172 |
make DESTDIR=%{buildroot} prefix=/usr install-xen |
173 |
make DESTDIR=%{buildroot} prefix=/usr install-tools |
174 |
make DESTDIR=%{buildroot} prefix=/usr install-docs |
175 |
make DESTDIR=%{buildroot} prefix=/usr install-stubdom |
176 |
|
177 |
# stubdom: newlib |
178 |
rm -rf %{buildroot}/usr/*-xen-elf |
179 |
|
180 |
# remove additional kernel symlink |
181 |
rm -f %{buildroot}/boot/xen-3.4.gz |
182 |
rm -f %{buildroot}/boot/xen-3.gz |
183 |
|
184 |
# remove unwanted firmware files |
185 |
rm -rf %{buildroot}/lib/firmware |
186 |
|
187 |
# remove pointless helper |
188 |
rm -f %{buildroot}%{_sbindir}/xen-python-path |
189 |
|
190 |
# remove README's not intended for end users |
191 |
rm -f %{buildroot}/%{_sysconfdir}/xen/README* |
192 |
|
193 |
# fix man pages |
194 |
install -d -m 755 %{buildroot}%{_mandir}/man{1,5} |
195 |
install -m 644 docs/man/*.1 %{buildroot}%{_mandir}/man1 |
196 |
install -m 644 docs/man/*.5 %{buildroot}%{_mandir}/man5 |
197 |
|
198 |
# install doc manually |
199 |
rm -rf %{buildroot}%{_docdir}/qemu |
200 |
install -d -m 755 %{buildroot}%{_docdir}/%{name} |
201 |
install -m 644 README %{buildroot}%{_docdir}/%{name} |
202 |
install -m 644 docs/ps/* %{buildroot}%{_docdir}/%{name} |
203 |
install -m 644 docs/pdf/* %{buildroot}%{_docdir}/%{name} |
204 |
|
205 |
# install state directory |
206 |
install -d -m 755 %{buildroot}%{_localstatedir}/lib/xend/{domains,state,storage} |
207 |
|
208 |
# udev |
209 |
#rm -rf %{buildroot}/etc/udev/rules.d/xen*.rules |
210 |
#mv %{buildroot}/etc/udev/xen*.rules %{buildroot}/etc/udev/rules.d |
211 |
|
212 |
# init scripts |
213 |
#install -d -m 755 %{buildroot}%{_initrddir} |
214 |
#mv %{buildroot}%{_sysconfdir}/init.d/* %{buildroot}%{_initrddir} |
215 |
#rm -rf %{buildroot}%{_sysconfdir}/init.d |
216 |
|
217 |
install -m 755 %{SOURCE20} %{buildroot}%{_initrddir}/xenstored |
218 |
install -m 755 %{SOURCE21} %{buildroot}%{_initrddir}/xenconsoled |
219 |
install -m 755 %{SOURCE22} %{buildroot}%{_initrddir}/blktapctrl |
220 |
install -m 755 %{SOURCE23} %{buildroot}%{_initrddir}/xend |
221 |
|
222 |
# sysconfig |
223 |
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig |
224 |
install -m 644 %{SOURCE30} %{buildroot}%{_sysconfdir}/sysconfig/xenstored |
225 |
install -m 644 %{SOURCE31} %{buildroot}%{_sysconfdir}/sysconfig/xenconsoled |
226 |
install -m 644 %{SOURCE32} %{buildroot}%{_sysconfdir}/sysconfig/blktapctrl |
227 |
|
228 |
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig/modules |
229 |
install -m 755 %{SOURCE1} \ |
230 |
%{buildroot}%{_sysconfdir}/sysconfig/modules/%{name}.modules |
231 |
|
232 |
# logrotate |
233 |
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d |
234 |
cat > %{buildroot}%{_sysconfdir}/logrotate.d/xen <<EOF |
235 |
/var/log/xen/xend-debug.log /var/log/xen/xen-hotplug.log |
236 |
/var/log/xen/domain-builder-ng.log { |
237 |
notifempty |
238 |
missingok |
239 |
copytruncate |
240 |
} |
241 |
EOF |
242 |
|
243 |
# standard gnu info files |
244 |
rm -rf %{buildroot}/usr/info |
245 |
|
246 |
# gprintify has a bug handling some constructs in xendomain |
247 |
export DONT_GPRINTIFY=1 |
248 |
|
249 |
%clean |
250 |
rm -rf %{buildroot} |
251 |
|
252 |
%files |
253 |
%dir %{_docdir}/%{name} |
254 |
%{_docdir}/%{name}/README |
255 |
%{_sysconfdir}/bash_completion.d/xl.sh |
256 |
%config(noreplace) %{_sysconfdir}/udev/rules.d/* |
257 |
%dir %{_sysconfdir}/xen |
258 |
%{_sysconfdir}/xen/scripts |
259 |
%{_sysconfdir}/xen/auto |
260 |
%config(noreplace) %{_sysconfdir}/xen/*.sxp |
261 |
%config(noreplace) %{_sysconfdir}/xen/*.xml |
262 |
%config(noreplace) %{_sysconfdir}/xen/xmexample* |
263 |
%config(noreplace) %{_sysconfdir}/xen/cpupool |
264 |
%config(noreplace) %{_sysconfdir}/xen/xl.conf |
265 |
%{_mandir}/man*/* |
266 |
%{_libdir}/xen |
267 |
%if "%{_lib}" != "lib" |
268 |
%{_prefix}/lib/xen |
269 |
%endif |
270 |
%{_libdir}/fs |
271 |
%{py_platsitedir}/xen |
272 |
%{py_platsitedir}/grub/* |
273 |
%{py_platsitedir}/fsimage.so |
274 |
%{py_platsitedir}/pygrub-0.3-py%{pyver}.egg-info |
275 |
%{py_platsitedir}/xen-3.0-py%{pyver}.egg-info |
276 |
%{_datadir}/xen |
277 |
# general xen state |
278 |
%{_localstatedir}/lib/xen |
279 |
%{_localstatedir}/lib/xend |
280 |
# xenstore state |
281 |
%{_localstatedir}/lib/xenstored |
282 |
%{_localstatedir}/run/xenstored |
283 |
# xend state |
284 |
%{_localstatedir}/run/xend |
285 |
%{_localstatedir}/run/xend/boot |
286 |
# init scripts |
287 |
%{_initrddir}/xend |
288 |
%{_initrddir}/xendomains |
289 |
%{_initrddir}/blktapctrl |
290 |
%{_initrddir}/xenstored |
291 |
%{_initrddir}/xenconsoled |
292 |
%{_initrddir}/xen-watchdog |
293 |
%{_initrddir}/xencommons |
294 |
%{_sysconfdir}/sysconfig/modules/xen.modules |
295 |
%config(noreplace) %{_sysconfdir}/sysconfig/xendomains |
296 |
%config(noreplace) %{_sysconfdir}/sysconfig/blktapctrl |
297 |
%config(noreplace) %{_sysconfdir}/sysconfig/xenstored |
298 |
%config(noreplace) %{_sysconfdir}/sysconfig/xenconsoled |
299 |
%config(noreplace) %{_sysconfdir}/sysconfig/xencommons |
300 |
%config(noreplace) %{_sysconfdir}/logrotate.d/xen |
301 |
%{_sbindir}/xenstored |
302 |
%{_sbindir}/xm |
303 |
%{_sbindir}/xend |
304 |
%{_sbindir}/xenconsoled |
305 |
%{_sbindir}/xentop |
306 |
%{_sbindir}/xen-bugtool |
307 |
%{_sbindir}/xenbaked |
308 |
%{_sbindir}/xenmon.py |
309 |
%{_sbindir}/blktapctrl |
310 |
%{_sbindir}/img2qcow |
311 |
%{_sbindir}/qcow-create |
312 |
%{_sbindir}/qcow2raw |
313 |
%{_sbindir}/tapdisk |
314 |
%{_sbindir}/xentrace_setmask |
315 |
%{_sbindir}/flask-loadpolicy |
316 |
%{_sbindir}/xsview |
317 |
%{_sbindir}/xenperf |
318 |
%{_sbindir}/xenpm |
319 |
%{_sbindir}/xenpmd |
320 |
%{_sbindir}/flask-getenforce |
321 |
%{_sbindir}/flask-setenforce |
322 |
%{_sbindir}/gtracestat |
323 |
%{_sbindir}/gtraceview |
324 |
%{_sbindir}/lock-util |
325 |
%{_sbindir}/tapdisk-client |
326 |
%{_sbindir}/tapdisk-diff |
327 |
%{_sbindir}/tapdisk-stream |
328 |
%{_sbindir}/tapdisk2 |
329 |
%{_sbindir}/td-util |
330 |
%{_sbindir}/vhd-update |
331 |
%{_sbindir}/vhd-util |
332 |
%{_sbindir}/xen-hvmctx |
333 |
%{_sbindir}/xen-tmem-list-parse |
334 |
%{_sbindir}/xenlockprof |
335 |
%{_sbindir}/xenpaging |
336 |
%{_sbindir}/xl |
337 |
%{_sbindir}/gdbsx |
338 |
%{_sbindir}/kdd |
339 |
%{_sbindir}/oxenstored |
340 |
%{_sbindir}/tap-ctl |
341 |
%{_sbindir}/xen-hptool |
342 |
%{_sbindir}/xen-hvmcrash |
343 |
%{_sbindir}/xenwatchdogd |
344 |
%{_bindir}/xencons |
345 |
%{_bindir}/xentrace |
346 |
%{_bindir}/xentrace_format |
347 |
%{_bindir}/xentrace_setsize |
348 |
%{_bindir}/xenstore-* |
349 |
%{_bindir}/pygrub |
350 |
%{_bindir}/remus |
351 |
%{_bindir}/xen-detect |
352 |
%{_bindir}/qemu-img-xen |
353 |
%{_bindir}/qemu-nbd-xen |
354 |
%{_bindir}/xenstore |
355 |
|
356 |
%files -n ocaml-xen |
357 |
%{_libdir}/ocaml/eventchn |
358 |
%{_libdir}/ocaml/mmap |
359 |
%{_libdir}/ocaml/log |
360 |
%{_libdir}/ocaml/uuid |
361 |
%{_libdir}/ocaml/xb |
362 |
%{_libdir}/ocaml/xc |
363 |
%{_libdir}/ocaml/xl |
364 |
%{_libdir}/ocaml/xs |
365 |
|
366 |
%files hypervisor |
367 |
/boot/xen-syms-* |
368 |
/boot/xen-*.gz |
369 |
/boot/xen.gz |
370 |
|
371 |
%files doc |
372 |
%{_docdir}/%{name}/* |
373 |
%exclude %{_docdir}/%{name}/README |
374 |
%doc docs/ps/* docs/pdf/* |
375 |
|
376 |
%files -n %{libname} |
377 |
%{_libdir}/*.so.* |
378 |
|
379 |
%files -n %{develname} |
380 |
%{_includedir}/xen |
381 |
%{_includedir}/*.h |
382 |
%{_libdir}/*.so |
383 |
%{_libdir}/*.a |