File xen.spec of Package xen

# norootforbuild
%define python_basename_xen   python2
%define python_basename_qemuu python2
%define _lto_cflags %{nil}
%if ! %{defined _fillupdir}
  %define _fillupdir /var/adm/fillup-templates
%endif
Name:           xen
Version:        0
Release:        0
ExclusiveArch:  %ix86 x86_64 %arm aarch64
#
%define with_hypervisor 0
#
%define xen_install_suffix %{nil}
%ifarch x86_64
%define xen_install_suffix .gz
%endif
#
%ifarch x86_64
%define with_hypervisor 1
%else
%endif
#
%bcond_without fdupes
%bcond_without xen_docs
%bcond_without xen_qemu_trad
%bcond_with    xen_stubdom
%bcond_without xen_systemd
Requires(pre): %fillup_prereq
%if %{without xen_systemd}
Requires(pre): %insserv_prereq
%else
%systemd_requires
%endif
#
BuildRequires: xen-buildreq-qemu-xen
BuildRequires: xen-buildreq-tools-4.5
%if %{with xen_docs}
BuildRequires: xen-buildreq-docs
%endif
%if %{with xen_stubdom}
BuildRequires: xen-buildreq-stubdom
%endif
%if %{with xen_qemu_trad}
BuildRequires: xen-buildreq-qemu-xen-trad
%endif

License:        GPL-2.0+
Group:          System/Kernel
Summary:        Xen Hypervisor
Source1000:     stubdom.tar.xz
##
Url:            https://www.xenproject.org/
%define xen_revision_full 62cc20d4cb872e9db0ba6da3fb32817c410e7a8a
%define xen_revision_short 62cc20d4cb
%define xen_date_unix 1513088010
%define xen_date_commit 2017-12-12 15:13:30 +0100

%define qemu_xen_trad_revision_full ccdb305038126996646cfc6fedcaebb1fee4f19b
%define qemu_xen_trad_revision_short ccdb3050
%define qemu_xen_trad_date_unix 1490121795
%define qemu_xen_trad_date_commit 2017-03-21 18:43:15 +0000

%define qemu_xen_revision_full 835c204f1196ab8f5213a9dc5299ed76e748cdca
%define qemu_xen_revision_short 835c204f11
%define qemu_xen_date_unix 1469641805
%define qemu_xen_date_commit 2016-07-27 10:50:05 -0700

%define seabios_revision_full 33fbe13a3e2a01e0ba1087a8feed801a0451db21
%define seabios_revision_short 33fbe13a
%define seabios_date_unix 1434441630
%define seabios_date_commit 2015-06-16 10:00:30 +0200

%define ipxe_revision_full 390bce9516ce3a4adf599762b6c965813332595e
%define ipxe_revision_short 390bce95
%define ipxe_date_unix 1710861239
%define ipxe_date_commit 2024-03-19 15:13:59 +0000

Patch1420625390: xen.ac977f542b92790f87edabbb9b16b4c52a85ed98.patch
Patch1422963936: xen.cb8366d34ef5021af761ca1977d9cb305ba8fabd.patch
Patch1435311688: xen.1f627301e66ac62053ee246367a1b576cbded052.patch
Patch1440445738: xen.6596412d59bcde3d1a2473f341851f4c476fc9df.patch
Patch1455621500: xen.b021beb21a977a89b763db7b7df7c362cf8640a8.patch
Patch1464972609: xen.b9daff9d811285f1e40669bc621c2241793f7a95.patch
Patch1464972610: xen.c2a17869d5dcd845d646bf4db122cad73596a2be.patch
Patch1470154244: xen.976ce01e103fc03bb3336cdbc6c951a709e285fe.patch
Patch1476103858: xen.7f54219572caced98a133072546ad890897b9827.patch
Patch1478769811: xen.9fdffbbab3ada427bac07076f042f0265e5ae05f.patch
Patch1482263220: xen.74858c9eaf335658b4c19cb4a848bb721065c233.patch
Patch1489561294: xen.796dea37fb229c34740f98bf80f3263d7a4e3c6d.patch
Patch1491327119: xen.f49fa658b53580cf2ad354d2bf1796766cc11222.patch
Patch1493192925: xen.144aec4140515c53bb1676df71a469f3e285c557.patch
Patch1497009491: xen.7a46badcf4eaa337070a6e7dda61698fd5a32cb3.patch
Patch1497402708: xen.2d78f78a14528752266982473c07118f1bc336e3.patch
Patch1498481707: xen.672949d6c61d9cba01c5b414eed9d522082f04d3.patch
Patch1498584943: xen.bda2696f29ad5af6dea0d3edad180a58dde6984a.patch
Patch1522893049: xen.fa7789ef18bd2e716997937af71b2e4b5b00a159.patch
Patch1522893050: xen.27751d89248c8c5eef6d8b56eb8f7d2084145080.patch
Patch1522893051: xen.3a633c261426f06627d88bf7feca6ff87f692f16.patch
Patch1522893052: xen.850e89b3ef1a7be6b71fa7ae22333c884e08431a.patch
Patch1522893053: xen.938c8f53b1f80175c6f7a1399efdb984abb0cb8b.patch
Patch1522893054: xen.7f601f7c341c80d554615556d60e3b8ed1e5ad4f.patch
Patch1522893055: xen.437e00fea04becc91c1b6bc1c0baa636b067a5cc.patch
Patch1527018465: xen.2de2b10b2252761baa5dd0077df384dbfcca8212.patch
Patch1531155946: xen.00d21a3c3c7f742e674458b70553a22eae289fdf.patch
Patch1531952537: xen.2b50cdbc444c637575580dcfa6c9525a84d5cc62.patch
Patch1535464598: xen.9df4c648d79f32946b65d5795c172a91d7d71cfe.patch
Patch1557733883: xen.3fd3b266d4198c06e8e421ca515d9ba09ccd5155.patch
Patch1558685999: xen.ca9310b24e6205de5387e5982ccd42c35caf89d4.patch
Patch1570035936: xen.55ab292c42db41b05cfdba012680bf1e0ea02f7a.patch
Patch1592503911: xen.f1d376a825f4878eab0ef9cabe50ec4299968629.patch
Patch1603197568: xen.bb9afb7a465d3b7b438f2e11105409d24400f8f4.patch
Patch1614872871: xen.c6ad5a701b9a6df443a6c98d9e7201c958bbcafc.patch
Patch1620136734: xen.74a8d446f7dc1f18174f48597d7ebb04a634a120.patch
Patch1682506316: xen.860fb990bd208f590b78d938ba874e867e1c2986.patch
Patch1682506359: xen.dde20f7dc182fdfeeb6c55648979326bb982ca8c.patch
Patch1463149270: xen.mini-os-1a3ee6eeca136525aa2e6917ae500e7cf731c09d.patch
Patch1495802465: xen.tools-firmware-pass-BUILD_VERSION-to-seabios-build.patch
Patch1525725200: xen.pvgrub-disable.patch
Patch1525725468: xen.build-compare-doc_html.patch
Patch1527086005: xen.debug_symbols-for-xen.patch
Patch1528300187: xen.cmake-GLOB.patch
Patch1615455025: xen.SEABIOS_CPP.patch
%if %suse_version > 1110
BuildRequires: python(abi) > 3.0
%endif
%define qemu_xen_trad_version ccdb305038126996646cfc6fedcaebb1fee4f19b
Patch1607958578: qemu_xen.bbd2d5a8120771ec59b86a80a1f51884e0a26e53.patch
%define qemu_xen_version 835c204f1196ab8f5213a9dc5299ed76e748cdca
Patch1432052479: seabios.3752bf44be8931f86523ed538555b170a52d09dc.patch
Patch1433197926: seabios.be050664fdd1699fe7bcf3a9b6faff07172a83d6.patch
Patch1477411781: seabios.99e3316d5970dbcdac8ce7bb0f89f0986d01c0ce.patch
Patch1531663514: seabios.8c3f57ea1217ea0c80a72898bc35baa0e14af0e0.patch
Patch1595431900: seabios.699a4e5d6919cc8eae5342443025ceb6909dc276.patch
Patch1621549128: seabios.6eff8085980dba0938cea0193b8a0fd3c6b0c4ca.patch
Patch1426804471: seabios.128kb.patch
%define seabios_version 33fbe13a3e2a01e0ba1087a8feed801a0451db21
Patch1484818598: ipxe.stable-build-id.patch
%define ipxe_version 390bce9516ce3a4adf599762b6c965813332595e
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Xen is a virtual machine monitor for x86 that supports execution of
multiple guest operating systems with unprecedented levels of
performance and resource isolation.

This package contains the Xen Hypervisor. (tm)

%package libs
Summary:        Xen Virtualization: Libraries
Group:          System/Kernel
%if 0%{with_hypervisor}
Requires:       %{name} = %{version}-%{release}
%endif

%description libs

%package tools
Summary:        Xen Virtualization: Control tools for domain 0
Group:          System/Kernel
Requires:       %{name}-libs = %{version}-%{release}
Requires:       bridge-utils
Requires:       multipath-tools
Requires:       python
Requires:       python-curses
Provides:       xen-doc-html = %{version}-%{release}
Obsoletes:      xen-doc-html

%description tools

%ifarch  %ix86 x86_64
%package tools-domU
Summary:        Xen Virtualization: Control tools for domain U
Group:          System/Kernel
Requires:       %{name}-libs = %{version}-%{release}
Conflicts:      %{name}-tools

%description tools-domU
%endif

%package devel
Summary:        Xen Virtualization: Headers and libraries for development
Group:          System/Kernel
Requires:       %{name}-libs = %{version}-%{release}
Requires:       pkgconfig(uuid)

%description devel

%prep
rm -rf %_builddir/%name-%version
mv %_sourcedir/%name-%version %_builddir/%name-%version
%setup -c -T -D
pushd '.'
%patch -P 1420625390 -p1
%patch -P 1422963936 -p1
%patch -P 1435311688 -p1
%patch -P 1440445738 -p1
%patch -P 1455621500 -p1
%patch -P 1464972609 -p1
%patch -P 1464972610 -p1
%patch -P 1470154244 -p1
%patch -P 1476103858 -p1
%patch -P 1478769811 -p1
%patch -P 1482263220 -p1
%patch -P 1489561294 -p1
%patch -P 1491327119 -p1
%patch -P 1493192925 -p1
%patch -P 1497009491 -p1
%patch -P 1497402708 -p1
%patch -P 1498481707 -p1
%patch -P 1498584943 -p1
%patch -P 1522893049 -p1
%patch -P 1522893050 -p1
%patch -P 1522893051 -p1
%patch -P 1522893052 -p1
%patch -P 1522893053 -p1
%patch -P 1522893054 -p1
%patch -P 1522893055 -p1
%patch -P 1527018465 -p1
%patch -P 1531155946 -p1
%patch -P 1531952537 -p1
%patch -P 1535464598 -p1
%patch -P 1557733883 -p1
%patch -P 1558685999 -p1
%patch -P 1570035936 -p1
%patch -P 1592503911 -p1
%patch -P 1603197568 -p1
%patch -P 1614872871 -p1
%patch -P 1620136734 -p1
%patch -P 1682506316 -p1
%patch -P 1682506359 -p1
%patch -P 1463149270 -p1
%patch -P 1495802465 -p1
%patch -P 1525725200 -p1
%patch -P 1525725468 -p1
%patch -P 1527086005 -p1
%patch -P 1528300187 -p1
%patch -P 1615455025 -p1
popd

rm -rf './tools/qemu-xen-traditional-dir-remote'
mkdir -vp './tools'
mv -v '%_sourcedir/qemu_xen_trad-%qemu_xen_trad_version' './tools/qemu-xen-traditional-dir-remote'

rm -rf './tools/qemu-xen-dir-remote'
mkdir -vp './tools'
mv -v '%_sourcedir/qemu_xen-%qemu_xen_version' './tools/qemu-xen-dir-remote'
pushd './tools/qemu-xen-dir-remote'
%patch -P 1607958578 -p1
popd

rm -rf './tools/firmware/seabios-dir-remote'
mkdir -vp './tools/firmware'
mv -v '%_sourcedir/seabios-%seabios_version' './tools/firmware/seabios-dir-remote'
pushd './tools/firmware/seabios-dir-remote'
%patch -P 1432052479 -p1
%patch -P 1433197926 -p1
%patch -P 1477411781 -p1
%patch -P 1531663514 -p1
%patch -P 1595431900 -p1
%patch -P 1621549128 -p1
%patch -P 1426804471 -p1
popd

rm -rf './tools/firmware/etherboot/ipxe'
mkdir -vp './tools/firmware/etherboot'
mv -v '%_sourcedir/ipxe-%ipxe_version' './tools/firmware/etherboot/ipxe'
pushd './tools/firmware/etherboot/ipxe'
%patch -P 1484818598 -p1
popd

if pushd subprojects/packagefiles 2>/dev/null
then
  for prj in *
  do
    if pushd "${prj}" > /dev/null
    then
      for f in *
      do
        test -f "${f}" || continue
        ln -vt "../../${prj}/" *
        break
      done
      popd > /dev/null
    fi
  done
  popd > /dev/null
fi

%build
python_basename_xen='%{python_basename_xen}'
python_basename_qemuu='%{python_basename_qemuu}'
%include %{_datadir}/xen-buildreq/build.txt

%install
%include %{_datadir}/xen-buildreq/install.txt

%clean
: %buildroot preserved

%if 0%{with_hypervisor}
%files -f xen.files.txt
%defattr(-,root,root)
/boot/*
%endif

%files libs
%defattr(-,root,root)
%{_libdir}/fs/
%{_libdir}/*.so.*

%files tools -f xen-tools.python.files.txt
%defattr(-,root,root)
%if %{with xen_docs}
%{_defaultdocdir}/%{name}/html
%endif
/usr/bin/xen[!-]*
/usr/bin/p*
/usr/sbin/*
%{_libexecdir}/xen
%if %{with xen_docs}
%{_mandir}/man*/*.gz
%endif
%{_fillupdir}/*
%dir /var/lib/xen
%dir %attr(700,root,root) /var/lib/xen/images
%dir %attr(700,root,root) /var/lib/xen/save
%dir %attr(700,root,root) /var/lib/xen/dump
%ifarch  %ix86 x86_64
%dir %attr(700,root,root) /var/lib/xen/xenpaging
%endif
%dir /var/lib/xenstored
%dir %attr(700,root,root) /etc/xen
%config /etc/xen/*
%dir /var/log/xen
%if %{with xen_systemd}
%config %{_unitdir}/*
%else
%if %{?with_rc_d}0
%config /etc/rc.d
%endif
%config %{_initddir}/*
%endif
%dir /etc/udev
%dir /etc/udev/rules.d
%config /etc/udev/rules.d/*.rules
%dir %{_defaultdocdir}/%{name}
%{_defaultdocdir}/%{name}/misc
%dir %{_libdir}/python*/site-packages/xen
%dir %{_libdir}/python*/site-packages/grub
%if %{with xen_qemu_trad}
%ifarch  %ix86 x86_64
%{_datadir}/xen
%endif
%endif
%{_datadir}/bash-completion
%{_datadir}/qemu-xen
%{_libdir}/python*/site-packages/fsimage.so

%ifarch  %ix86 x86_64
%files tools-domU
%defattr(-,root,root)
/usr/bin/xen-detect
%endif

%files devel
%defattr(-,root,root)
%{_libdir}/*.a
%{_libdir}/*.so
/usr/include/*

%include %{_datadir}/xen-buildreq/scriptlets.txt
openSUSE Build Service is sponsored by