File xen.spec of Package xen

# norootforbuild
%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_without xen_ovmf
%bcond_without 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-staging
%if %{with xen_docs}
BuildRequires: xen-buildreq-docs
%endif
%if %{with xen_ovmf}
BuildRequires: xen-buildreq-ovmf
%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 414be7b66349e7dca42bc1fd47c2b2f5b2d27432
%define xen_revision_short 414be7b663
%define xen_date_unix 1610475422
%define xen_date_commit 2021-01-12 18:17:02 +0000

%define qemu_xen_trad_revision_full 3d273dd05e51e5a1ffba3d98c7437ee84e8f8764
%define qemu_xen_trad_revision_short 3d273dd0
%define qemu_xen_trad_date_unix 1597762479
%define qemu_xen_trad_date_commit 2020-08-18 15:54:39 +0100

%define qemu_xen_revision_full 7ea428895af2840d85c524f0bd11a38aac308308
%define qemu_xen_revision_short 7ea428895a
%define qemu_xen_date_unix 1604676618
%define qemu_xen_date_commit 2020-11-06 15:30:18 +0000

%define keycodemapdb_revision_full 6b3d716e2b6472eb7189d3220552280ef3d832ce
%define keycodemapdb_revision_short 6b3d716
%define keycodemapdb_date_unix 1515765463
%define keycodemapdb_date_commit 2018-01-12 13:57:43 +0000

%define seabios_revision_full 155821a1990b6de78dde5f98fa5ab90e802021e0
%define seabios_revision_short 155821a1
%define seabios_date_unix 1597071187
%define seabios_date_commit 2020-08-10 10:53:07 -0400

%define minios_revision_full 051b87bb9c19609976fb038f386920e1ce5454c5
%define minios_revision_short 051b87b
%define minios_date_unix 1597658122
%define minios_date_commit 2020-08-17 09:55:22 +0000

%define ovmf_revision_full a3741780fe3535e19e02efa869a7cac481891129
%define ovmf_revision_short a3741780fe
%define ovmf_date_unix 1596826381
%define ovmf_date_commit 2020-08-07 18:53:01 +0000

%define ipxe_revision_full 988d2c13cdf0f0b4140685af35ced70ac5b3283c
%define ipxe_revision_short 988d2c13
%define ipxe_date_unix 1609448590
%define ipxe_date_commit 2020-12-31 21:03:10 +0000

Patch1437469260: xen.stubdom-fix-errors-in-newlib-cygmon-gmon.c.patch
Patch1437469443: xen.stubdom-fix-errors-in-newlib-makedoc.patch
Patch1525725200: xen.pvgrub-disable.patch
Patch1525725468: xen.build-compare-doc_html.patch
Patch1607528400: xen.bitmap-long.patch
Patch1592374429: xen.tpm_version.patch
Patch1603197568: xen.xl-bash_completion.patch
Patch1569318098: xen.xl-create-stale.patch
Patch1561108036: xen.xl-XEN_CONFIG_DIR.patch
Patch1570035937: xen.xl-scriptdir.patch
Patch1561106218: xen.xl-XEN_SCRIPT_DIR.patch
Patch1599642777: xen.xl-timestamps.patch
Patch1603987219: xen.xl-migration-debug.patch
Patch1603883256: xen.sr-readv_exact.patch
Patch1603884078: xen.sr-add-xc_is_known_page_type.patch
Patch1603891790: xen.sr-use-xc_is_known_page_type.patch
Patch1603894717: xen.sr-page_type_has_stream_data.patch
Patch1603460399: xen.sr-save-show_transfer_rate.patch
Patch1603443929: xen.sr-arrays.patch
Patch1603444488: xen.sr-batch_pfns.patch
Patch1603444836: xen.sr-save-mfns.patch
Patch1603445031: xen.sr-save-types.patch
Patch1603445165: xen.sr-save-errors.patch
Patch1603445441: xen.sr-save-iov.patch
Patch1603445640: xen.sr-save-rec_pfns.patch
Patch1603446045: xen.sr-save-guest_data.patch
Patch1603450076: xen.sr-save-local_pages.patch
Patch1603456605: xen.sr-restore-pfns.patch
Patch1603456771: xen.sr-restore-types.patch
Patch1603456939: xen.sr-restore-mfns.patch
Patch1603457049: xen.sr-restore-map_errs.patch
Patch1603457652: xen.sr-restore-populate_pfns-mfns.patch
Patch1603457933: xen.sr-restore-populate_pfns-pfns.patch
Patch1603711157: xen.sr-restore-read_record.patch
Patch1603822910: xen.sr-restore-handle_buffered_page_data.patch
Patch1603984390: xen.sr-restore-handle_incoming_page_data.patch
Patch1610117410: xen.sr-libxl_save_msgs_gen.patch
Patch1610030034: xen.sr-LIBXL_API_VERSION.patch
Patch1610031510: xen.sr-LIBXL_HAVE_DOMAIN_SUSPEND_PROPS.patch
Patch1610122707: xen.sr-precopy_stats.patch
Patch1610126389: xen.sr-precopy_policy.patch
Patch1610188337: xen.sr-max_iters.patch
Patch1610044768: xen.sr-min_remaining.patch
Patch1610047528: xen.sr-abort_if_busy.patch
Source0: %{name}-%{version}.tar
#KEEP NOSOURCE DEBUGINFO
NoSource: 0
%if %suse_version > 1110
BuildRequires: python > 3.0
%endif
%define qemu_xen_trad_version 3d273dd05e51e5a1ffba3d98c7437ee84e8f8764
Source1: qemu_xen_trad-%{qemu_xen_trad_version}.tar
#KEEP NOSOURCE DEBUGINFO
NoSource: 1
%define qemu_xen_version 7ea428895af2840d85c524f0bd11a38aac308308
Source2: qemu_xen-%{qemu_xen_version}.tar
#KEEP NOSOURCE DEBUGINFO
NoSource: 2
Patch1519206414: keycodemapdb.16e5b0787687d8904dad2c026107409eb9bfcb95.patch
%define keycodemapdb_version 6b3d716e2b6472eb7189d3220552280ef3d832ce
Source3: keycodemapdb-%{keycodemapdb_version}.tar
#KEEP NOSOURCE DEBUGINFO
NoSource: 3
%define btestfloat3_version 5a59dcec19327396a011a17fd924aed4fec416b3
Source4: btestfloat3-%{btestfloat3_version}.tar
#KEEP NOSOURCE DEBUGINFO
NoSource: 4
%define bsoftfloat3_version b64af41c3276f97f0e181920400ee056b9c88037
Source5: bsoftfloat3-%{bsoftfloat3_version}.tar
#KEEP NOSOURCE DEBUGINFO
NoSource: 5
%define seabios_version 155821a1990b6de78dde5f98fa5ab90e802021e0
Source6: seabios-%{seabios_version}.tar
#KEEP NOSOURCE DEBUGINFO
NoSource: 6
%define minios_version 051b87bb9c19609976fb038f386920e1ce5454c5
Source7: minios-%{minios_version}.tar
#KEEP NOSOURCE DEBUGINFO
NoSource: 7
%define ovmf_version a3741780fe3535e19e02efa869a7cac481891129
Source8: ovmf-%{ovmf_version}.tar
#KEEP NOSOURCE DEBUGINFO
NoSource: 8
%define openssl_version e2e09d9fba1187f8d6aafaa34d4172f56f1ffb72
Source9: openssl-%{openssl_version}.tar
#KEEP NOSOURCE DEBUGINFO
NoSource: 9
%define brotli_version 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
Source10: brotli-%{brotli_version}.tar
#KEEP NOSOURCE DEBUGINFO
NoSource: 10
%define brotli_version 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
Source11: brotli-%{brotli_version}.tar
#KEEP NOSOURCE DEBUGINFO
NoSource: 11
%define brotli_version 666c3280cc11dc433c303d79a83d4ffbdd12cc8d
Source12: brotli-%{brotli_version}.tar
#KEEP NOSOURCE DEBUGINFO
NoSource: 12
Patch1484818598: ipxe.stable-build-id.patch
%define ipxe_version 988d2c13cdf0f0b4140685af35ced70ac5b3283c
Source13: ipxe-%{ipxe_version}.tar
#KEEP NOSOURCE DEBUGINFO
NoSource: 13
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define pyver %(python3 -c "import sys; print(sys.version[:3])")

%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:       iproute2
Requires:       multipath-tools
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}

%description devel

%prep
%setup -q
pushd '.'
%patch1437469260 -p1
%patch1437469443 -p1
%patch1525725200 -p1
%patch1525725468 -p1
%patch1607528400 -p1
%patch1592374429 -p1
%patch1603197568 -p1
%patch1569318098 -p1
%patch1561108036 -p1
%patch1570035937 -p1
%patch1561106218 -p1
%patch1599642777 -p1
%patch1603987219 -p1
%patch1603883256 -p1
%patch1603884078 -p1
%patch1603891790 -p1
%patch1603894717 -p1
%patch1603460399 -p1
%patch1603443929 -p1
%patch1603444488 -p1
%patch1603444836 -p1
%patch1603445031 -p1
%patch1603445165 -p1
%patch1603445441 -p1
%patch1603445640 -p1
%patch1603446045 -p1
%patch1603450076 -p1
%patch1603456605 -p1
%patch1603456771 -p1
%patch1603456939 -p1
%patch1603457049 -p1
%patch1603457652 -p1
%patch1603457933 -p1
%patch1603711157 -p1
%patch1603822910 -p1
%patch1603984390 -p1
%patch1610117410 -p1
%patch1610030034 -p1
%patch1610031510 -p1
%patch1610122707 -p1
%patch1610126389 -p1
%patch1610188337 -p1
%patch1610044768 -p1
%patch1610047528 -p1
popd

rm -rf './tools/qemu-xen-traditional-dir-remote'
tar xfa %{SOURCE1}
mkdir -vp './tools'
mv -v 'qemu_xen_trad-%{qemu_xen_trad_version}' './tools/qemu-xen-traditional-dir-remote'

rm -rf './tools/qemu-xen-dir-remote'
tar xfa %{SOURCE2}
mkdir -vp './tools'
mv -v 'qemu_xen-%{qemu_xen_version}' './tools/qemu-xen-dir-remote'

rm -rf './tools/qemu-xen-dir-remote/ui/keycodemapdb'
tar xfa %{SOURCE3}
mkdir -vp './tools/qemu-xen-dir-remote/ui'
mv -v 'keycodemapdb-%{keycodemapdb_version}' './tools/qemu-xen-dir-remote/ui/keycodemapdb'
pushd './tools/qemu-xen-dir-remote/ui/keycodemapdb'
%patch1519206414 -p1
popd

rm -rf './tools/qemu-xen-dir-remote/tests/fp/berkeley-testfloat-3'
tar xfa %{SOURCE4}
mkdir -vp './tools/qemu-xen-dir-remote/tests/fp'
mv -v 'btestfloat3-%{btestfloat3_version}' './tools/qemu-xen-dir-remote/tests/fp/berkeley-testfloat-3'

rm -rf './tools/qemu-xen-dir-remote/tests/fp/berkeley-softfloat-3'
tar xfa %{SOURCE5}
mkdir -vp './tools/qemu-xen-dir-remote/tests/fp'
mv -v 'bsoftfloat3-%{bsoftfloat3_version}' './tools/qemu-xen-dir-remote/tests/fp/berkeley-softfloat-3'

rm -rf './tools/firmware/seabios-dir-remote'
tar xfa %{SOURCE6}
mkdir -vp './tools/firmware'
mv -v 'seabios-%{seabios_version}' './tools/firmware/seabios-dir-remote'
pushd './tools/firmware/seabios-dir-remote'
popd

rm -rf './extras/mini-os-remote'
tar xfa %{SOURCE7}
mkdir -vp './extras'
mv -v 'minios-%{minios_version}' './extras/mini-os-remote'

rm -rf './tools/firmware/ovmf-dir-remote'
tar xfa %{SOURCE8}
mkdir -vp './tools/firmware'
mv -v 'ovmf-%{ovmf_version}' './tools/firmware/ovmf-dir-remote'
pushd './tools/firmware/ovmf-dir-remote'
popd

rm -rf './tools/firmware/ovmf-dir-remote/CryptoPkg/Library/OpensslLib/openssl'
tar xfa %{SOURCE9}
mkdir -vp './tools/firmware/ovmf-dir-remote/CryptoPkg/Library/OpensslLib'
mv -v 'openssl-%{openssl_version}' './tools/firmware/ovmf-dir-remote/CryptoPkg/Library/OpensslLib/openssl'

rm -rf './tools/firmware/ovmf-dir-remote/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli'
tar xfa %{SOURCE10}
mkdir -vp './tools/firmware/ovmf-dir-remote/MdeModulePkg/Library/BrotliCustomDecompressLib'
mv -v 'brotli-%{brotli_version}' './tools/firmware/ovmf-dir-remote/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli'

rm -rf './tools/firmware/ovmf-dir-remote/BaseTools/Source/C/BrotliCompress/brotli'
tar xfa %{SOURCE11}
mkdir -vp './tools/firmware/ovmf-dir-remote/BaseTools/Source/C/BrotliCompress'
mv -v 'brotli-%{brotli_version}' './tools/firmware/ovmf-dir-remote/BaseTools/Source/C/BrotliCompress/brotli'

rm -rf './tools/firmware/ovmf-dir-remote/BaseTools/Source/C/BrotliCompress/brotli'
tar xfa %{SOURCE12}
mkdir -vp './tools/firmware/ovmf-dir-remote/BaseTools/Source/C/BrotliCompress'
mv -v 'brotli-%{brotli_version}' './tools/firmware/ovmf-dir-remote/BaseTools/Source/C/BrotliCompress/brotli'

rm -rf './tools/firmware/etherboot/ipxe'
tar xfa %{SOURCE13}
mkdir -vp './tools/firmware/etherboot'
mv -v 'ipxe-%{ipxe_version}' './tools/firmware/etherboot/ipxe'
pushd './tools/firmware/etherboot/ipxe'
%patch1484818598 -p1
popd

%build
used_python='python3'
%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}/xenfsimage/
%{_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/bin/vchan-socket-proxy
%ifarch  %ix86 x86_64
/usr/bin/xen-cpuid
%endif
/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
/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
%config /lib/modprobe.d/xen_loop.conf
%dir /lib/modprobe.d
%dir %{_defaultdocdir}/%{name}
%{_defaultdocdir}/%{name}/misc
%dir %{_libdir}/python%{pyver}/site-packages/xen
%dir %{_libdir}/python%{pyver}/site-packages/grub
%if %{with xen_qemu_trad}
%ifarch  %ix86 x86_64
%{_datadir}/xen
%endif
%endif
%{_datadir}/bash-completion
%{_datadir}/qemu-xen
%{_libdir}/python%{pyver}/site-packages/*.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/*
%{_libdir}/pkgconfig

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