#
# TODO:
-# - most of the qemu config options aren't detected (NPTL, vde, fdt)
# - check if other tools/libs are not usable in domU, move them to -guest
# packages if so
# - pass bconds to qemu configure script (tricky, as the script is called from
# Xen Makefiles)
+# - fix %doc - some files are installed in docdir both by make install and %d,
+# other are installed once
+# - now the build dependencies are insane (because of what qemu can use)
+# we should make them optional or get rid of them all properly
#
#
# Conditional build:
%bcond_without bluetooth # disable bluetooth support in Xen qemu
%bcond_without brlapi # disable brlapi support in Xen qemu
%bcond_without ocaml # build Ocaml libraries for Xen tools
-#
+%bcond_without efi # build the EFI hypervisor
+
+%ifnarch %{x8664}
+%undefine with_efi
+%endif
+
# from Config.mk:
%define seabios_version 1.6.3.2
-#
+
%define xen_extfiles_url http://xenbits.xensource.com/xen-extfiles
Summary: Xen - a virtual machine monitor
Summary(pl.UTF-8): Xen - monitor maszyny wirtualnej
Name: xen
Version: 4.2.0
-Release: 0.1
+Release: 3
License: GPL v2, interface parts on BSD-like
Group: Applications/System
Source0: http://bits.xensource.com/oss-xen/release/%{version}/%{name}-%{version}.tar.gz
Source53: xen-watchdog.init
Source54: xendomains.init
Source55: xen.logrotate
+Source56: xen.tmpfiles
Patch0: %{name}-python_scripts.patch
Patch1: %{name}-symbols.patch
Patch2: %{name}-curses.patch
Patch8: xen-configure-xend.patch
Patch9: xen-initscript.patch
Patch10: xen-quemu-softloat-c99.patch
+Patch11: xen-qemu.patch
+Patch12: xen-scripts-locking.patch
+Patch13: xen-close_lockfd_after_lock_attempt.patch
URL: http://www.xen.org/products/xenhyp.html
%{?with_opengl:BuildRequires: OpenGL-devel}
%{?with_sdl:BuildRequires: SDL-devel >= 1.2.1}
%endif
%{?with_bluetooth:BuildRequires: bluez-libs-devel}
%{?with_brlapi:BuildRequires: brlapi-devel}
+%{?with_efi:BuildRequires: binutils >= 3:2.23.51.0.3-2}
BuildRequires: bzip2-devel
BuildRequires: ceph-devel
BuildRequires: curl-devel
BuildRequires: texlive-dvips
BuildRequires: texlive-latex-psnfss
BuildRequires: texlive-xetex
-# not adjusted for usbredir 0.5.x (libusbredirparser-0.5)
-#BuildRequires: usbredir-devel
+BuildRequires: usbredir-devel
BuildRequires: vde2-devel
BuildRequires: which
# for xfsctl (<xfs/xfs.h>)
%description -n bash-completion-%{name} -l pl.UTF-8
Ten pakiet zapewnia bashowe dopełnianie poleceń dla Xena (xl).
+%package efi
+Summary: Xen hypervisor binary for EFI
+Summary(pl.UTF-8): Hipernadzorca Xen dla EFI
+Group: Applications/System
+Requires: %{name}-libs-guest = %{version}-%{release}
+
+%description efi
+Xen hypervisor EFI binary, which can be booted directly from (U)EFI
+firmware without help from any additional bootloader.
+
+%description efi -l pl.UTF-8
+Nadzorca Xen w postaci, która może być uruchomiona wprost z firmware
+(U)EFI, bez potrzeby oddzielnego bootloadera.
+
%prep
%setup -q -a 16
%patch0 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
+%patch11 -p1
+%patch12 -p1
+%patch13 -p1
# stubdom sources
ln -s %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} stubdom
%{__make} -j1 dist-stubdom \
%{!?with_ocaml:OCAML_TOOLS=n} \
CC="%{__cc}" \
- CXX="%{__cxx}"
+ CXX="%{__cxx}" \
+ V=1
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/etc/{xen/examples,modules-load.d,logrotate.d} \
- $RPM_BUILD_ROOT{/usr/lib/tmpfiles.d,%{systemdunitdir},/var/log/xen/console}
+ $RPM_BUILD_ROOT{%{systemdtmpfilesdir},%{systemdunitdir},/var/log/xen/console}
%{__make} -j1 install-xen install-tools install-stubdom install-docs \
%{!?with_ocaml:OCAML_TOOLS=n} \
install %{SOURCE35} $RPM_BUILD_ROOT/etc/sysconfig/xenconsoled
install %{SOURCE36} $RPM_BUILD_ROOT%{systemdunitdir}/xenstored.service
install %{SOURCE37} $RPM_BUILD_ROOT/etc/sysconfig/xenstored
-install %{SOURCE38} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/xenstored.conf
+install %{SOURCE38} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/xenstored.conf
install %{SOURCE39} $RPM_BUILD_ROOT%{systemdunitdir}/xend.service
-install %{SOURCE40} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/xend.conf
+install %{SOURCE40} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/xend.conf
install %{SOURCE41} $RPM_BUILD_ROOT%{systemdunitdir}/xen-watchdog.service
install %{SOURCE42} $RPM_BUILD_ROOT/etc/modules-load.d/xen-dom0.conf
# sysvinit scripts
install %{SOURCE53} $RPM_BUILD_ROOT/etc/rc.d/init.d/xen-watchdog
install %{SOURCE54} $RPM_BUILD_ROOT/etc/rc.d/init.d/xendomains
install %{SOURCE55} $RPM_BUILD_ROOT/etc/logrotate.d/xen
+install %{SOURCE56} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/xen.conf
mv $RPM_BUILD_ROOT/etc/xen/{x{m,l}example*,examples}
%{_sharedstatedir}/xenstored
%dir /var/run/xenstored
%{systemdtmpfilesdir}/xenstored.conf
+%{systemdtmpfilesdir}/xen.conf
%dir %attr(0700,root,root) /var/log/xen
%dir %attr(0700,root,root) /var/log/xen/console
%{_datadir}/qemu-xen
%files -n bash-completion-%{name}
%defattr(644,root,root,755)
/etc/bash_completion.d/xl.sh
+
+%if %{with efi}
+%files efi
+%defattr(644,root,root,755)
+%dir %{_libdir}/efi
+%{_libdir}/efi/*.efi
+%endif