# - most of the qemu config options aren't detected (curses, NPTL, vde, fdt)
# - package the ocaml stuff
#
+#
# Conditional build:
-%bcond_without hvm # build with hvm (full virtualization) support
-
+%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
# Source14-md5: cd3f3eb54446be6003156158d51f4884
Source15: %{xen_extfiles_url}/ipxe-git-v1.0.0.tar.gz
# Source15-md5: fb7df96781d337899066d82059346885
+Source30: proc-xen.mount
+Source31: var-lib-xenstored.mount
+Source32: blktapctrl.service
+Source33: blktapctrl.sysconfig
+Source34: xenconsoled.service
+Source35: xenconsoled.sysconfig
+Source36: xenstored.service
+Source37: xenstored.sysconfig
+Source38: xenstored.tmpfiles
+Source39: xend.service
+Source40: xend.tmpfiles
+Source41: xen-watchdog.service
+Source42: xen-dom0-modules-load.conf
+# sysvinit scripts
+Source50: xend.init
+Source51: xenconsoled.init
+Source52: xenstored.init
+Source53: xen-watchdog.init
+Source54: xendomains.init
+Source55: xen.logrotate
Patch0: %{name}-python_scripts.patch
Patch1: %{name}-symbols.patch
Patch2: %{name}-curses.patch
-Patch3: %{name}-gcc.patch
-Patch4: %{name}-xz.patch
+Patch3: %{name}-xz.patch
+Patch4: pygrubfix.patch
+Patch5: pygrubfix2.patch
+Patch6: qemu-xen-4.1-testing.git-3cf61880403b4e484539596a95937cc066243388.patch
+Patch7: xen-4.1-testing.23190.patch
+Patch8: xend.catchbt.patch
+Patch9: xend.empty.xml.patch
+Patch10: xend-pci-loop.patch
+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: SDL-devel
BuildRequires: acpica
-%{?with_hvm:BuildRequires: bcc}
+BuildRequires: bcc
BuildRequires: curl-devel
BuildRequires: e2fsprogs-devel
BuildRequires: gcc >= 5:3.4
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
+Obsoletes: xen-udev
ExclusiveArch: %{ix86} %{x8664}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description static -l pl.UTF-8
Statyczne biblioteki xena.
-%package udev
-Summary: xen udev scripts
-Summary(pl.UTF-8): Skrypty udev dla xena
-Group: Applications/System
-
-%description udev
-xen udev scripts.
-
-%description udev -l pl.UTF-8
-Skrypty udev dla xena.
-
%package xend
Summary: xend daemon
Summary(pl.UTF-8): Demon xend
Group: Daemons
+Requires: systemd-units >= 38
%description xend
xend daemon.
%patch0 -p1
%patch1 -p1
%patch2 -p1
-#%%patch3 -p1
+%patch3 -p1
%patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
+%patch8 -p1
+%patch9 -p1
+%patch10 -p1
+%patch11 -p1
+%patch12 -p1
+%patch13 -p1
+%patch14 -p1
%{__rm} -v tools/check/*.orig
# stubdom sources
ln -s %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} stubdom
-ln -s %{PATCH23} stubdom/grub.patches/99grub-ext4-support.patch
+ln -s %{PATCH100} stubdom/grub.patches/99grub-ext4-support.patch
ln -s %{SOURCE15} tools/firmware/etherboot/ipxe.tar.gz
%build
-CFLAGS="%{rpmcflags} -I/usr/include/ncurses" \
-CXXFLAGS="%{rpmcflags} -I/usr/include/ncurses" \
-%{__make} -j1 xen tools \
+export CFLAGS="%{rpmcflags} -I/usr/include/ncurses"
+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
+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}
-%{__make} install-xen install-tools install-stubdom install-docs \
- CC="%{__cc}" \
- CXX="%{__cxx}" \
+%{__make} -j1 install-xen install-tools install-stubdom install-docs \
+ %{!?with_ocaml:OCAML_TOOLS=n} \
+ prefix=%{_prefix} \
DESTDIR=$RPM_BUILD_ROOT
+%if "%{_lib}" == "lib64"
+ln -s %{_prefix}/lib/%{name}/bin/qemu-dm $RPM_BUILD_ROOT%{_libdir}/%{name}/bin/qemu-dm
+%endif
+
+install %{SOURCE30} $RPM_BUILD_ROOT%{systemdunitdir}/proc-xen.mount
+install %{SOURCE31} $RPM_BUILD_ROOT%{systemdunitdir}/var-lib-xenstored.mount
+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
+install %{SOURCE37} $RPM_BUILD_ROOT/etc/sysconfig/xenstored
+install %{SOURCE38} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/xenstored.conf
+install %{SOURCE39} $RPM_BUILD_ROOT%{systemdunitdir}/xend.service
+install %{SOURCE40} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/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
+%{__rm} $RPM_BUILD_ROOT/etc/rc.d/init.d/*
+install %{SOURCE50} $RPM_BUILD_ROOT/etc/rc.d/init.d/xend
+install %{SOURCE51} $RPM_BUILD_ROOT/etc/rc.d/init.d/xenconsoled
+install %{SOURCE52} $RPM_BUILD_ROOT/etc/rc.d/init.d/xenstored
+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
+
mv $RPM_BUILD_ROOT/etc/xen/{xmexample*,examples}
cp -p tools/blktap/README{,.blktap}
%post
/sbin/chkconfig --add xen-watchdog
-/sbin/chkconfig --add xencommons
+/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 xendomains stop
/sbin/chkconfig --del xendomains
- %service xencommons stop
- /sbin/chkconfig --del xencommons
+ %service xenconsoled stop
+ /sbin/chkconfig --del xenconsoled
+
+ %service xenstored stop
+ /sbin/chkconfig --del xenstored
%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
/boot/%{name}-syms-%{version}
/boot/%{name}-%{version}.gz
/boot/%{name}.gz
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/xenconsoled
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/xenstored
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/xendomains
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/xen
%attr(754,root,root) /etc/rc.d/init.d/xen-watchdog
-%attr(754,root,root) /etc/rc.d/init.d/xencommons
+%attr(754,root,root) /etc/rc.d/init.d/xenconsoled
+%attr(754,root,root) /etc/rc.d/init.d/xenstored
%attr(754,root,root) /etc/rc.d/init.d/xendomains
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/*
+%config(noreplace) %verify(not md5 mtime size) /etc/modules-load.d/xen-dom0.conf
+%{systemdunitdir}/proc-xen.mount
+%{systemdunitdir}/var-lib-xenstored.mount
+%{systemdunitdir}/xen-watchdog.service
+%{systemdunitdir}/xenconsoled.service
+%{systemdunitdir}/xenstored.service
%dir %{_sysconfdir}/xen
%dir %{_sysconfdir}/xen/auto
%dir %{_sysconfdir}/xen/examples
%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/xen-backend.rules
%attr(755,root,root) %{_bindir}/*
%attr(755,root,root) %{_sbindir}/[bfgikloqtv]*
%attr(755,root,root) %{_sbindir}/xen??*
%attr(744,root,root) %{_libdir}/%{name}/bin/*
%if "%{_lib}" != "lib"
%dir %{_prefix}/lib/%{name}
+%dir %{_prefix}/lib/%{name}/bin
+%attr(755,root,root) %{_prefix}/lib/%{name}/bin/qemu-dm
+%attr(755,root,root) %{_prefix}/lib/%{name}/bin/stubdom-dm
+%attr(755,root,root) %{_prefix}/lib/%{name}/bin/stubdompath.sh
%endif
%dir %{_prefix}/lib/%{name}/boot
-%{?with_hvm:%attr(744,root,root) %{_prefix}/lib/%{name}/boot/hvmloader}
+%{_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}/xen
%{_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)
%defattr(644,root,root,755)
%{_libdir}/lib*.a
-%files udev
-%defattr(644,root,root,755)
-%config(noreplace) %verify(not md5 mtime size) /etc/udev/*
-
%files xend
%defattr(644,root,root,755)
+%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
%attr(755,root,root) %{_sbindir}/xm
%dir %attr(700,root,root) /var/run/xend
+%{systemdtmpfilesdir}/xend.conf
%files -n python-xen
%defattr(644,root,root,755)