xen/xen.spec
Charles Arnold 11035112e8 - Upstream patches from Jan
51d277a3-x86-don-t-pass-negative-time-to-gtime_to_gtsc-try-2.patch
  51d27807-iommu-amd-Fix-logic-for-clearing-the-IOMMU-interrupt-bits.patch
  51d27841-iommu-amd-Workaround-for-erratum-787.patch
  51daa074-Revert-hvmloader-always-include-HPET-table.patch 

- Dropped deprecated or unnecessary patches
  pvdrv-import-shared-info.patch 
  minios-fixups.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=258
2013-07-17 02:04:59 +00:00

1270 lines
42 KiB
RPMSpec

#
# spec file for package xen
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: xen
ExclusiveArch: %ix86 x86_64 %arm aarch64
%define xvers 4.3
%define xvermaj 4
%define changeset 27204
%define xen_build_dir xen-4.3.0-testing
%ifarch %arm aarch64
%define with_kmp 0
%define with_stubdom 0
%else
%define with_kmp 1
%define with_stubdom 1
%endif
# EFI requires gcc46 or newer
# its available in 12.1 or >= sles11sp2
%if %suse_version == 1210 || %suse_version == 1110
%define with_gcc46 1
%else
%define with_gcc46 0
%endif
%ifarch x86_64 %arm aarch64
%define with_dom0_support 1
%else
%define with_dom0_support 0
%endif
%define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
%if %suse_version >= 1230
%define with_xend 0
%else
%define with_xend 1
%endif
BuildRequires: LibVNCServer-devel
BuildRequires: SDL-devel
BuildRequires: automake
%ifnarch %arm aarch64
BuildRequires: bin86
%endif
BuildRequires: curl-devel
%ifnarch %arm aarch64
BuildRequires: dev86
%endif
BuildRequires: fdupes
BuildRequires: glib2-devel
BuildRequires: graphviz
BuildRequires: latex2html
BuildRequires: libaio-devel
BuildRequires: libbz2-devel
BuildRequires: libjpeg-devel
BuildRequires: libpixman-1-0-devel
BuildRequires: libuuid-devel
BuildRequires: libxml2-devel
BuildRequires: libyajl-devel
BuildRequires: ncurses-devel
BuildRequires: openssl
BuildRequires: openssl-devel
BuildRequires: pciutils-devel
BuildRequires: python-devel
BuildRequires: texinfo
BuildRequires: transfig
%if %suse_version >= 1120
BuildRequires: xz-devel
%endif
%if %suse_version <= 1110
BuildRequires: pmtools
%else
%ifnarch %arm aarch64
BuildRequires: acpica
%endif
%endif
%if %suse_version >= 1030
BuildRequires: texlive
BuildRequires: texlive-latex
%if %suse_version > 1220
BuildRequires: texlive-courier
BuildRequires: texlive-dvips
BuildRequires: texlive-helvetic
BuildRequires: texlive-psnfss
BuildRequires: texlive-times
BuildRequires: tex(a4.sty)
BuildRequires: tex(a4wide.sty)
BuildRequires: tex(fancyhdr.sty)
BuildRequires: tex(parskip.sty)
BuildRequires: tex(setspace.sty)
%endif
%else
BuildRequires: te_ams
BuildRequires: te_latex
BuildRequires: tetex
%endif
%ifarch x86_64
%if %{?with_gcc46}0
BuildRequires: gcc46
BuildRequires: libgcc46
BuildRequires: libgcc46-32bit
%endif
BuildRequires: gcc-32bit
BuildRequires: gcc43-32bit
BuildRequires: glibc-32bit
BuildRequires: glibc-devel-32bit
%define max_cpus 256
%define pae_enabled n
%else
%define max_cpus 32
%ifnarch %arm
%define pae_enabled y
%endif
%endif
BuildRequires: glibc-devel
%if %{?with_kmp}0
BuildRequires: kernel-source
BuildRequires: kernel-syms
BuildRequires: module-init-tools
%if %suse_version < 1220
BuildRequires: xorg-x11
%else
BuildRequires: lndir
%endif
%endif
Version: 4.3.0_07
Release: 0
PreReq: %insserv_prereq %fillup_prereq
Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel)
License: GPL-2.0+
Group: System/Kernel
Source0: xen-4.3.0-testing-src.tar.bz2
Source1: stubdom.tar.bz2
Source2: qemu-xen-traditional-dir-remote.tar.bz2
Source3: qemu-xen-dir-remote.tar.bz2
Source4: seabios-dir-remote.tar.bz2
Source5: ipxe.tar.bz2
Source6: xen-utils-0.1.tar.bz2
Source10: README.SuSE
Source11: boot.xen
Source12: boot.local.xenU
Source13: init.xend
Source14: init.xendomains
Source15: logrotate.conf
Source16: domUloader.py
Source17: xmexample.domUloader
Source18: xmexample.disks
Source19: block-nbd
Source20: block-iscsi
Source21: block-npiv-common.sh
Source22: block-npiv
Source23: block-npiv-vport
Source24: xmclone.sh
Source25: xend-relocation.sh
Source26: init.xen_loop
%if %{?with_kmp}0
Source27: xen_pvdrivers.conf
Source28: kmp_filelist
%endif
Source29: block-dmmd
# Xen API remote authentication sources
Source30: etc_pam.d_xen-api
Source31: xenapiusers
# sysconfig hook script for Xen
Source32: xen-updown.sh
# Firewall service file for xend relocation server
Source33: xend-relocation-server.fw
# init script and sysconf file for pciback
Source34: init.pciback
Source35: sysconfig.pciback
Source36: xnloader.py
Source99: baselibs.conf
# http://xenbits.xensource.com/ext/xenalyze
Source20000: xenalyze.hg.tar.bz2
# Upstream patches
Patch1: 51d277a3-x86-don-t-pass-negative-time-to-gtime_to_gtsc-try-2.patch
Patch2: 51d27807-iommu-amd-Fix-logic-for-clearing-the-IOMMU-interrupt-bits.patch
Patch3: 51d27841-iommu-amd-Workaround-for-erratum-787.patch
Patch4: 51daa074-Revert-hvmloader-always-include-HPET-table.patch
# Upstream qemu patches
# Our patches
Patch301: xen-destdir.patch
Patch302: xen-changeset.patch
Patch303: xen-xmexample.patch
Patch304: xen-xmexample-vti.patch
Patch310: bridge-opensuse.patch
Patch311: bridge-vlan.patch
Patch312: bridge-bonding.patch
Patch313: bridge-record-creation.patch
Patch314: vif-bridge-no-iptables.patch
Patch315: vif-bridge-tap-fix.patch
Patch320: network-nat-open-SuSEfirewall2-FORWARD.patch
Patch321: udev-rules.patch
Patch322: libxen_permissive.patch
Patch323: xenconsole-no-multiple-connections.patch
# Needs to go upstream
Patch330: xend-sysconfig.patch
Patch331: suspend_evtchn_lock.patch
Patch332: xenpaging.doc.patch
# Other bug fixes or features
Patch350: hibernate.patch
Patch351: stdvga-cache.patch
Patch352: ipxe-enable-nics.patch
Patch353: pygrub-netware-xnloader.patch
Patch360: blktapctrl-close-fifos.patch
Patch361: blktapctrl-default-to-ioemu.patch
Patch362: blktapctrl-disable-debug-printf.patch
Patch363: blktap-pv-cdrom.patch
# Hypervisor and PV driver Patches
Patch501: x86-ioapic-ack-default.patch
Patch502: x86-cpufreq-report.patch
Patch503: x86-dom-print.patch
Patch504: x86-extra-trap-info.patch
Patch520: supported_module.patch
Patch521: magic_ioport_compat.patch
Patch522: xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch
Patch523: disable_emulated_device.patch
# Legacy Xend and Qemu patches
Patch800: xend-traditional-qemu.patch
# Build patches
Patch99997: disable-wget-check.patch
Patch99998: tmp-initscript-modprobe.patch
Patch99999: tmp_build.patch
Url: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define pyver %(python -c "import sys; print sys.version[:3]")
%if %{?with_kmp}0
%suse_kernel_module_package -n xen um xen -f kmp_filelist
%endif
%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)
Modern computers are sufficiently powerful to use virtualization to
present the illusion of many smaller virtual machines (VMs), each
running a separate operating system instance. Successful partitioning
of a machine to support the concurrent execution of multiple operating
systems poses several challenges. Firstly, virtual machines must be
isolated from one another: It is not acceptable for the execution of
one to adversely affect the performance of another. This is
particularly true when virtual machines are owned by mutually
untrusting users. Secondly, it is necessary to support a variety of
different operating systems to accommodate the heterogeneity of popular
applications. Thirdly, the performance overhead introduced by
virtualization should be small.
Xen uses a technique called paravirtualization: The guest OS is
modified, mainly to enhance performance.
The Xen hypervisor (microkernel) does not provide device drivers for
your hardware (except for CPU and memory). This job is left to the
kernel that's running in domain 0. Thus the domain 0 kernel is
privileged; it has full hardware access. It's started immediately after
Xen starts up. Other domains have no access to the hardware; instead
they use virtual interfaces that are provided by Xen (with the help of
the domain 0 kernel).
Xen does support booting other Operating Systems; ports of NetBSD
(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich)
exist. A port of Windows XP was developed for an earlier version of
Xen, but is not available for release due to license restrictions.
In addition to this package you need to install the kernel-xen and
xen-tools to use Xen. Xen 3 also supports running unmodified guests
using full virtualization, if appropriate hardware is present. Install
xen-tools-ioemu if you want to use this.
[Hypervisor is a trademark of IBM]
Authors:
--------
Ian Pratt <ian.pratt@cl.cam.ac.uk>
Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Mark Williamson <mark.williamson@cl.cam.ac.uk>
Ewan Mellor <ewan@xensource.com>
...
%package libs
Summary: Xen Virtualization: Libraries
Group: System/Kernel
%description libs
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 libraries used to interact with the Xen
virtual machine monitor.
Modern computers are sufficiently powerful to use virtualization to
present the illusion of many smaller virtual machines (VMs), each
running a separate operating system instance. Successful partitioning
of a machine to support the concurrent execution of multiple operating
systems poses several challenges. Firstly, virtual machines must be
isolated from one another: It is not acceptable for the execution of
one to adversely affect the performance of another. This is
particularly true when virtual machines are owned by mutually
untrusting users. Secondly, it is necessary to support a variety of
different operating systems to accommodate the heterogeneity of popular
applications. Thirdly, the performance overhead introduced by
virtualization should be small.
Xen uses a technique called paravirtualization: The guest OS is
modified, mainly to enhance performance.
The Xen hypervisor (microkernel) does not provide device drivers for
your hardware (except for CPU and memory). This job is left to the
kernel that's running in domain 0. Thus the domain 0 kernel is
privileged; it has full hardware access. It's started immediately after
Xen starts up. Other domains have no access to the hardware; instead
they use virtual interfaces that are provided by Xen (with the help of
the domain 0 kernel).
Xen does support booting other Operating Systems; ports of NetBSD
(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich)
exist. A port of Windows XP was developed for an earlier version of
Xen, but is not available for release due to license restrictions.
Authors:
--------
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%if %{?with_dom0_support}0
%package tools
Summary: Xen Virtualization: Control tools for domain 0
Group: System/Kernel
Requires: bridge-utils
Requires: multipath-tools
Requires: python
Requires: python-curses
Requires: python-lxml
Requires: python-openssl
Requires: python-pam
Requires: python-xml
Requires: xen-libs = %{version}
# subpackage existed in 10.3
Provides: xen-tools-ioemu = %{version}
Obsoletes: xen-tools-ioemu < %{version}
Conflicts: libvirt < 1.0.5
%description tools
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 control tools that allow you to start, stop,
migrate, and manage virtual machines.
Modern computers are sufficiently powerful to use virtualization to
present the illusion of many smaller virtual machines (VMs), each
running a separate operating system instance. Successful partitioning
of a machine to support the concurrent execution of multiple operating
systems poses several challenges. Firstly, virtual machines must be
isolated from one another: It is not acceptable for the execution of
one to adversely affect the performance of another. This is
particularly true when virtual machines are owned by mutually
untrusting users. Secondly, it is necessary to support a variety of
different operating systems to accommodate the heterogeneity of popular
applications. Thirdly, the performance overhead introduced by
virtualization should be small.
Xen uses a technique called paravirtualization: The guest OS is
modified, mainly to enhance performance.
The Xen hypervisor (microkernel) does not provide device drivers for
your hardware (except for CPU and memory). This job is left to the
kernel that's running in domain 0. Thus the domain 0 kernel is
privileged; it has full hardware access. It's started immediately after
Xen starts up. Other domains have no access to the hardware; instead
they use virtual interfaces that are provided by Xen (with the help of
the domain 0 kernel).
Xen does support booting other Operating Systems; ports of NetBSD
(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich)
exist. A port of Windows XP was developed for an earlier version of
Xen, but is not available for release due to license restrictions.
In addition to this package you need to install kernel-xen and xen to
use Xen.
Authors:
--------
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%package xend-tools
Summary: Xen Virtualization: Control tools for domain 0
Group: System/Kernel
Requires: python
Requires: python-curses
Requires: python-lxml
Requires: python-openssl
Requires: python-pam
Requires: python-xml
Requires: xen-tools
Conflicts: libvirt < 1.0.5
%description xend-tools
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 sub-package contains the control tools that allow you to start,
stop, migrate, and manage virtual machines using the legacy xend
toolstack.
In addition to this package you need to install kernel-xen and xen to
use Xen.
Authors:
--------
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%endif
%package tools-domU
Summary: Xen Virtualization: Control tools for domain U
Group: System/Kernel
Conflicts: xen-tools
%description tools-domU
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 tools that allow unprivileged domains to query
the virtualized environment.
Authors:
--------
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%package devel
Summary: Xen Virtualization: Headers and libraries for development
Group: System/Kernel
Requires: xen-libs = %{version}
%description devel
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 libraries and header files needed to create
tools to control virtual machines.
Modern computers are sufficiently powerful to use virtualization to
present the illusion of many smaller virtual machines (VMs), each
running a separate operating system instance. Successful partitioning
of a machine to support the concurrent execution of multiple operating
systems poses several challenges. Firstly, virtual machines must be
isolated from one another: It is not acceptable for the execution of
one to adversely affect the performance of another. This is
particularly true when virtual machines are owned by mutually
untrusting users. Secondly, it is necessary to support a variety of
different operating systems to accommodate the heterogeneity of popular
applications. Thirdly, the performance overhead introduced by
virtualization should be small.
Xen uses a technique called paravirtualization: The guest OS is
modified, mainly to enhance performance.
The Xen hypervisor (microkernel) does not provide device drivers for
your hardware (except for CPU and memory). This job is left to the
kernel that's running in domain 0. Thus the domain 0 kernel is
privileged; it has full hardware access. It's started immediately after
Xen starts up. Other domains have no access to the hardware; instead
they use virtual interfaces that are provided by Xen (with the help of
the domain 0 kernel).
Xen does support booting other Operating Systems; ports of NetBSD
(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich)
exist. A port of Windows XP was developed for an earlier version of
Xen, but is not available for release due to license restrictions.
Authors:
--------
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%if %{?with_kmp}0
%package KMP
Summary: Xen para-virtual device drivers for fully virtualized guests
Group: System/Kernel
Conflicts: xen
%description KMP
Xen para-virtual device drivers for fully virtualized guests
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 libraries and header files needed to create
tools to control virtual machines.
Modern computers are sufficiently powerful to use virtualization to
present the illusion of many smaller virtual machines (VMs), each
running a separate operating system instance. Successful partitioning
of a machine to support the concurrent execution of multiple operating
systems poses several challenges. Firstly, virtual machines must be
isolated from one another: It is not acceptable for the execution of
one to adversely affect the performance of another. This is
particularly true when virtual machines are owned by mutually
untrusting users. Secondly, it is necessary to support a variety of
different operating systems to accommodate the heterogeneity of popular
applications. Thirdly, the performance overhead introduced by
virtualization should be small.
Xen uses a technique called paravirtualization: The guest OS is
modified, mainly to enhance performance.
The Xen hypervisor (microkernel) does not provide device drivers for
your hardware (except for CPU and memory). This job is left to the
kernel that's running in domain 0. Thus the domain 0 kernel is
privileged; it has full hardware access. It's started immediately after
Xen starts up. Other domains have no access to the hardware; instead
they use virtual interfaces that are provided by Xen (with the help of
the domain 0 kernel).
Xen does support booting other Operating Systems; ports of NetBSD
(Christian Limpach), FreeBSD (Kip Macy), and Plan 9 (Ron Minnich)
exist. A port of Windows XP was developed for an earlier version of
Xen, but is not available for release due to license restrictions.
%endif
%if %{?with_dom0_support}0
%package doc-html
Summary: Xen Virtualization: HTML documentation
Group: Documentation/HTML
%description doc-html
Xen is a virtual machine monitor for x86 that supports execution of
multiple guest operating systems with unprecedented levels of
performance and resource isolation.
xen-doc-html contains the online documentation in HTML format. Point
your browser at file:/usr/share/doc/packages/xen/html/
Authors:
--------
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%package doc-pdf
Summary: Xen Virtualization: PDF documentation
Group: Documentation/Other
%description doc-pdf
Xen is a virtual machine monitor for x86 that supports execution of
multiple guest operating systems with unprecedented levels of
performance and resource isolation.
xen-doc-pdf contains the online documentation in PDF format. Use
xpdf/kpdf/gpdf/gv/... to read the files in
/usr/share/doc/packages/xen/pdf/
Authors
--------
Ian Pratt <ian.pratt@cl.cam.ac.uk>
%endif
%prep
%setup -q -n %xen_build_dir -a 1 -a 2 -a 3 -a 4 -a 5 -a 6 -a 20000
# Upstream patches
# Qemu
# Our patches
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch301 -p1
%patch302 -p1
%patch303 -p1
%patch304 -p1
%patch310 -p1
%patch311 -p1
%patch312 -p1
%patch313 -p1
%patch314 -p1
%patch315 -p1
%patch320 -p1
%patch321 -p1
%patch322 -p1
%patch323 -p1
%patch330 -p1
%patch331 -p1
%patch332 -p1
%patch350 -p1
%patch351 -p1
%patch352 -p1
%patch353 -p1
%patch360 -p1
%patch361 -p1
%patch362 -p1
%patch363 -p1
%patch501 -p1
%patch502 -p1
%patch503 -p1
%patch504 -p1
%patch520 -p1
%patch521 -p1
%patch522 -p1
%patch523 -p1
%patch800 -p1
%patch99997 -p1
%patch99998 -p1
%patch99999 -p1
# tools/qemu-xen-traditional-dir-remote/configure ./tools/qemu-xen-dir-remote/configure use
# clock_gettime to check whether -lrt is needed - and don't check other functions
# with glibc 2.17 clock_gettime is part of libc, so use timer_settime
sed -i -e 's/int main(void) { clockid_t id; return clock_gettime(id, NULL); }/int main(void) { struct itimerspec v;timer_t t; return timer_gettime (t, \&v);}/' \
tools/qemu-xen-traditional-dir-remote/configure ./tools/qemu-xen-dir-remote/configure
%build
XEN_EXTRAVERSION=%version-%release
XEN_EXTRAVERSION=${XEN_EXTRAVERSION#%{xvers}}
sed -i "s/XEN_EXTRAVERSION[\t ]*.=.*\$/XEN_EXTRAVERSION = $XEN_EXTRAVERSION/" xen/Makefile
sed -i "s/XEN_CHANGESET[\t ]*=.*\$/XEN_CHANGESET = %{changeset}/" xen/Makefile
export EXTRA_CFLAGS_XEN_TOOLS="$RPM_OPT_FLAGS"
export EXTRA_CFLAGS_QEMU_TRADITIONAL="$RPM_OPT_FLAGS"
export EXTRA_CFLAGS_QEMU_XEN="$RPM_OPT_FLAGS"
./configure \
--enable-xenapi \
--prefix=/usr \
--exec_prefix=/usr \
--bindir=%{_bindir} \
--sbindir=%{_sbindir} \
--libdir=%{_libdir} \
--datadir=%{_datadir}
%if %{?with_dom0_support}0
CFLAGS_SAVE=$CFLAGS
%ifnarch %arm aarch64
make -C xenalyze.hg CC="gcc -I../xen/include -DMAX_CPUS=%{max_cpus} ${RPM_OPT_FLAGS}" %{?_smp_mflags} -k
%endif
make -C tools/include/xen-foreign %{?_smp_mflags}
make tools docs %{?_smp_mflags}
make -C tools/debugger/gdbsx
make -C tools/xen-utils-0.1 XEN_INTREE_BUILD=yes XEN_ROOT=$PWD
%else
make -C tools/include/xen-foreign %{?_smp_mflags}
make tools docs %{?_smp_mflags}
%endif
%if %{?with_kmp}0
# pv driver modules
export XL=/usr/src/linux
export XEN=/usr/src/linux/include/xen
mkdir -p obj
for flavor in %flavors_to_build; do
rm -rf obj/$flavor
cp -r unmodified_drivers/linux-2.6 obj/$flavor
cd obj/$flavor
./mkbuildtree
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules \
%{?_smp_mflags} \
M=$PWD
cd ../..
done
%endif
%install
export EXTRA_CFLAGS_XEN_TOOLS="$RPM_OPT_FLAGS"
export EXTRA_CFLAGS_QEMU_TRADITIONAL="$RPM_OPT_FLAGS"
export EXTRA_CFLAGS_QEMU_XEN="$RPM_OPT_FLAGS"
%if %{?with_dom0_support}0
# EFI
%ifarch x86_64 %arm aarch64
make -C xen install \
%if %{?with_gcc46}0
CC=gcc-4.6 \
%endif
max_phys_cpus=%{max_cpus} debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags}
make -C xen clean
%endif
install_xen()
{
local ext=""
if [ -n "$1" ]; then
ext="-$1"
mv $RPM_BUILD_ROOT/boot/xen-%{version}-%{release}.gz \
$RPM_BUILD_ROOT/boot/xen${ext}-%{version}-%{release}.gz
mv $RPM_BUILD_ROOT/boot/xen-syms-%{version}-%{release} \
$RPM_BUILD_ROOT/boot/xen-syms${ext}-%{version}-%{release}
fi
rm $RPM_BUILD_ROOT/boot/xen-%{xvers}.gz
rm $RPM_BUILD_ROOT/boot/xen-%{xvermaj}.gz
rm $RPM_BUILD_ROOT/boot/xen.gz
# Do not link to links; grub cannot follow.
ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}-%{xvers}.gz
ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}-%{xvermaj}.gz
ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}.gz
ln -sf xen-syms${ext}-%{version}-%{release} $RPM_BUILD_ROOT/boot/xen-syms${ext}
}
%ifnarch %arm aarch64
make -C xen install max_phys_cpus=%{max_cpus} pae=%{pae_enabled} debug=y crash_debug=y DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags}
install_xen dbg
make -C xen clean
%endif
make -C xen install max_phys_cpus=%{max_cpus} pae=%{pae_enabled} debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags}
install_xen
make -C xen clean
make -C tools/include/xen-foreign %{?_smp_mflags}
# tools
export XEN_PYTHON_NATIVE_INSTALL=1
make -C tools install \
DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} %{?_smp_mflags}
rm -f $RPM_BUILD_ROOT/usr/sbin/{qcow-create,img2qcow,qcow2raw}
echo > xen.files.txt
%ifarch x86_64
mkdir -p $RPM_BUILD_ROOT/${_libdir}/xen/bin/
ln -s /usr/lib/xen/bin/qemu-dm $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm
# efi depends on gcc46
if test -d $RPM_BUILD_ROOT%{_libdir}/efi
then
echo %{_libdir}/efi >> xen.files.txt
fi
cp -avL xenalyze.hg/dump-raw $RPM_BUILD_ROOT/%{_bindir}/xenalyze.dump-raw
cp -avL xenalyze.hg/xenalyze $RPM_BUILD_ROOT/%{_bindir}
%endif
%else
make -C tools install DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} %{?_smp_mflags}
%endif
# PV driver modules
%if %{?with_kmp}0
export INSTALL_MOD_PATH=$RPM_BUILD_ROOT
export INSTALL_MOD_DIR=updates
mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d
for flavor in %flavors_to_build; do
make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \
M=$PWD/obj/$flavor
install -m644 %SOURCE27 $RPM_BUILD_ROOT/etc/modprobe.d/xen_pvdrivers-$flavor.conf
done
%endif
%if %{?with_dom0_support}0
# Stubdom
%if %{?with_stubdom}0
#remove -fstack-protector flag for stubdom build section
export EXTRA_CFLAGS_XEN_TOOLS=$(echo $RPM_OPT_FLAGS |sed -e 's/-fstack-protector//g')
export EXTRA_CFLAGS_QEMU_TRADITIONAL=$(echo $RPM_OPT_FLAGS |sed -e 's/-fstack-protector//g')
export EXTRA_CFLAGS_QEMU_XEN=$(echo $RPM_OPT_FLAGS |sed -e 's/-fstack-protector//g')
make stubdom %{?_smp_mflags}
make -C stubdom install \
DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} \
DOCDIR=%{_defaultdocdir}/xen INCDIR=%{_includedir}
mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen
%ifarch x86_64
ln -s /usr/lib/xen/bin/stubdom-dm $RPM_BUILD_ROOT/usr/lib64/xen/bin/stubdom-dm
ln -s /usr/lib/xen/bin/stubdompath.sh $RPM_BUILD_ROOT/usr/lib64/xen/bin/stubdompath.sh
%endif
#restore -fstack-protector flag
export EXTRA_CFLAGS_XEN_TOOLS="$RPM_OPT_FLAGS"
export EXTRA_CFLAGS_QEMU_TRADITIONAL="$RPM_OPT_FLAGS"
export EXTRA_CFLAGS_QEMU_XEN="$RPM_OPT_FLAGS"
%endif
# Docs
make -C docs install \
DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} \
DOCDIR=%{_defaultdocdir}/xen
for name in COPYING %SOURCE10 %SOURCE11 %SOURCE12; do
install -m 644 $name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/
done
mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc
for name in vtpm.txt crashdb.txt sedf_scheduler_mini-HOWTO.txt xenpaging.txt; do
install -m 644 docs/misc/$name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc/
done
%endif
# init scripts
%if %{?with_dom0_support}0
mkdir -p $RPM_BUILD_ROOT/etc/init.d
%ifnarch %arm aarch64
install %SOURCE13 $RPM_BUILD_ROOT/etc/init.d/xend
ln -s /etc/init.d/xend $RPM_BUILD_ROOT/usr/sbin/rcxend
%endif
install tools/hotplug/Linux/init.d/xendomains $RPM_BUILD_ROOT/etc/init.d/xendomains
ln -s /etc/init.d/xendomains $RPM_BUILD_ROOT/usr/sbin/rcxendomains
%ifnarch %arm aarch64
install %SOURCE34 $RPM_BUILD_ROOT/etc/init.d/pciback
ln -s /etc/init.d/pciback $RPM_BUILD_ROOT/usr/sbin/rcpciback
install %SOURCE35 $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.pciback
%endif
mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d
install -m644 %SOURCE26 $RPM_BUILD_ROOT/etc/modprobe.d/xen_loop.conf
# example config
mkdir -p $RPM_BUILD_ROOT/etc/xen/{vm,examples,scripts}
mv $RPM_BUILD_ROOT/etc/xen/xmexample* $RPM_BUILD_ROOT/etc/xen/examples
mv $RPM_BUILD_ROOT/etc/xen/xlexample* $RPM_BUILD_ROOT/etc/xen/examples
rm -f $RPM_BUILD_ROOT/etc/xen/examples/*nbd
install -m644 %SOURCE17 %SOURCE18 $RPM_BUILD_ROOT/etc/xen/examples/
install -m644 tools/xentrace/formats $RPM_BUILD_ROOT/etc/xen/examples/xentrace_formats.txt
# scripts
rm -f $RPM_BUILD_ROOT/etc/xen/scripts/block-*nbd
install -m755 %SOURCE19 %SOURCE20 %SOURCE21 %SOURCE22 %SOURCE23 %SOURCE24 %SOURCE25 %SOURCE29 $RPM_BUILD_ROOT/etc/xen/scripts/
ln -s /etc/xen/scripts/vm-monitor $RPM_BUILD_ROOT/etc/xen/scripts/set-lock
# Xen API remote authentication files
install -d $RPM_BUILD_ROOT/etc/pam.d
install -m644 %SOURCE30 $RPM_BUILD_ROOT/etc/pam.d/xen-api
install -m644 %SOURCE31 $RPM_BUILD_ROOT/etc/xen/
# sysconfig hook for Xen
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/network/scripts
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/network/if-down.d
install -m755 %SOURCE32 $RPM_BUILD_ROOT/etc/sysconfig/network/scripts
ln -s /etc/sysconfig/network/scripts/xen-updown.sh $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d/xen
ln -s /etc/sysconfig/network/scripts/xen-updown.sh $RPM_BUILD_ROOT/etc/sysconfig/network/if-down.d/xen
# logrotate
install -m644 -D %SOURCE15 $RPM_BUILD_ROOT/etc/logrotate.d/xen
# directories
mkdir -p $RPM_BUILD_ROOT/var/lib/xenstored
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/images
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/jobs
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/save
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/dump
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/domain
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/migrate
mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/vnet
mkdir -p $RPM_BUILD_ROOT/var/log/xen
mkdir -p $RPM_BUILD_ROOT/var/log/xen/console
ln -s /var/lib/xen/images $RPM_BUILD_ROOT/etc/xen/images
# Bootloader
mkdir -p $RPM_BUILD_ROOT/usr/lib/xen/boot/
install -m755 %SOURCE16 $RPM_BUILD_ROOT/usr/lib/xen/boot/
install -m755 %SOURCE36 $RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages
# udev support
mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d
mv $RPM_BUILD_ROOT/etc/udev/rules.d/xen-backend.rules $RPM_BUILD_ROOT/etc/udev/rules.d/40-xen.rules
mv $RPM_BUILD_ROOT/etc/udev/rules.d/xend.rules $RPM_BUILD_ROOT/etc/udev/rules.d/40-xend.rules
# xen utils
make -C tools/xen-utils-0.1 install DESTDIR=$RPM_BUILD_ROOT XEN_INTREE_BUILD=yes XEN_ROOT=$PWD
# Clean up unpackaged files
rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc/xen/qemu/
rm -f $RPM_BUILD_ROOT/%{_datadir}/doc/qemu/qemu-*
rm -f $RPM_BUILD_ROOT/%{_datadir}/doc/packages/xen/html/hypercall/.deps
rm -rf $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/ps
rm -rf $RPM_BUILD_ROOT/usr/share/xen/man/man1/qemu*
rm -rf $RPM_BUILD_ROOT/usr/share/xen/man/man8/qemu*
rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-ppc
rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/openbios-ppc
rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/qemu/openbios-ppc
rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-sparc32
rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/openbios-sparc32
rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/qemu/openbios-sparc32
rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-sparc64
rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/openbios-sparc64
rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/qemu/openbios-sparc64
rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/palcode-clipper
rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/qemu/palcode-clipper
rm -f $RPM_BUILD_ROOT/usr/sbin/netfix
rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages/*.egg-info
rm -rf $RPM_BUILD_ROOT/html
rm -rf $RPM_BUILD_ROOT/usr/share/doc/xen/README.*
rm -f $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm.debug
rm -f $RPM_BUILD_ROOT/%{_bindir}/qemu-img-xen
rm -f $RPM_BUILD_ROOT/%{_bindir}/qemu-nbd-xen
rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug
rm -rf $RPM_BUILD_ROOT/usr/lib/debug
# Upstream Qemu
rm -rf $RPM_BUILD_ROOT/usr/local/share/qemu
rm -rf $RPM_BUILD_ROOT/usr/local/share/doc/qemu
rm -f $RPM_BUILD_ROOT/usr/local/etc/qemu/target-x86_64.conf
rm -f $RPM_BUILD_ROOT/usr/local/share/man/man1/qemu.1
rm -f $RPM_BUILD_ROOT/usr/local/share/man/man1/qemu-img.1
rm -f $RPM_BUILD_ROOT/usr/local/share/man/man8/qemu-nbd.8
rm -f $RPM_BUILD_ROOT/usr/local/share/doc/qemu/qemu-doc.html
rm -f $RPM_BUILD_ROOT/usr/local/share/doc/qemu/qemu-tech.html
rm -f $RPM_BUILD_ROOT/usr/etc/qemu/target-x86_64.conf
rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper
#install firewall definitions format is described here:
#/usr/share/SuSEfirewall2/services/TEMPLATE
mkdir -p $RPM_BUILD_ROOT/%{_fwdefdir}
install -m 644 %{S:26} $RPM_BUILD_ROOT/%{_fwdefdir}/xend-relocation-server
# create symlinks for keymaps
%fdupes -s $RPM_BUILD_ROOT/%{_datadir}
%else
# 32 bit hypervisor no longer supported. Remove dom0 tools.
rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc
rm -rf $RPM_BUILD_ROOT/usr/local/share/doc
rm -rf $RPM_BUILD_ROOT/%{_datadir}/man
rm -rf $RPM_BUILD_ROOT/usr/local/share/man
rm -rf $RPM_BUILD_ROOT/%{_datadir}/qemu-xen
rm -rf $RPM_BUILD_ROOT/%{_datadir}/xen
rm -rf $RPM_BUILD_ROOT/%{_datadir}/locale
rm -rf $RPM_BUILD_ROOT/%{_libdir}/xen
rm -rf $RPM_BUILD_ROOT/%{_libdir}/python*
rm -rf $RPM_BUILD_ROOT/usr/sbin
rm -f $RPM_BUILD_ROOT/usr/bin/xencov_split
rm -rf $RPM_BUILD_ROOT/etc/bash_completion.d
rm -rf $RPM_BUILD_ROOT/etc/init.d
rm -rf $RPM_BUILD_ROOT/etc/logrotate.d
rm -rf $RPM_BUILD_ROOT/etc/pam.d
rm -rf $RPM_BUILD_ROOT/etc/sysconfig
rm -rf $RPM_BUILD_ROOT/etc/udev
rm -rf $RPM_BUILD_ROOT/etc/qemu
rm -rf $RPM_BUILD_ROOT/etc/xen
rm -rf $RPM_BUILD_ROOT/usr/local/etc
rm -rf $RPM_BUILD_ROOT/var
rm -f $RPM_BUILD_ROOT/%{_bindir}/*store*
rm -f $RPM_BUILD_ROOT/%{_bindir}/*trace*
rm -f $RPM_BUILD_ROOT/%{_bindir}/xenalyze*
rm -f $RPM_BUILD_ROOT/%{_bindir}/qemu*
rm -f $RPM_BUILD_ROOT/%{_bindir}/pygrub
rm -f $RPM_BUILD_ROOT/%{_bindir}/remus
rm -f $RPM_BUILD_ROOT/%{_bindir}/tapdisk-ioemu
rm -f $RPM_BUILD_ROOT/%{_bindir}/xencons
rm -f $RPM_BUILD_ROOT/usr/etc/qemu/target-x86_64.conf
rm -f $RPM_BUILD_ROOT/usr/local/etc/qemu/target-x86_64.conf
rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper
%endif
%if %{?with_dom0_support}0
%files -f xen.files.txt
%defattr(-,root,root)
/boot/xen-%{version}-%{release}.gz
/boot/xen-%{xvermaj}.gz
/boot/xen-%{xvers}.gz
%ifnarch %arm aarch64
/boot/xen-dbg-%{version}-%{release}.gz
/boot/xen-dbg-%{xvermaj}.gz
/boot/xen-dbg-%{xvers}.gz
/boot/xen-dbg.gz
%endif
/boot/xen-syms
/boot/xen-syms-%{version}-%{release}
%ifnarch %arm aarch64
/boot/xen-syms-dbg
/boot/xen-syms-dbg-%{version}-%{release}
%endif
/boot/xen.gz
%endif
%files libs
%defattr(-,root,root)
%{_libdir}/fs/
%{_libdir}/*.so.*
%if %{?with_dom0_support}0
%files tools
%defattr(-,root,root)
%ifnarch %arm aarch64
/usr/bin/xenalyze
/usr/bin/xenalyze.dump-raw
%endif
/usr/bin/xencons
/usr/bin/xenstore*
/usr/bin/xentrace*
/usr/bin/pygrub
%ifnarch %arm aarch64
/usr/bin/tapdisk-ioemu
/usr/bin/remus
/usr/bin/xencov_split
/usr/sbin/blktapctrl
%endif
/usr/sbin/flask-*
/usr/sbin/tap*
/usr/sbin/rcxendomains
%ifnarch %arm aarch64
/usr/sbin/rcpciback
/usr/sbin/xenbaked
%endif
/usr/sbin/xenconsoled
/usr/sbin/xencov
/usr/sbin/xen-destroy
%ifnarch %arm aarch64
/usr/sbin/xen-hptool
/usr/sbin/xen-hvmcrash
/usr/sbin/xen-hvmctx
/usr/sbin/xen-list
/usr/sbin/xenlockprof
/usr/sbin/xen-lowmemd
/usr/sbin/xenmon.py
/usr/sbin/xenperf
/usr/sbin/xenpm
/usr/sbin/xenpmd
%endif
/usr/sbin/xen-ringwatch
/usr/sbin/xenstored
%ifnarch %arm aarch64
/usr/sbin/xen-tmem-list-parse
%endif
/usr/sbin/xentop
%ifnarch %arm aarch64
/usr/sbin/xentrace_setmask
/usr/sbin/xen-vmresync
%endif
/usr/sbin/xenwatchdogd
/usr/sbin/xsview
/usr/sbin/gtracestat
/usr/sbin/gtraceview
/usr/sbin/lock-util
/usr/sbin/td-util
%ifnarch %arm aarch64
/usr/sbin/vhd-update
/usr/sbin/vhd-util
/usr/sbin/gdbsx
%endif
/usr/sbin/xl
%ifnarch %arm aarch64
/usr/sbin/kdd
%endif
%dir %attr(700,root,root) /etc/xen
%dir /etc/xen/scripts
/etc/xen/scripts/blktap
/etc/xen/scripts/block*
/etc/xen/scripts/domain-lock*
/etc/xen/scripts/external-device-migrate
/etc/xen/scripts/hotplugpath.sh
/etc/xen/scripts/locking.sh
/etc/xen/scripts/logging.sh
/etc/xen/scripts/network-*
%ifnarch %arm aarch64
/etc/xen/scripts/qemu-ifup
%endif
/etc/xen/scripts/set-lock
/etc/xen/scripts/vif2
/etc/xen/scripts/vif-*
/etc/xen/scripts/vm-monitor
/etc/xen/scripts/vscsi
/etc/xen/scripts/xen-hotplug-*
/etc/xen/scripts/xen-network-common.sh
/etc/xen/scripts/xen-script-common.sh
/etc/xen/scripts/xmclone.sh
%{_libdir}/xen
%ifarch x86_64 aarch64
/usr/lib/xen
%endif
%ifnarch %arm aarch64
/var/adm/fillup-templates/sysconfig.pciback
%endif
/var/adm/fillup-templates/sysconfig.xencommons
/var/adm/fillup-templates/sysconfig.xendomains
%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
%ifnarch %arm aarch64
%dir %attr(700,root,root) /var/lib/xen/xenpaging
%endif
%dir /var/lib/xenstored
%dir /var/log/xen
%dir /var/log/xen/console
%config /etc/logrotate.d/xen
/etc/xen/auto
%config /etc/xen/examples
/etc/xen/images
%config /etc/xen/cpupool
/etc/xen/README*
%config /etc/xen/vm
%config(noreplace) /etc/xen/xenapiusers
%config(noreplace) /etc/xen/xl.conf
%config /etc/pam.d/xen-api
%config /etc/modprobe.d/xen_loop.conf
%config /etc/init.d/xencommons
%config /etc/init.d/xendomains
%config /etc/init.d/xen-watchdog
%ifnarch %arm aarch64
%config /etc/init.d/pciback
%endif
%dir /etc/modprobe.d
%dir /etc/udev
%dir /etc/udev/rules.d
/etc/udev/rules.d/40-xen.rules
/etc/sysconfig/network/scripts/xen-updown.sh
/etc/sysconfig/network/if-up.d/xen
/etc/sysconfig/network/if-down.d/xen
/etc/bash_completion.d/xl.sh
%ifnarch %arm aarch64
%dir %{_datadir}/qemu-xen
%{_datadir}/qemu-xen/*
%endif
%dir %{_datadir}/xen
%{_datadir}/xen/*.dtd
%ifnarch %arm aarch64
%dir %{_datadir}/xen/qemu
%{_datadir}/xen/qemu/*
%endif
%dir %{_libdir}/python%{pyver}/site-packages/grub
%dir %{_libdir}/python%{pyver}/site-packages/xen
%dir %{_libdir}/python%{pyver}/site-packages/xen/lowlevel
%dir %{_libdir}/python%{pyver}/site-packages/xen/xsview
%{_libdir}/python%{pyver}/site-packages/grub/*
%{_libdir}/python%{pyver}/site-packages/xen/__init__*
%{_libdir}/python%{pyver}/site-packages/xen/lowlevel/*
%{_libdir}/python%{pyver}/site-packages/xen/xsview/*
%{_libdir}/python%{pyver}/site-packages/fsimage.so
%{_libdir}/python%{pyver}/site-packages/xnloader.py
%dir %{_defaultdocdir}/xen
%{_defaultdocdir}/xen/COPYING
%{_defaultdocdir}/xen/README.SuSE
%{_defaultdocdir}/xen/boot.local.xenU
%{_defaultdocdir}/xen/boot.xen
%{_defaultdocdir}/xen/misc
%{_mandir}/man1/xen-list.1.gz
%{_mandir}/man1/xentop.1.gz
%{_mandir}/man1/xentrace_format.1.gz
%{_mandir}/man1/xl.1.gz
%{_mandir}/man5/xl.cfg.5.gz
%{_mandir}/man5/xl.conf.5.gz
%{_mandir}/man5/xlcpupool.cfg.5.gz
%{_mandir}/man8/*.8.gz
%files xend-tools
%defattr(-,root,root)
%ifnarch %arm aarch64
/etc/udev/rules.d/40-xend.rules
%endif
%ifnarch %arm aarch64
/usr/sbin/rcxend
/usr/sbin/xm
/usr/sbin/xend
/usr/sbin/xen-bugtool
/usr/sbin/xen-python-path
%dir /var/lib/xen/xend-db
%dir /var/lib/xen/xend-db/domain
%dir /var/lib/xen/xend-db/migrate
%dir /var/lib/xen/xend-db/vnet
%dir %{_libdir}/python%{pyver}/site-packages/xen/remus
%dir %{_libdir}/python%{pyver}/site-packages/xen/sv
%dir %{_libdir}/python%{pyver}/site-packages/xen/util
%dir %{_libdir}/python%{pyver}/site-packages/xen/xend
%dir %{_libdir}/python%{pyver}/site-packages/xen/xm
%dir %{_libdir}/python%{pyver}/site-packages/xen/web
%config /etc/init.d/xend
%endif
%dir %attr(700,root,root) /etc/xen
%config(noreplace) /etc/xen/*.sxp
%config(noreplace) /etc/xen/*.xml
%ifnarch %arm aarch64
/etc/xen/scripts/xend-relocation.sh
%{_libdir}/python%{pyver}/site-packages/xen/remus/*
%{_libdir}/python%{pyver}/site-packages/xen/sv/*
%{_libdir}/python%{pyver}/site-packages/xen/util/*
%{_libdir}/python%{pyver}/site-packages/xen/xend/*
%{_libdir}/python%{pyver}/site-packages/xen/xm/*
%{_libdir}/python%{pyver}/site-packages/xen/web/*
%config %{_fwdefdir}/xend-relocation-server
%{_mandir}/man1/xm.1.gz
%{_mandir}/man5/xmdomain.cfg.5.gz
%{_mandir}/man5/xend-config.sxp.5.gz
%endif
%endif
%files tools-domU
%defattr(-,root,root)
%ifnarch %arm aarch64
/usr/bin/xen-detect
%endif
/bin/domu-xenstore
/bin/xenstore-*
%files devel
%defattr(-,root,root)
%{_libdir}/*.a
%{_libdir}/*.so
/usr/include/*
%if %{?with_dom0_support}0
%files doc-html
%defattr(-,root,root)
%{_defaultdocdir}/xen/html
#%{_datadir}/doc/qemu
%endif
%if %{?with_dom0_support}0
%post tools
%if %{?with_xend}0
# with_xend
# enable both xm (xend based) and xl (libxl based)
if /bin/ls /etc/init.d/rc3.d/S??xend > /dev/null 2>&1 ; then
if ! /bin/ls /etc/init.d/rc3.d/S??xencommons > /dev/null 2>&1 ; then
echo "postin %{name}-tools: Forcing insserv xencommons during package upgrade because xend was enabled."
echo "postin %{name}-tools: with xend"
fi
%{fillup_and_insserv -Y -n xencommons xencommons}
else
%{fillup_and_insserv -y -n xencommons xencommons}
fi
%{fillup_and_insserv -y -n xend xend}
%else
# without_xend
# disable xm (xend based) and enable only xl (libxl based)
if /bin/ls /etc/init.d/rc3.d/S??xend > /dev/null 2>&1 ; then
if ! /bin/ls /etc/init.d/rc3.d/S??xencommons > /dev/null 2>&1 ; then
echo "postin %{name}-tools: Forcing insserv xencommons during package upgrade because xend was enabled."
fi
echo "postin %{name}-tools: disabling xend in favor of xencommons. xm command replaced by xl."
%{stop_on_removal xend}
rm -fv /etc/init.d/rc?.d/???xend || :
%{fillup_and_insserv -Y -n xencommons xencommons}
else
%{fillup_and_insserv -y -n xencommons xencommons}
fi
%endif
#
%ifnarch %arm aarch64
%{fillup_and_insserv -y -n xendomains xendomains}
%{fillup_only -n pciback}
if [ -f /usr/bin/qemu-img ]; then
if [ -f /usr/bin/qemu-img-xen ]; then
rm /usr/bin/qemu-img-xen
fi
ln -s /usr/bin/qemu-img /usr/bin/qemu-img-xen
fi
if [ -f /usr/bin/qemu-nbd ]; then
if [ -f /usr/bin/qemu-nbd-xen ]; then
rm /usr/bin/qemu-nbd-xen
fi
ln -s /usr/bin/qemu-nbd /usr/bin/qemu-nbd-xen
fi
%endif
%preun tools
%{stop_on_removal xendomains xend xencommons}
%postun tools
%if %{?with_xend}0
# with_xend
%{restart_on_update xend}
%endif
%{insserv_cleanup}
%ifnarch %arm aarch64
if [ -f /usr/bin/qemu-img-xen ]; then
rm /usr/bin/qemu-img-xen
fi
if [ -f /usr/bin/qemu-nbd-xen ]; then
rm /usr/bin/qemu-nbd-xen
fi
%endif
%endif
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%changelog