Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37048275
en ru br
ALT Linux repos
S:9.7.0-alt2
5.0: 0.7.7-alt0.M50.1
4.1: 0.7.7-alt0.M41.1
4.0: 0.7.7-alt0.M40.1

Group :: System/Libraries
RPM: libvirt

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

%define _unpackaged_files_terminate_build 1

%define enabled_ifwith() %{expand:%%{?_with_%{1}:enabled}%%{!?_with_%{1}:disabled}}
%define libvirt_sysconfig_rename() \
   for sc in %{?*} ; do \
       [ ! -f "%_sysconfdir/sysconfig/${sc}" ] || continue ; \
       if [ -f "%_sysconfdir/sysconfig/${sc}.rpmsave" ]; then \
           mv -v "%_sysconfdir/sysconfig/${sc}.rpmsave" "%_sysconfdir/sysconfig/${sc}" \
       fi \
   done \
   %{nil}


%define _localstatedir /var
%define _libexecdir %_prefix/libexec
%define _runtimedir /run
%define qemu_user  _libvirt
%define qemu_group  vmusers

# Locations for QEMU data

%define qemu_moddir %_libdir/qemu
%define qemu_datadir %_datadir/qemu

# A client only build will create a libvirt.so only containing

# the generic RPC driver, and test driver and no libvirtd
# Default to a full server + client build

%ifarch %ix86 x86_64 armh aarch64 ppc64le riscv64
%def_enable server_drivers
%else
%def_disable server_drivers
%endif

# Always build with dlopen'd modules

%def_with driver_modules

%if_enabled server_drivers
# First the daemon itself
%def_with libvirtd

# Then the hypervisor drivers that run on local host

%def_with qemu
%def_with openvz
%def_with lxc
%if_with lxc
%def_with login_shell
%else
%def_without login_shell
%endif
%ifarch %ix86 x86_64
%def_with vbox
%else
%def_without vbox
%endif
%def_without libxl
%ifarch %ix86 x86_64
%def_with vmware
%else
%def_without vmware
%endif

# Then the hypervisor drivers that talk via a native remote protocol

%ifarch %ix86 x86_64
%def_with esx
%else
%def_without esx
%endif
%def_without hyperv

# Then the secondary host drivers

%def_with network
%def_with storage_fs
%def_with storage_lvm
%def_with storage_scsi
%def_with storage_iscsi
%def_with storage_iscsi_direct
%def_with storage_disk
%ifarch x86_64 aarch64 ppc64le
%def_with storage_rbd
%else
%def_without storage_rbd
%endif
%def_with storage_mpath
%ifarch %ix86 %arm %mips32 ppc riscv64
%def_without storage_gluster
%else
%def_with storage_gluster
%endif
%def_with storage_zfs
%def_without storage_vstorage
%ifarch %ix86 x86_64 ppc64le aarch64 s390x
%def_with numactl
%else
%def_without numactl
%endif
%def_with selinux
%define selinux_mount "/sys/fs/selinux"

# A few optional bits

%def_without netcf
%def_with udev
%def_with yajl
%def_with sanlock
%if_with lxc
%def_with fuse
%else
%def_without fuse
%endif
%def_without pm_utils

%else  #server_drivers
%def_without libvirtd
%def_without qemu
%def_without openvz
%def_without lxc
%def_without login_shell
%def_without vbox
%def_without libxl
%def_without vmware
%def_without esx
%def_without hyperv
%def_without network
%def_without storage_fs
%def_without storage_lvm
%def_without storage_scsi
%def_without storage_iscsi
%def_without storage_iscsi_direct
%def_without storage_disk
%def_without storage_rbd
%def_without storage_mpath
%def_without storage_gluster
%def_without storage_zfs
%def_without storage_vstorage
%def_without numactl
%def_with selinux

%def_without netcf
%def_without udev
%def_with yajl
%def_without sanlock
%def_without fuse
%def_without pm_utils
%endif #server_drivers

%if_with  qemu
%def_with qemu_tcg

%ifarch %ix86 x86_64 armh aarch64 ppc64le
%def_with qemu_kvm
%endif
%endif

# A few optional bits

%def_with polkit
%def_with capng
%def_with firewalld
%def_with firewalld_zone

%if_with qemu || lxc
%def_with nwfilter
%def_with libpcap
%else
%def_without nwfilter
%def_without libpcap
%endif

%def_with libnl
%def_with audit
%def_without dtrace

# Non-server/HV driver defaults which are always enabled

%def_with sasl
%def_with libssh
%def_with libssh2

%def_without wireshark

# nss plugin depends on network

%if_with network
%def_with nss
%else
%def_without nss
%endif

# TODO: switch to modular daemons

%def_without modular_daemons

Name: libvirt
Version: 9.7.0
Release: alt2
Summary: Library providing a simple API virtualization
License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1
Group: System/Libraries
Url: https://libvirt.org/
Source0: %name-%version.tar
Source2: keycodemapdb-%name-%version.tar

Source10: libvirt.dm-mod.modules
Source11: libvirtd.init
Source12: virtlockd.init
Source13: virtlogd.init
Source14: libvirt-guests.init
Source21: libvirtd.tmpfiles

Patch1: %name-%version.patch
Patch2: libvirt-9.0-vitastor.diff

%{?_with_libvirtd:Requires: %name-daemon = %EVR}
%{?_with_network:Requires: %name-daemon-config-network = %EVR}
%{?_with_nwfilter:Requires: %name-daemon-config-nwfilter = %EVR}
%{?_with_qemu:Requires: %name-qemu-common = %EVR}
%{?_with_polkit:Requires: polkit}
Requires: %name-client = %EVR
Requires: %name-libs = %EVR

BuildRequires(pre): meson >= 0.56.0
%{?_with_libxl:BuildRequires: xen-devel}
%{?_with_udev:BuildRequires: udev libudev-devel >= 219 libpciaccess-devel}
%{?_with_yajl:BuildRequires: libyajl-devel >= 2.0.1}
%{?_with_sanlock:BuildRequires: sanlock-devel >= 1.8}
%{?_with_libpcap:BuildRequires: libpcap-devel >= 1.5.0}
%{?_with_libnl:BuildRequires: libnl-devel}
%{?_with_selinux:BuildRequires: libselinux-devel}
%{?_with_network:BuildRequires: iptables iptables-nft iptables-ipv6 openvswitch}
%{?_with_nwfilter:BuildRequires: ebtables}
%{?_with_sasl:BuildRequires: libsasl2-devel >= 2.1.6}
%{?_with_libssh:BuildRequires: pkgconfig(libssh) >= 0.8.1}
%{?_with_libssh2:BuildRequires: pkgconfig(libssh2) >= 1.3}
%{?_with_polkit:BuildRequires: polkit}
%{?_with_storage_fs:BuildRequires: util-linux}
%{?_with_qemu:BuildRequires: qemu-img}
%{?_with_storage_lvm:BuildRequires: lvm2}
%{?_with_storage_disk:BuildRequires: libparted-devel parted libuuid-devel dmsetup libdevmapper-devel}
%{?_with_storage_rbd:BuildRequires: ceph-devel}
%{?_with_storage_iscsi:BuildRequires: open-iscsi}
%{?_with_storage_iscsi_direct:BuildRequires: libiscsi-devel >= 1.18.0}
%{?_with_storage_mpath:BuildRequires: libdevmapper-devel}
%{?_with_storage_gluster:BuildRequires: libglusterfs-devel}
%{?_with_numactl:BuildRequires: libnuma-devel >= 2.0.6}
%{?_with_capng:BuildRequires: libcap-ng-devel}
%{?_with_netcf:BuildRequires: netcf-devel >= 0.1.8}
%{?_with_esx:BuildRequires: libcurl-devel >= 7.19.1}
%{?_with_hyperv:BuildRequires: libwsman-devel >= 2.6.3}
%{?_with_audit:BuildRequires: libaudit-devel}
%{?_with_fuse:BuildRequires: libfuse-devel >= 2.8.6}
%{?_with_pm_utils:BuildRequires: pm-utils}
%{?_with_wireshark:BuildRequires: glib2-devel wireshark tshark wireshark-devel >= 2.1.0}
BuildRequires: pkgconfig(bash-completion) >= 2.0

BuildRequires: /proc
BuildRequires: libblkid-devel
BuildRequires: libgcrypt-devel libgnutls-devel >= 3.2.0 libp11-kit-devel
BuildRequires: libreadline-devel
BuildRequires: libtasn1-devel
BuildRequires: libattr-devel attr
BuildRequires: libacl-devel
BuildRequires: glib2-devel >= 2.56 libgio-devel
BuildRequires: libxml2-devel xml-utils xsltproc
BuildRequires: python3 python3-devel
BuildRequires: python3-module-docutils
BuildRequires: zlib-devel
BuildRequires: iproute2
BuildRequires: dmidecode
BuildRequires: libtirpc-devel /usr/bin/rpcgen
BuildRequires: glibc-utils
BuildRequires: kmod
BuildRequires: mdevctl

%description
Libvirt is a C toolkit to interact with the virtualization capabilities
of recent versions of Linux (and other OSes).
The main package includes the libvirtd server exporting the virtualization support.

%package docs
Summary: Documentation for libvirt library and daemon
Group: Development/Documentation
BuildArch: noarch

%description docs
Copy of the libvirt website documentation

%package daemon
Summary: Server side daemon and supporting files for libvirt library
Group: System/Servers
Requires: %name-libs = %EVR
Requires: %name-admin = %EVR
Requires: iproute2 iptables iptables-nft iptables-ipv6
%{?_with_pm_utils:Requires: pm-utils}
Requires: dmidecode
# libvirtd depends on 'messagebus' service
Requires: dbus
Requires: nc
# Needed for /usr/libexec/libvirt-guests.sh script.
Requires: gettext
Obsoletes: %name-admin < 7.3.0
Provides: %name-admin = %EVR
Obsoletes: bash-completion-%name < 7.3.0

%description daemon
Server side daemon required to manage the virtualization capabilities
of recent versions of Linux. Requires a hypervisor specific sub-RPM
for specific drivers.

%package daemon-config-network
Summary: Default configuration files for the libvirtd daemon
Group: System/Servers
BuildArch: noarch
Requires: dnsmasq
%if_with driver_modules
Requires: %name-daemon-driver-network = %EVR
%endif

%description daemon-config-network
Default configuration files for setting up NAT based networking

%package daemon-config-nwfilter
Summary: Network filter configuration files for the libvirtd daemon
Group: System/Servers
BuildArch: noarch
%if_with driver_modules
Requires: %name-daemon-driver-nwfilter = %EVR
%endif

%description daemon-config-nwfilter
Network filter configuration files for cleaning guest traffic

%package daemon-driver-network
Summary: Network driver plugin for the libvirtd daemon
Group: System/Libraries
Requires: %name-daemon = %EVR

%description daemon-driver-network
The network driver plugin for the libvirtd daemon, providing
an implementation of the virtual network APIs using the Linux
bridge capabilities.

%package daemon-driver-nwfilter
Summary: Nwfilter driver plugin for the libvirtd daemon
Group: System/Libraries
Requires: ebtables
Requires: iptables iptables-nft iptables-ipv6
Requires: %name-daemon = %EVR

%description daemon-driver-nwfilter
The nwfilter driver plugin for the libvirtd daemon, providing
an implementation of the firewall APIs using the ebtables,
iptables and ip6tables capabilities

%package daemon-driver-nodedev
Summary: Nodedev driver plugin for the libvirtd daemon
Group: System/Libraries
Requires: %name-daemon = %EVR
Requires: mdevctl

%description daemon-driver-nodedev
The nodedev driver plugin for the libvirtd daemon, providing
an implementation of the node device APIs using the udev
capabilities.

%package daemon-driver-interface
Summary: Interface driver plugin for the libvirtd daemon
Group: System/Libraries
Requires: %name-daemon = %EVR

%description daemon-driver-interface
The interface driver plugin for the libvirtd daemon, providing
an implementation of the network interface APIs using the
netcf library or udev.

%package daemon-driver-secret
Summary: Secret driver plugin for the libvirtd daemon
Group: System/Libraries
Requires: %name-daemon = %EVR

%description daemon-driver-secret
The secret driver plugin for the libvirtd daemon, providing
an implementation of the secret key APIs.

%package daemon-driver-storage
Summary: Storage driver plugin including all backends for the libvirtd daemon
Group: System/Libraries
%if_with storage_fs
Requires: %name-daemon-driver-storage-fs = %EVR
%endif
%if_with storage_disk
Requires: %name-daemon-driver-storage-disk = %EVR
%endif
%if_with storage_lvm
Requires: %name-daemon-driver-storage-logical = %EVR
%endif
%if_with storage_scsi
Requires: %name-daemon-driver-storage-scsi = %EVR
%endif
%if_with storage_iscsi
Requires: %name-daemon-driver-storage-iscsi = %EVR
%endif
%if_with storage_iscsi_direct
Requires: %name-daemon-driver-storage-iscsi-direct = %EVR
%endif
%if_with storage_mpath
Requires: %name-daemon-driver-storage-mpath = %EVR
%endif
%if_with storage_gluster
Requires: %name-daemon-driver-storage-gluster = %EVR
%endif
%if_with storage_rbd
Requires: %name-daemon-driver-storage-rbd = %EVR
%endif

%description daemon-driver-storage
The storage driver plugin for the libvirtd daemon, providing
an implementation of the storage APIs using files, local disks, LVM, SCSI,
iSCSI, and multipath storage.

%package daemon-driver-storage-core
Summary: Storage driver plugin including base backends for the libvirtd daemon
Group: System/Libraries
Requires: %name-daemon = %EVR
Requires: nfs-utils
# For mkfs
Requires: util-linux
%{?_with qemu:Requires: %_bindir/qemu-img}

%description daemon-driver-storage-core
The storage driver plugin for the libvirtd daemon, providing
an implementation of the storage APIs.

%package daemon-driver-storage-fs
Summary: Storage driver plugin for fs
Group: System/Libraries
Requires: libvirt-daemon-driver-storage-core = %EVR

%description daemon-driver-storage-fs
The storage driver backend adding implementation of the storage APIs for block
volumes using fs.

%package daemon-driver-storage-logical
Summary: Storage driver plugin for lvm volumes
Group: System/Libraries
Requires: libvirt-daemon-driver-storage-core = %EVR
Requires: lvm2

%description daemon-driver-storage-logical
The storage driver backend adding implementation of the storage APIs for block
volumes using lvm.

%package daemon-driver-storage-disk
Summary: Storage driver plugin for disk
Group: System/Libraries
Requires: libvirt-daemon-driver-storage-core = %EVR
Requires: parted
Requires: dmsetup

%description daemon-driver-storage-disk
The storage driver backend adding implementation of the storage APIs for block
volumes using the host disks.

%package daemon-driver-storage-scsi
Summary: Storage driver plugin for local scsi devices
Group: System/Libraries
Requires: libvirt-daemon-driver-storage-core = %EVR

%description daemon-driver-storage-scsi
The storage driver backend adding implementation of the storage APIs for scsi
host devices.

%package daemon-driver-storage-iscsi
Summary: Storage driver plugin for iscsi
Group: System/Libraries
Requires: libvirt-daemon-driver-storage-core = %EVR
Requires: iscsi-initiator-utils

%description daemon-driver-storage-iscsi
The storage driver backend adding implementation of the storage APIs for iscsi
volumes using the host iscsi stack.

%package daemon-driver-storage-iscsi-direct
Summary: Storage driver plugin for iscsi-direct
Group: System/Libraries
Requires: libvirt-daemon-driver-storage-core = %EVR

%description daemon-driver-storage-iscsi-direct
The storage driver backend adding implementation of the storage APIs for iscsi
volumes using libiscsi direct connection.

%package daemon-driver-storage-mpath
Summary: Storage driver plugin for multipath volumes
Group: System/Libraries
Requires: libvirt-daemon-driver-storage-core = %EVR
Requires: dmsetup
Requires: multipath-tools

%description daemon-driver-storage-mpath
The storage driver backend adding implementation of the storage APIs for
multipath storage using device mapper.

%package daemon-driver-storage-gluster
Summary: Storage driver plugin for gluster
Group: System/Libraries
Requires: libvirt-daemon-driver-storage-core = %EVR
Requires: glusterfs

%description daemon-driver-storage-gluster
The storage driver backend adding implementation of the storage APIs for gluster
volumes using libgfapi.

%package daemon-driver-storage-rbd
Summary: Storage driver plugin for rbd
Group: System/Libraries
Requires: libvirt-daemon-driver-storage-core = %EVR

%description daemon-driver-storage-rbd
The storage driver backend adding implementation of the storage APIs for rbd
volumes using the ceph protocol.

%package daemon-driver-storage-zfs
Summary: Storage driver plugin for zfs
Group: System/Libraries
Requires: libvirt-daemon-driver-storage-core = %EVR

%description daemon-driver-storage-zfs
The storage driver backend adding implementation of the storage APIs for
zfs volumes using.

%package daemon-driver-qemu
Summary: Qemu driver plugin for the libvirtd daemon
Group: System/Libraries
Requires: %name-daemon-driver-network = %EVR
Requires: %name-daemon-driver-storage-fs = %EVR
Requires: %_bindir/qemu-img
Requires: qemu-kvm-core
# For image compression
Requires: gzip
Requires: bzip2
Requires: lzop
Requires: xz
Requires: swtpm-tools
Requires: systemd-container

%description daemon-driver-qemu
The qemu driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
QEMU

%package daemon-driver-lxc
Summary: LXC driver plugin for the libvirtd daemon
Group: System/Libraries
Requires: %name-daemon-driver-network = %EVR
Requires: %name-daemon = %EVR
Requires: systemd-container

%description daemon-driver-lxc
The LXC driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
the Linux kernel

%package daemon-driver-libxl
Summary: Libxl driver plugin for the libvirtd daemon
Group: System/Libraries
Obsoletes: %name-daemon-driver-xen < 4.3.0
Requires: %name-daemon = %EVR

%description daemon-driver-libxl
The Libxl driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
Libxl

%package daemon-driver-vbox
Summary: VirtualBox driver plugin for the libvirtd daemon
Group: System/Libraries
Requires: %name-daemon = %EVR

%description daemon-driver-vbox
The vbox driver plugin for the libvirtd daemon, providing
an implementation of the hypervisor driver APIs using
VirtualBox

%package qemu-common
Summary: Server side daemon, driver & default configs required to run QEMU or KVM guests
Group: System/Servers
BuildArch: noarch
Requires: %name-daemon-config-network = %EVR
Requires: %name-daemon-driver-interface = %EVR
Requires: %name-daemon-config-nwfilter = %EVR
%if_with driver_modules
Requires: %name-daemon-driver-qemu = %EVR
Requires: %name-daemon-driver-nodedev = %EVR
Requires: %name-daemon-driver-secret = %EVR
Requires: %name-daemon-driver-storage-fs = %EVR
%endif

%description qemu-common
Server side daemon, driver and default network & firewall configs
required to manage the virtualization capabilities of QEMU or KVM.

%package qemu
Summary: Server side daemon, driver & default configs required to run QEMU guests
Group: System/Servers
BuildArch: noarch
Requires: %name-qemu-common = %EVR
Requires: qemu

%description qemu
Server side daemon, driver and default network & firewall configs
required to manage the virtualization capabilities of QEMU.

%package kvm
Summary: Server side daemon, driver & default configs required to run KVM guests
Group: System/Servers
BuildArch: noarch
Requires: %name-qemu-common = %EVR
Requires: qemu-kvm

%description kvm
Server side daemon, driver and default network & firewall configs
required to manage the virtualization capabilities of KVM.

%package lxc
Summary: Server side daemon, driver & default configs required to run LXC guests
Group: System/Servers
Requires: %name-daemon-config-network = %EVR
Requires: %name-daemon-config-nwfilter = %EVR
Requires: lxc
%if_with driver_modules
Requires: %name-daemon-driver-lxc = %EVR
Requires: %name-daemon-driver-nodedev = %EVR
Requires: %name-daemon-driver-secret = %EVR
Requires: %name-daemon-driver-storage = %EVR
%endif

%description lxc
Server side daemon, driver and default network & firewall configs
required to manage the virtualization capabilities of LXC.

%package xen
Summary: Server side daemon, driver & default configs required to run XEN guests
Group: System/Servers
BuildArch: noarch
Requires: %name-daemon-config-network = %EVR
Requires: %name-daemon-config-nwfilter = %EVR
Requires: xen
%if_with driver_modules
%if_with libxl
Requires: %name-daemon-driver-libxl = %EVR
%endif
Requires: %name-daemon-driver-nodedev = %EVR
Requires: %name-daemon-driver-secret = %EVR
Requires: %name-daemon-driver-storage = %EVR
%endif #driver_modules

%description xen
Server side daemon, driver and default network & firewall configs
required to manage the virtualization capabilities of Xen.

%package vbox
Summary: Server side daemon, driver & default configs required to run VirtualBox guests
Group: System/Servers
Requires: %name-daemon-config-network = %EVR
Requires: %name-daemon-config-nwfilter = %EVR
%if_with driver_modules
Requires: %name-daemon-driver-vbox = %EVR
Requires: %name-daemon-driver-nodedev = %EVR
Requires: %name-daemon-driver-secret = %EVR
Requires: %name-daemon-driver-storage = %EVR
%endif

%description vbox
Server side daemon, driver and default network & firewall configs
required to manage the virtualization capabilities of VirtualBox.

%package client
Summary: Client side utilities of the libvirt library
Group: System/Libraries
Requires: %name-libs = %EVR
# Needed by libvirt-guests init script.
Requires: gettext
# For virConnectGetSysinfo
Requires: dmidecode
Requires: gnutls-utils
Obsoletes: bash-completion-%name < 6.7.0
# Needed for probing the power management features of the host.
Conflicts: %name < 0.9.11

%description client
The client binaries needed to access the virtualization
capabilities of recent versions of Linux (and other OSes).

%package client-qemu
Summary: Additional client side utilities for QEMU
Group: System/Libraries
Requires: %name-libs = %EVR
Requires: python3-module-libvirt >= 3.7.0
Requires: python3-module-cryptography
Requires: python3-module-lxml

%description client-qemu
The additional client binaries are used to interact
with some QEMU specific features of libvirt.

%package libs
Summary: Client side libraries
Group: System/Libraries
# So remote clients can access libvirt over SSH tunnel
# (client invokes 'nc' against the UNIX socket on the server)
Requires: /etc/sasl2

%description libs
Shared libraries for accessing the libvirt daemon.

%package -n wireshark-plugin-%name
Summary: Wireshark dissector plugin for libvirt RPC transactions
Group: Networking/Other
Requires: wireshark
Requires: %name-libs = %EVR

%description -n wireshark-plugin-%name
Wireshark dissector plugin for better analysis of libvirt RPC traffic.

%package login-shell
Summary: Login shell for connecting users to an LXC container
Group: System/Libraries
Requires: %name-libs = %EVR

%description login-shell
Provides the set-uid virt-login-shell binary that is used to
connect a user to an LXC container when they login, by switching
namespaces.

%package devel
Summary: Libraries, includes, etc. to compile with the libvirt library
Group: Development/C
Requires: %name-libs = %EVR

%description devel
Includes and documentations for the C library providing an API to use
the virtualization capabilities of recent versions of Linux (and other OSes).

%package lock-sanlock
Summary: Sanlock lock manager plugin for QEMU driver
Group: System/Libraries
Requires: sanlock >= 2.4
#for virt-sanlock-cleanup require augeas
Requires: augeas
Requires: %name-libs = %EVR
Requires: %name-daemon = %EVR

%description lock-sanlock
Includes the Sanlock lock manager plugin for the QEMU
driver

%package -n nss-%name
Summary: Libvirt plugin for Name Service Switch
Group: System/Libraries
Requires: %name-daemon-driver-network = %EVR

%description -n nss-%name
Libvirt plugin for NSS for translating domain names into IP addresses.

%package admin
Summary: Libvirt administration utility
Group: System/Configuration/Other

%description admin
Includes virt-admin, the libvirt administartion utility.

%prep
%setup
mkdir -p src/keycodemapdb
tar -xf %SOURCE2 -C subprojects/keycodemapdb --strip-components 1

%patch1 -p1
%patch2 -p1

%build
%meson \
   -Drootprefix='/' \
   -Drpath=disabled \
   -Drunstatedir=%_runtimedir \
   -Dinitconfdir=%_sysconfdir/sysconfig \
   -Dpackager_version="%release" \
   -Dinit_script=systemd \
   -Dqemu_user=%qemu_user \
   -Dqemu_group=%qemu_group \
   -Dqemu_moddir=%qemu_moddir \
   -Dqemu_datadir=%qemu_datadir \
%if_with modular_daemons
   -Dremote_default_mode=direct \
%else
   -Dremote_default_mode=legacy \
%endif
%if_with libvirtd
   -Ddriver_libvirtd=enabled \
   -Dhost_validate=enabled \
   -Dinit_script=systemd \
%else
   -Ddriver_libvirtd=disabled \
   -Dhost_validate=disabled \
   -Dinit_script=none \
%endif
   -Ddriver_qemu=%{enabled_ifwith qemu} \
   -Ddriver_openvz=%{enabled_ifwith openvz} \
   -Ddriver_lxc=%{enabled_ifwith lxc} \
   -Dlogin_shell=%{enabled_ifwith login_shell} \
   -Ddriver_vbox=%{enabled_ifwith vbox} \
   -Ddriver_libxl=%{enabled_ifwith libxl} \
   -Ddriver_vmware=%{enabled_ifwith vmware} \
   -Ddriver_esx=%{enabled_ifwith esx} \
   -Ddriver_hyperv=%{enabled_ifwith hyperv} \
   -Ddriver_ch=disabled \
   -Ddriver_network=%{enabled_ifwith network} \
   -Dstorage_fs=%{enabled_ifwith storage_fs} \
   -Dstorage_lvm=%{enabled_ifwith storage_lvm} \
   -Dstorage_iscsi=%{enabled_ifwith storage_iscsi} \
   -Dstorage_iscsi_direct=%{enabled_ifwith storage_iscsi_direct} \
   -Dstorage_scsi=%{enabled_ifwith storage_scsi} \
   -Dstorage_disk=%{enabled_ifwith storage_disk} \
   -Dstorage_rbd=%{enabled_ifwith storage_rbd} \
   -Dstorage_mpath=%{enabled_ifwith storage_mpath} \
   -Dstorage_gluster=%{enabled_ifwith storage_gluster} \
   -Dstorage_zfs=%{enabled_ifwith storage_zfs} \
   -Dstorage_vstorage=%{enabled_ifwith storage_vstorage} \
   -Dnumactl=%{enabled_ifwith numactl} \
   -Dselinux=%{enabled_ifwith selinux} \
%if_with selinux
   -Dselinux_mount=%selinux_mount \
%endif
   -Dnetcf=%{enabled_ifwith netcf} \
   -Dudev=%{enabled_ifwith udev} \
   -Dyajl=%{enabled_ifwith yajl} \
   -Dsanlock=%{enabled_ifwith sanlock} \
   -Dfuse=%{enabled_ifwith fuse} \
   -Dpm_utils=%{enabled_ifwith pm_utils} \
   -Dpolkit=%{enabled_ifwith polkit} \
   -Dfirewalld=%{enabled_ifwith firewalld} \
   -Dfirewalld_zone=%{enabled_ifwith firewalld_zone} \
   -Dcapng=%{enabled_ifwith capng} \
   -Dlibpcap=%{enabled_ifwith libpcap} \
   -Dlibssh=%{enabled_ifwith libssh} \
   -Dlibssh2=%{enabled_ifwith libssh2} \
   -Daudit=%{enabled_ifwith audit} \
   -Ddtrace=%{enabled_ifwith dtrace} \
   -Dnss=%{enabled_ifwith nss} \
   -Dsasl=%{enabled_ifwith sasl} \
   -Ddocs=enabled \
   -Dexpensive_tests=enabled

%meson_build

%install
%meson_install

# Install sysv init scripts

%if_with libvirtd
install -pD -m 755 %SOURCE11  %buildroot%_initdir/libvirtd
install -pD -m 755 %SOURCE12  %buildroot%_initdir/virtlockd
install -pD -m 755 %SOURCE13  %buildroot%_initdir/virtlogd
install -pD -m 755 %SOURCE14  %buildroot%_initdir/libvirt-guests
%else
rm -f %buildroot%_libexecdir/libvirt-guests.sh
%endif

# delete docs

rm -rf %buildroot%_datadir/doc/libvirt


%if_with qemu
# We install /etc/libvirt/qemu/networks/autostart/default.xml as ghost
rm -f %buildroot%_sysconfdir/libvirt/qemu/networks/autostart/default.xml
touch %buildroot%_sysconfdir/libvirt/qemu/networks/autostart/default.xml
%else
rm -f %buildroot%_datadir/augeas/lenses/libvirtd_qemu.aug
rm -f %buildroot%_datadir/augeas/lenses/tests/test_libvirtd_qemu.aug
rm -f %buildroot%_sysconfdir/libvirt/qemu.conf
rm -f %buildroot%_sysconfdir/logrotate.d/libvirtd.qemu
%endif
%if_without lxc
rm -f %buildroot%_datadir/augeas/lenses/libvirtd_lxc.aug
rm -f %buildroot%_datadir/augeas/lenses/tests/test_libvirtd_lxc.aug
rm -f %buildroot%_sysconfdir/libvirt/lxc.conf
rm -f %buildroot%_sysconfdir/logrotate.d/libvirtd.lxc
%endif
%if_without nwfilter
rm -rf %buildroot%_sysconfdir/libvirt/nwfilter
%endif
%if_without libxl
rm -f %buildroot%_sysconfdir/logrotate.d/libvirtd.libxl
%endif

%if_with nss
# Relocate nss library from %%_libdir/libnss_libvirt.so.* to /%%_lib/libnss_libvirt.so.* .
mkdir -p %buildroot/%_lib
mv %buildroot%_libdir/libnss_libvirt.so.* %buildroot/%_lib/
ln -sf ../../%_lib/libnss_libvirt.so.2 %buildroot%_libdir/libnss_libvirt.so
mv %buildroot%_libdir/libnss_libvirt_guest.so.2 %buildroot/%_lib/
ln -sf ../../%_lib/libnss_libvirt_guest.so.2 %buildroot%_libdir/libnss_libvirt_guest.so
%endif

%if_with libvirtd
install -pD -m644 %SOURCE10 %buildroot%_sysconfdir/modules-load.d/libvirt-dm-mod.conf
# filetrigger that restart libvirtd after install any plugin
cat <<EOF > filetrigger
#!/bin/sh -e

dir=%_libdir/libvirt/
grep -qs '^'\$dir'' && /sbin/service libvirtd condrestart ||:
EOF
install -pD -m 755 filetrigger %buildroot%_rpmlibdir/%name.filetrigger

install -pD -m644 %SOURCE21 %buildroot/lib/tmpfiles.d/libvirtd.conf
%endif

%find_lang %name

%check
VIR_TEST_DEBUG=1 %__meson_test --no-suite syntax-check --timeout-multiplier 10

%pre login-shell
%_sbindir/groupadd -r -f virtlogin

%if_with qemu
%pre daemon-driver-qemu
%_sbindir/groupadd -r -f %qemu_group
%_sbindir/useradd -M -r -d %_localstatedir/lib/%name -s /bin/false -c "libvirt user" -g %qemu_group %qemu_user >/dev/null 2>&1 || :
%endif

%post daemon
%post_service virtlockd
%post_service virtlogd
%post_service libvirt-guests

%preun daemon
%preun_service libvirtd
%preun_service virtlogd
%preun_service virtlockd
%preun_service libvirt-guests


%triggerpostun daemon -- %name-daemon < 1.3.0
# In upgrade scenario we must explicitly enable virtlockd/virtlogd
# sockets, if libvirtd is already enabled and start them if
# libvirtd is running, otherwise you'll get failures to start
# guests
if [ $1 -ge 1 ] ; then
   if service libvirtd status; then
       chkconfig virtlogd on && service virtlogd start
       chkconfig virtlockd on && service virtlockd start
   fi
fi

%triggerpostun daemon -- %name-daemon < 8.6.0
%libvirt_sysconfig_rename libvirtd virtproxyd virtlogd virtlockd libvirt-guests

%triggerpostun daemon-driver-network -- %name-daemon-driver-network < 8.6.0
%libvirt_sysconfig_rename virtnetworkd

%triggerpostun daemon-driver-nwfilter -- %name-daemon-driver-nwfilter < 8.6.0
%libvirt_sysconfig_rename virtnwfilterd

%triggerpostun daemon-driver-nodedev -- %name-daemon-driver-nodedev < 8.6.0
%libvirt_sysconfig_rename virtnodedevd

%triggerpostun daemon-driver-interface -- %name-daemon-driver-interface < 8.6.0
%libvirt_sysconfig_rename virtinterfaced

%triggerpostun daemon-driver-secret -- %name-daemon-driver-secret < 8.6.0
%libvirt_sysconfig_rename virtsecretd

%triggerpostun daemon-driver-qemu -- %name-daemon-driver-qemu < 8.6.0
%libvirt_sysconfig_rename virtqemud

%triggerpostun daemon-driver-lxc -- %name-daemon-driver-lxc < 8.6.0
%libvirt_sysconfig_rename virtlxcd

%triggerpostun daemon-driver-vbox -- %name-daemon-driver-vbox < 8.6.0
%libvirt_sysconfig_rename virtvboxd

%triggerpostun daemon-driver-libxl -- %name-daemon-driver-libxl < 8.6.0
%libvirt_sysconfig_rename virtxend

%files

%files docs
%doc NEWS.rst README.rst
%doc docs/*.xml
%doc docs/html

%files client
%_bindir/virsh
%_bindir/virt-xml-validate
%_bindir/virt-pki-query-dn
%_bindir/virt-pki-validate
%_man1dir/virsh.*
%_man1dir/virt-xml-validate.*
%_man1dir/virt-pki-query-dn.*
%_man1dir/virt-pki-validate.*
%_man7dir/virkey*
%_datadir/bash-completion/completions/virsh

%if_with qemu
%files client-qemu
%_man1dir/virt-qemu-qmp-proxy.*
%_man1dir/virt-qemu-sev-validate.1*
%_bindir/virt-qemu-qmp-proxy
%_bindir/virt-qemu-sev-validate
%endif

%files libs -f %name.lang
%doc COPYING COPYING.LESSER
%dir %attr(0700, root, root) %_sysconfdir/libvirt
%config(noreplace) %_sysconfdir/libvirt/libvirt.conf
%config(noreplace) %_sysconfdir/libvirt/libvirt-admin.conf
%_libdir/lib*.so.*
%dir %_datadir/libvirt
%dir %_datadir/libvirt/schemas
%_datadir/libvirt/schemas/*.rng
%_datadir/libvirt/cpu_map
%_datadir/libvirt/test-screenshot.png

%if_with sasl
%config(noreplace) %_sysconfdir/sasl2/libvirt.conf
%endif

%if_with libvirtd
%files daemon
%dir %_datadir/libvirt
%dir %attr(0700, root, root) %_logdir/libvirt
%_tmpfilesdir/libvirtd.conf
%_unitdir/libvirtd*
%_unitdir/virtproxyd*
%_unitdir/virt-guest-shutdown.target
%_unitdir/libvirt-guests.service
%_initdir/libvirtd
%_initdir/libvirt-guests
%_libexecdir/libvirt-guests.sh
%config(noreplace) %_sysconfdir/libvirt/libvirtd.conf
%config(noreplace) %_sysconfdir/libvirt/virtproxyd.conf
%_sysctldir/60-libvirtd.conf
%config(noreplace) %_sysconfdir/logrotate.d/libvirtd
%_rpmlibdir/%name.filetrigger
#virtlockd
%config(noreplace) %_sysconfdir/libvirt/qemu-lockd.conf
%config(noreplace) %_sysconfdir/libvirt/virtlockd.conf
%_initdir/virtlockd
%_unitdir/virtlockd*
%_libdir/%name/lock-driver/lockd.so
%_sbindir/virtlockd
%_bindir/virt-host-validate
%_datadir/augeas/lenses/libvirt_lockd.aug
%_datadir/augeas/lenses/virtlockd.aug
%_datadir/augeas/lenses/tests/test_virtlockd.aug
%_man8dir/virtlockd*
%_man1dir/virt-host-validate.*

#virtlogd

%config(noreplace) %_sysconfdir/libvirt/virtlogd.conf
%_initdir/virtlogd
%_unitdir/virtlogd*
%_sbindir/virtlogd
%_datadir/augeas/lenses/tests/test_virtlogd.aug
%_datadir/augeas/lenses/virtlogd.aug
%_man8dir/virtlogd*

%if_with qemu
%_datadir/augeas/lenses/tests/test_libvirt_lockd.aug
%endif

%_libexecdir/libvirt_iohelper
%_bindir/virt-ssh-helper
%_sbindir/libvirtd
%_sbindir/virtproxyd
%_man8dir/libvirtd.*
%_man8dir/virtproxyd.*
%_man8dir/virt-ssh-helper.*
%_man8dir/libvirt-guests.*

%_datadir/augeas/lenses/libvirtd.aug
%_datadir/augeas/lenses/tests/test_libvirtd.aug
%_datadir/augeas/lenses/virtproxyd.aug
%_datadir/augeas/lenses/tests/test_virtproxyd.aug

%dir %_localstatedir/lib/libvirt
%dir %attr(0711, root, root) %_localstatedir/lib/libvirt/images
%dir %attr(0711, root, root) %_localstatedir/lib/libvirt/filesystems
%dir %attr(0711, root, root) %_localstatedir/lib/libvirt/boot
%dir %attr(0700, root, root) %_localstatedir/cache/libvirt
%dir %_libdir/libvirt
%dir %_libdir/libvirt/connection-driver
%dir %_libdir/libvirt/lock-driver

%if_with polkit
%_datadir/polkit-1/actions/org.libvirt.unix.policy
%_datadir/polkit-1/actions/org.libvirt.api.policy
%_datadir/polkit-1/rules.d/50-libvirt.rules
%endif

%if_with network
%files daemon-config-network
%dir %attr(0700, root, root) %_sysconfdir/libvirt/qemu/networks
%config(noreplace) %attr(0600, root, root) %_sysconfdir/libvirt/qemu/networks/default.xml
%ghost %_sysconfdir/libvirt/qemu/networks/autostart/default.xml
%dir %attr(0700, root, root) %_sysconfdir/libvirt/qemu/networks/autostart
%dir %attr(0700, root, root) %_localstatedir/lib/libvirt/network
%dir %attr(0755, root, root) %_localstatedir/lib/libvirt/dnsmasq
%endif

%if_with nwfilter
%files daemon-config-nwfilter
%dir %attr(0700, root, root) %_sysconfdir/libvirt/nwfilter
%config(noreplace) %attr(0600, root, root) %_sysconfdir/libvirt/nwfilter/*.xml
%endif

%if_with driver_modules
%if_with network
%files daemon-driver-network
%config(noreplace) %_sysconfdir/libvirt/virtnetworkd.conf
%_datadir/augeas/lenses/virtnetworkd.aug
%_datadir/augeas/lenses/tests/test_virtnetworkd.aug
%_unitdir/virtnetworkd*
%_sbindir/virtnetworkd
%_libdir/%name/connection-driver/libvirt_driver_network.so
%_libexecdir/libvirt_leaseshelper
%_man8dir/virtnetworkd.*
%if_with firewalld_zone
%_prefix/lib/firewalld/zones/libvirt.xml
%_prefix/lib/firewalld/zones/libvirt-routed.xml
%_prefix/lib/firewalld/policies/libvirt-routed-in.xml
%_prefix/lib/firewalld/policies/libvirt-routed-out.xml
%_prefix/lib/firewalld/policies/libvirt-to-host.xml
%endif
%endif

%if_with udev
%files daemon-driver-nodedev
%config(noreplace) %_sysconfdir/libvirt/virtnodedevd.conf
%_datadir/augeas/lenses/virtnodedevd.aug
%_datadir/augeas/lenses/tests/test_virtnodedevd.aug
%_unitdir/virtnodedevd*
%_sbindir/virtnodedevd
%_libdir/%name/connection-driver/libvirt_driver_nodedev.so
%_man8dir/virtnodedevd.*

%files daemon-driver-interface
%config(noreplace) %_sysconfdir/libvirt/virtinterfaced.conf
%_datadir/augeas/lenses/virtinterfaced.aug
%_datadir/augeas/lenses/tests/test_virtinterfaced.aug
%_unitdir/virtinterfaced*
%_sbindir/virtinterfaced
%_libdir/%name/connection-driver/libvirt_driver_interface.so
%_man8dir/virtinterfaced.8*
%endif #if_with udev

%if_with nwfilter
%files daemon-driver-nwfilter
%config(noreplace) %_sysconfdir/libvirt/virtnwfilterd.conf
%_datadir/augeas/lenses/virtnwfilterd.aug
%_datadir/augeas/lenses/tests/test_virtnwfilterd.aug
%_unitdir/virtnwfilterd*
%_sbindir/virtnwfilterd
%_libdir/%name/connection-driver/libvirt_driver_nwfilter.so
%_man8dir/virtnwfilterd.*
%endif

%files daemon-driver-secret
%config(noreplace) %_sysconfdir/libvirt/virtsecretd.conf
%dir %attr(0700, root, root) %_sysconfdir/libvirt/secrets
%_datadir/augeas/lenses/virtsecretd.aug
%_datadir/augeas/lenses/tests/test_virtsecretd.aug
%_unitdir/virtsecretd*
%_sbindir/virtsecretd
%_libdir/%name/connection-driver/libvirt_driver_secret.so
%_man8dir/virtsecretd.*

%files daemon-driver-storage

%files daemon-driver-storage-core
%config(noreplace) %_sysconfdir/modules-load.d/libvirt-dm-mod.conf
%config(noreplace) %_sysconfdir/libvirt/virtstoraged.conf
%dir %attr(0700, root, root) %_sysconfdir/libvirt/storage
%dir %attr(0700, root, root) %_sysconfdir/libvirt/storage/autostart
%_datadir/augeas/lenses/virtstoraged.aug
%_datadir/augeas/lenses/tests/test_virtstoraged.aug
%_unitdir/virtstoraged*
%_sbindir/virtstoraged
%if_with storage_disk
%_libexecdir/libvirt_parthelper
%endif
%_libdir/%name/connection-driver/libvirt_driver_storage.so
%dir %_libdir/%name/storage-backend
%dir %_libdir/%name/storage-file
%_libdir/%name/storage-file/libvirt_storage_file_fs.so
%_man8dir/virtstoraged.*

%if_with storage_fs
%files daemon-driver-storage-fs
%_libdir/%name/storage-backend/libvirt_storage_backend_fs.so
%endif


%if_with storage_disk
%files daemon-driver-storage-disk
%_libdir/%name/storage-backend/libvirt_storage_backend_disk.so
%endif

%if_with storage_lvm
%files daemon-driver-storage-logical
%_libdir/%name/storage-backend/libvirt_storage_backend_logical.so
%endif

%if_with storage_scsi
%files daemon-driver-storage-scsi
%_libdir/%name/storage-backend/libvirt_storage_backend_scsi.so
%endif

%if_with storage_iscsi
%files daemon-driver-storage-iscsi
%_libdir/%name/storage-backend/libvirt_storage_backend_iscsi.so
%endif

%if_with storage_iscsi_direct
%files daemon-driver-storage-iscsi-direct
%_libdir/%name/storage-backend/libvirt_storage_backend_iscsi-direct.so
%endif

%if_with storage_mpath
%files daemon-driver-storage-mpath
%_libdir/%name/storage-backend/libvirt_storage_backend_mpath.so
%endif

%if_with storage_gluster
%files daemon-driver-storage-gluster
%_libdir/%name/storage-backend/libvirt_storage_backend_gluster.so
%_libdir/%name/storage-file/libvirt_storage_file_gluster.so
%endif

%if_with storage_rbd
%files daemon-driver-storage-rbd
%_libdir/%name/storage-backend/libvirt_storage_backend_rbd.so
%endif

%if_with storage_zfs
%files daemon-driver-storage-zfs
%_libdir/%name/storage-backend/libvirt_storage_backend_zfs.so
%endif

%if_with qemu
%files daemon-driver-qemu
%config(noreplace) %_sysconfdir/libvirt/virtqemud.conf
%_sysctldir/60-qemu-postcopy-migration.conf
%_datadir/augeas/lenses/virtqemud.aug
%_datadir/augeas/lenses/tests/test_virtqemud.aug
%_unitdir/virtqemud*
%_sbindir/virtqemud
%_libdir/%name/connection-driver/libvirt_driver_qemu.so
%dir %attr(0700, root, root) %_sysconfdir/libvirt/qemu
%dir %attr(0700, root, root) %_sysconfdir/libvirt/qemu/autostart
%config(noreplace) %_sysconfdir/libvirt/qemu.conf
%config(noreplace) %_sysconfdir/logrotate.d/libvirtd.qemu
%dir %attr(0750, %qemu_user, %qemu_group) %_localstatedir/lib/libvirt/qemu
%dir %attr(0751, %qemu_user, %qemu_group) %_localstatedir/lib/libvirt/qemu/checkpoint
%dir %attr(0751, %qemu_user, %qemu_group) %_localstatedir/lib/libvirt/qemu/dump
%dir %attr(0751, %qemu_user, %qemu_group) %_localstatedir/lib/libvirt/qemu/nvram
%dir %attr(0751, %qemu_user, %qemu_group) %_localstatedir/lib/libvirt/qemu/ram
%dir %attr(0751, %qemu_user, %qemu_group) %_localstatedir/lib/libvirt/qemu/save
%dir %attr(0751, %qemu_user, %qemu_group) %_localstatedir/lib/libvirt/qemu/snapshot
%dir %attr(0750, root, root) %_cachedir/libvirt/qemu
%dir %attr(0700, root, root) %_logdir/libvirt/qemu
%dir %attr(0711, root, root) %_localstatedir/lib/libvirt/swtpm
%dir %attr(0770, tss, tss) %_logdir/swtpm/libvirt/qemu
%_datadir/augeas/lenses/libvirtd_qemu.aug
%_datadir/augeas/lenses/tests/test_libvirtd_qemu.aug
%_bindir/virt-qemu-run
%_man1dir/virt-qemu-run.*
%_man8dir/virtqemud.*
%endif

%if_with lxc
%files daemon-driver-lxc
%config(noreplace) %_sysconfdir/libvirt/virtlxcd.conf
%dir %attr(0700, root, root) %_sysconfdir/libvirt/lxc
%dir %attr(0700, root, root) %_sysconfdir/libvirt/lxc/autostart
%_datadir/augeas/lenses/virtlxcd.aug
%_datadir/augeas/lenses/tests/test_virtlxcd.aug
%_unitdir/virtlxcd*
%_sbindir/virtlxcd
%_libdir/%name/connection-driver/libvirt_driver_lxc.so
%config(noreplace) %_sysconfdir/libvirt/lxc.conf
%config(noreplace) %_sysconfdir/logrotate.d/libvirtd.lxc
%dir %attr(0700, root, root) %_localstatedir/lib/libvirt/lxc
%dir %attr(0700, root, root) %_localstatedir/log/libvirt/lxc
%_datadir/augeas/lenses/libvirtd_lxc.aug
%_datadir/augeas/lenses/tests/test_libvirtd_lxc.aug
%_libexecdir/libvirt_lxc
%_man8dir/virtlxcd.*
%endif

%if_with libxl
%files daemon-driver-libxl
%config(noreplace) %_sysconfdir/libvirt/virtxend.conf
%dir %attr(0700, root, root) %_sysconfdir/libvirt/libxl
%dir %attr(0700, root, root) %_sysconfdir/libvirt/libxl/autostart
%_datadir/augeas/lenses/virtxend.aug
%_datadir/augeas/lenses/tests/test_virtxend.aug
%_unitdir/virtxend*
%_sbindir/virtxend
%_libdir/%name/connection-driver/libvirt_driver_libxl.so
%dir %attr(0700, root, root) %_logdir/libvirt/libxl
%dir %attr(0700, root, root) %_localstatedir/lib/libvirt/libxl
%dir %attr(0700, root, root) %_localstatedir/lib/libvirt/libxl/channel
%dir %attr(0700, root, root) %_localstatedir/lib/libvirt/libxl/channel/target
%dir %attr(0700, root, root) %_localstatedir/lib/libvirt/libxl/dump
%dir %attr(0700, root, root) %_localstatedir/lib/libvirt/libxl/save
%config(noreplace) %_sysconfdir/libvirt/libxl*.conf
%config(noreplace) %_sysconfdir/logrotate.d/libvirtd.libxl
%_datadir/augeas/lenses/libvirtd_libxl.aug
%_datadir/augeas/lenses/tests/test_libvirtd_libxl.aug
%_man8dir/virtxend.*
%endif

%if_with vbox
%files daemon-driver-vbox
%config(noreplace) %_sysconfdir/libvirt/virtvboxd.conf
%_datadir/augeas/lenses/virtvboxd.aug
%_datadir/augeas/lenses/tests/test_virtvboxd.aug
%_unitdir/virtvboxd*
%_sbindir/virtvboxd
%_libdir/%name/connection-driver/libvirt_driver_vbox.so
%_man8dir/virtvboxd.*
%endif
%endif #driver_modules

%if_with qemu
%files qemu-common
%if_with qemu_tcg
%files qemu
%endif
%if_with qemu_kvm
%files kvm
%endif

%endif #if_with qemu

%if_with lxc
%files lxc
%endif

%if_with libxl
%files xen
%endif #if_with libxl

%if_with vbox
%files vbox
%endif

%if_with sanlock
%files lock-sanlock
%_libdir/libvirt/lock-driver/sanlock.so

%if_with qemu
%config(noreplace) %_sysconfdir/libvirt/qemu-sanlock.conf
%endif

%if_with libxl
%config(noreplace) %_sysconfdir/libvirt/libxl-sanlock.conf
%endif

%_datadir/augeas/lenses/libvirt_sanlock.aug
%_datadir/augeas/lenses/tests/test_libvirt_sanlock.aug
%dir %attr(0770, root, sanlock) %_localstatedir/lib/libvirt/sanlock
%_sbindir/virt-sanlock-cleanup
%_man8dir/virt-sanlock-cleanup.*
%_libexecdir/libvirt_sanlock_helper
%endif #if_with sanlock
%endif #if_with libvirtd

%if_with nss
%files  -n nss-%name
/%_lib/libnss_libvirt.so.*
/%_lib/libnss_libvirt_guest.so.*
%endif

%if_with wireshark
%files -n wireshark-plugin-%name
%_libdir/wireshark/plugins/%name.so
%endif

%if_with lxc
%if_with login_shell
%files login-shell
%config(noreplace) %_sysconfdir/libvirt/virt-login-shell.conf
%attr(4710, root, virtlogin) %_bindir/virt-login-shell
%_libexecdir/virt-login-shell-helper
%_man1dir/virt-login-shell.*
%endif
%endif

%files admin
%_bindir/virt-admin
%_man1dir/virt-admin.1*
%_datadir/bash-completion/completions/virt-admin


%files devel
%_pkgconfigdir/*.pc
%_libdir/*.so
%_includedir/libvirt
%_datadir/libvirt/api

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin