# - most of the qemu config options aren't detected (curses, NPTL, vde, fdt)
# - package the ocaml stuff
#
+#
+# Conditional build:
+%bcond_with ocaml # build Ocaml libraries for Xen tools
+#
%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.1.2
-Release: 0.1
+Release: 2
License: GPL
Group: Applications/System
Source0: http://bits.xensource.com/oss-xen/release/%{version}/%{name}-%{version}.tar.gz
Patch11: xen-dumpdir.patch
Patch12: xen-net-disable-iptables-on-bridge.patch
Patch13: xen-configure-xend.patch
+Patch14: xen-initscript.patch
# stubdom patch
Patch100: grub-ext4-support.patch
URL: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html
BuildRequires: latex2html
BuildRequires: libidn-devel
BuildRequires: ncurses-devel
+%if %{with ocaml}
+BuildRequires: ocaml >= 3.04-7
+BuildRequires: ocaml-findlib
+%requires_eq ocaml-runtime
+%endif
BuildRequires: pciutils-devel
BuildRequires: pkgconfig
BuildRequires: python-devel
BuildRequires: rpm-pythonprov
-BuildRequires: rpmbuild(macros) >= 1.268
+BuildRequires: rpmbuild(macros) >= 1.647
#BuildRequires: texlive-dvips
#BuildRequires: texlive-latex-data
BuildRequires: texlive-latex-psnfss
Requires: python-%{name} = %{version}-%{release}
Requires: rc-scripts
Requires: sed
+Requires: systemd-units >= 38
Requires: util-linux
Requires: which
Obsoletes: xen-doc
Summary: xend daemon
Summary(pl.UTF-8): Demon xend
Group: Daemons
+Requires: systemd-units >= 38
%description xend
xend daemon.
%patch11 -p1
%patch12 -p1
%patch13 -p1
+%patch14 -p1
%{__rm} -v tools/check/*.orig
export CXXFLAGS="%{rpmcflags} -I/usr/include/ncurses"
%{__make} dist-xen dist-tools dist-docs \
+ %{!?with_ocaml:OCAML_TOOLS=n} \
prefix=%{_prefix} \
CC="%{__cc}" \
CXX="%{__cxx}"
unset CFLAGS
unset CXXFLAGS
%{__make} -j1 dist-stubdom \
+ %{!?with_ocaml:OCAML_TOOLS=n} \
CC="%{__cc}" \
CXX="%{__cxx}"
%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}}
+ $RPM_BUILD_ROOT{/usr/lib/tmpfiles.d,%{systemdunitdir},/var/log/xen/console}
%{__make} -j1 install-xen install-tools install-stubdom install-docs \
+ %{!?with_ocaml:OCAML_TOOLS=n} \
prefix=%{_prefix} \
DESTDIR=$RPM_BUILD_ROOT
install %{SOURCE30} $RPM_BUILD_ROOT%{systemdunitdir}/proc-xen.mount
install %{SOURCE31} $RPM_BUILD_ROOT%{systemdunitdir}/var-lib-xenstored.mount
-# started internally by xend
-#install %{SOURCE32} $RPM_BUILD_ROOT%{systemdunitdir}/blktapctrl.service
-#install %{SOURCE33} $RPM_BUILD_ROOT/etc/sysconfig/blktapctrl
+install %{SOURCE32} $RPM_BUILD_ROOT%{systemdunitdir}/blktapctrl.service
+install %{SOURCE33} $RPM_BUILD_ROOT/etc/sysconfig/blktapctrl
install %{SOURCE34} $RPM_BUILD_ROOT%{systemdunitdir}/xenconsoled.service
install %{SOURCE35} $RPM_BUILD_ROOT/etc/sysconfig/xenconsoled
install %{SOURCE36} $RPM_BUILD_ROOT%{systemdunitdir}/xenstored.service
/sbin/chkconfig --add xenconsoled
/sbin/chkconfig --add xenstored
/sbin/chkconfig --add xendomains
+%systemd_post xen-watchdog.service xenconsoled.service xenstored.service
%preun
if [ "$1" = "0" ]; then
%service xen-watchdog stop
/sbin/chkconfig --del xen-watchdog
fi
+%systemd_preun xen-watchdog.service xenconsoled.service xenstored.service
-%post xend
+%postun
+%systemd_reload
+
+%post xend
/sbin/chkconfig --add xend
+%systemd_post xend.service
%preun xend
if [ "$1" = "0" ]; then
%service xend stop
/sbin/chkconfig --del xend
fi
+%systemd_preun xend.service
+
+%postun xend
+%systemd_reload
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/xen/README*
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/xen/cpupool
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/xen/xl.conf
-%config(noreplace) %verify(not md5 mtime size) /etc/udev/*
+%config(noreplace) %verify(not md5 mtime size) /etc/udev/xen-backend.rules
%attr(755,root,root) %{_bindir}/*
%attr(755,root,root) %{_sbindir}/[bfgikloqtv]*
%attr(755,root,root) %{_sbindir}/xen??*
%dir %{_prefix}/lib/%{name}/boot
%{_prefix}/lib/%{name}/boot/ioemu-stubdom.gz
%{_prefix}/lib/%{name}/boot/pv-grub-x86_32.gz
+%ifarch %{x8664}
%{_prefix}/lib/%{name}/boot/pv-grub-x86_64.gz
+%endif
%attr(744,root,root) %{_prefix}/lib/%{name}/boot/hvmloader
%{_datadir}/xen
%{_mandir}/man?/*
%{_sharedstatedir}/xenstored
%dir /var/run/xenstored
%{systemdtmpfilesdir}/xenstored.conf
+%dir %attr(0700,root,root) /var/log/xen
+%dir %attr(0700,root,root) /var/log/xen/console
%files libs
%defattr(644,root,root,755)
%files xend
%defattr(644,root,root,755)
-#%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/blktapctrl
-#%{systemdunitdir}/blktapctrl.service
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/blktapctrl
+%{systemdunitdir}/blktapctrl.service
%{systemdunitdir}/xend.service
%attr(754,root,root) %{_sysconfdir}/rc.d/init.d/xend
+%config(noreplace) %verify(not md5 mtime size) /etc/udev/xend.rules
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/xen/xm*
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/xen/xend*
%attr(755,root,root) %{_sbindir}/xend