[libvirt] [PATCH 00/27] Remove many conditionals from the RPM

Cole previously suggested that we should simplify the RPM spec by removing conditionals that we never need to toggle for RHEL / Fedora builds, rather than having conditionals for every single feature that exists. This series does just that.... Daniel P. Berrange (27): libvirt.spec.in: explicitly disable xenapi & vz drivers libvirt.spec.in: drop Fedora < 20 and RHEL < 6 libvirt.spec.in: remove client only build option libvirt.spec.in: remove conditional for driver modules libvirt.spec.in: remove libvirtd conditional libvirt.spec.in: remove avahi conditional libvirt.spec.in: remove hal conditional libvirt.spec.in: remove apparmor conditional libvirt.spec.in: remove capng conditional libvirt.spec.in: remove udev conditional libvirt.spec.in: remove netcf conditional libvirt.spec.in: remove audit conditional libvirt.spec.in: remove dtrace conditional libvirt.spec.in: remove sasl conditionals libvirt.spec.in: remove polkit conditional libvirt.spec.in: remove yajl conditional libvirt.spec.in: remove selinux conditional libvirt.spec.in: remove interface driver conditional libvirt.spec.in: remove network driver conditiaonl libvirt.spec.in: remove most storage conditionals libvirt.spec.in: remove nodedev conditional libvirt.spec.in: remove nwfilter driver conditional libvirt.spec.in: remove libpcap conditional libvirt.spec.in: remove macvtap conditional libvirt.spec.in: remove libnl conditional libvirt.spec.in: remove nss plugin conditional libvirt.spec.in: use explicit --with-xxx for all features libvirt.spec.in | 1205 +++++++++++++++---------------------------------------- 1 file changed, 333 insertions(+), 872 deletions(-) -- 2.5.5

The xenapi & vz drivers won't build in Fedora or RHEL since their deps don't exist there. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index a24be32..d907d8f 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -99,9 +99,6 @@ %define with_phyp 0%{!?_without_phyp:1} %define with_esx 0%{!?_without_esx:1} %define with_hyperv 0%{!?_without_hyperv:1} -%define with_xenapi 0%{!?_without_xenapi:1} -%define with_vz 0%{!?_without_vz:1} -# No test for bhyve, because it does not build on Linux # Then the secondary host drivers, which run inside libvirtd %define with_interface 0%{!?_without_interface:%{server_drivers}} @@ -1292,10 +1289,6 @@ rm -rf .git %define _without_vbox --without-vbox %endif -%if ! %{with_xenapi} - %define _without_xenapi --without-xenapi -%endif - %if ! %{with_libxl} %define _without_libxl --without-libxl %endif @@ -1324,10 +1317,6 @@ rm -rf .git %define _without_vmware --without-vmware %endif -%if ! %{with_vz} - %define _without_vz --without-vz -%endif - %if ! %{with_polkit} %define _without_polkit --without-polkit %endif @@ -1501,7 +1490,6 @@ rm -f po/stamp-po %{?_without_lxc} \ %{?_without_vbox} \ %{?_without_libxl} \ - %{?_without_xenapi} \ %{?_without_sasl} \ %{?_without_avahi} \ %{?_without_polkit} \ @@ -1511,7 +1499,8 @@ rm -f po/stamp-po %{?_without_esx} \ %{?_without_hyperv} \ %{?_without_vmware} \ - %{?_without_vz} \ + --without-xenapi \ + --without-vz \ --without-bhyve \ %{?_without_interface} \ %{?_without_network} \ -- 2.5.5

Simplify conditionals to assume Fedora >= 20 or RHEL >= 6 The %prep section will explicitly check the version and refuse to run if insufficient. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 220 +++++++++++++------------------------------------------- 1 file changed, 48 insertions(+), 172 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index d907d8f..5737b88 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1,13 +1,12 @@ # -*- rpm-spec -*- -# This spec file assumes you are building for Fedora 13 or newer, -# or for RHEL 5 or newer. It may need some tweaks for other distros. +# This spec file assumes you are building for Fedora 20 or newer, +# or for RHEL 6 or newer. It may need some tweaks for other distros. # If neither fedora nor rhel was defined, try to guess them from dist -%if !0%{?rhel} && !0%{?fedora} -%{expand:%(echo "%{?dist}" | \ - sed -ne 's/^\.el\([0-9]\+\).*/%%define rhel \1/p')} -%{expand:%(echo "%{?dist}" | \ - sed -ne 's/^\.fc\?\([0-9]\+\).*/%%define fedora \1/p')} +%if (0%{?fedora} && 0%{?fedora} >= 20) || (0%{?rhel} && 0%{?rhel} >= 6) +%define supported_platform 1 +%else +%define supported_platform 0 %endif # Default to skipping autoreconf. Distros can change just this one line @@ -21,15 +20,6 @@ # of a command-line or ~/.rpmmacros override for client-only. %{!?client_only:%global client_only 0} -# Now turn off server build in certain cases - -# RHEL-5 builds are client-only for s390, ppc -%if 0%{?rhel} == 5 - %ifnarch %{ix86} x86_64 ia64 - %define client_only 1 - %endif -%endif - # Disable all server side drivers if client only build requested %if %{client_only} %define server_drivers 0 @@ -60,19 +50,7 @@ %define qemu_kvm_arches %{ix86} x86_64 %if 0%{?fedora} - %if 0%{?fedora} < 16 - # Fedora doesn't have any QEMU on ppc64 until FC16 - only ppc - # I think F17 is the first release with the power64 macro - %ifarch ppc64 - %define with_qemu_tcg 0 - %endif - %endif - %if 0%{?fedora} >= 18 - %define qemu_kvm_arches %{ix86} x86_64 %{power64} s390x - %endif - %if 0%{?fedora} >= 20 - %define qemu_kvm_arches %{ix86} x86_64 %{power64} s390x %{arm} aarch64 - %endif + %define qemu_kvm_arches %{ix86} x86_64 %{power64} s390x %{arm} aarch64 %endif %if 0%{?rhel} @@ -108,21 +86,17 @@ %define with_storage_iscsi 0%{!?_without_storage_iscsi:%{server_drivers}} %define with_storage_disk 0%{!?_without_storage_disk:%{server_drivers}} %define with_storage_mpath 0%{!?_without_storage_mpath:%{server_drivers}} -%if 0%{?fedora} >= 16 || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 7 %define with_storage_rbd 0%{!?_without_storage_rbd:%{server_drivers}} %else %define with_storage_rbd 0 %endif -%if 0%{?fedora} >= 17 +%if 0%{?fedora} %define with_storage_sheepdog 0%{!?_without_storage_sheepdog:%{server_drivers}} %else %define with_storage_sheepdog 0 %endif -%if 0%{?fedora} >= 19 || 0%{?rhel} >= 6 - %define with_storage_gluster 0%{!?_without_storage_gluster:%{server_drivers}} -%else - %define with_storage_gluster 0 -%endif +%define with_storage_gluster 0%{!?_without_storage_gluster:%{server_drivers}} %define with_numactl 0%{!?_without_numactl:%{server_drivers}} %define with_selinux 0%{!?_without_selinux:%{server_drivers}} @@ -178,7 +152,7 @@ # libgfapi is built only on x86_64 on rhel %ifnarch x86_64 - %if 0%{?rhel} >= 6 + %if 0%{?rhel} %define with_storage_gluster 0 %endif %endif @@ -207,48 +181,33 @@ # Fedora 17 / RHEL-7 are first where we use systemd. Although earlier # Fedora has systemd, libvirt still used sysvinit there. -%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 7 %define with_systemd 1 %define with_systemd_daemon 1 %define with_pm_utils 0 %endif # Fedora 18 / RHEL-7 are first where firewalld support is enabled -%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 7 %define with_firewalld 1 %endif -# RHEL-5 is too old for LXC -%if 0%{?rhel} == 5 - %define with_lxc 0 -%endif - # RHEL-6 stopped including Xen on all archs. -%if 0%{?rhel} >= 6 +%if 0%{?rhel} %define with_xen 0 %endif -# Fedora doesn't have new enough Xen for libxl until F18 -%if 0%{?fedora} && 0%{?fedora} < 18 - %define with_libxl 0 -%endif - # fuse is used to provide virtualized /proc for LXC -%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 7 %define with_fuse 0%{!?_without_fuse:1} %endif -# RHEL 5 lacks newer tools -%if 0%{?rhel} == 5 - %define with_hal 0%{!?_without_hal:%{server_drivers}} -%else - %define with_polkit 0%{!?_without_polkit:1} - %define with_capng 0%{!?_without_capng:1} - %define with_netcf 0%{!?_without_netcf:%{server_drivers}} - %define with_udev 0%{!?_without_udev:%{server_drivers}} - %define with_yajl 0%{!?_without_yajl:%{server_drivers}} - %define with_dtrace 1 -%endif +%define with_polkit 0%{!?_without_polkit:1} +%define with_capng 0%{!?_without_capng:1} +%define with_netcf 0%{!?_without_netcf:%{server_drivers}} +%define with_udev 0%{!?_without_udev:%{server_drivers}} +%define with_yajl 0%{!?_without_yajl:%{server_drivers}} +%define with_dtrace 1 # interface requires netcf %if ! 0%{?with_netcf} @@ -257,17 +216,17 @@ # Enable sanlock library for lock management with QEMU # Sanlock is available only on arches where kvm is available for RHEL -%if 0%{?fedora} >= 16 +%if 0%{?fedora} %define with_sanlock 0%{!?_without_sanlock:%{server_drivers}} %endif -%if 0%{?rhel} >= 6 +%if 0%{?rhel} %ifarch %{qemu_kvm_arches} %define with_sanlock 0%{!?_without_sanlock:%{server_drivers}} %endif %endif # Enable libssh2 transport for new enough distros -%if 0%{?fedora} >= 17 +%if 0%{?fedora} %define with_libssh2 0%{!?_without_libssh2:1} %endif @@ -304,10 +263,8 @@ # numad is used to manage the CPU and memory placement dynamically, # it's not available on s390[x] and ARM. - %if 0%{?fedora} >= 17 || 0%{?rhel} >= 6 - %ifnarch s390 s390x %{arm} - %define with_numad 0%{!?_without_numad:%{server_drivers}} - %endif + %ifnarch s390 s390x %{arm} + %define with_numad 0%{!?_without_numad:%{server_drivers}} %endif %endif @@ -316,10 +273,8 @@ %endif # Pull in cgroups config system -%if 0%{?fedora} || 0%{?rhel} >= 6 - %if %{with_qemu} || %{with_lxc} - %define with_cgconfig 0%{!?_without_cgconfig:1} - %endif +%if %{with_qemu} || %{with_lxc} + %define with_cgconfig 0%{!?_without_cgconfig:1} %endif %if %{with_udev} || %{with_hal} @@ -336,13 +291,8 @@ # Force QEMU to run as non-root -%if 0%{?fedora} || 0%{?rhel} >= 6 - %define qemu_user qemu - %define qemu_group qemu -%else - %define qemu_user root - %define qemu_group root -%endif +%define qemu_user qemu +%define qemu_group qemu # Advertise OVMF and AAVMF from nightly firmware repo @@ -351,15 +301,7 @@ %endif -# The RHEL-5 Xen package has some feature backports. This -# flag is set to enable use of those special bits on RHEL-5 -%if 0%{?rhel} == 5 - %define with_rhel5 1 -%else - %define with_rhel5 0 -%endif - -%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 7 %define with_systemd_macros 1 %else %define with_systemd_macros 0 @@ -460,7 +402,7 @@ BuildRequires: readline-devel BuildRequires: ncurses-devel BuildRequires: gettext BuildRequires: libtasn1-devel -%if (0%{?rhel} && 0%{?rhel} < 7) || (0%{?fedora} && 0%{?fedora} < 19) +%if (0%{?rhel} && 0%{?rhel} < 7) BuildRequires: libgcrypt-devel %endif BuildRequires: gnutls-devel @@ -469,15 +411,13 @@ BuildRequires: libattr-devel # For pool-build probing for existing pools BuildRequires: libblkid-devel >= 2.17 %endif -%if 0%{?fedora} || 0%{?rhel} >= 6 # for augparse, optionally used in testing BuildRequires: augeas -%endif %if %{with_hal} BuildRequires: hal-devel %endif %if %{with_udev} - %if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 + %if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: systemd-devel >= 185 %else BuildRequires: libudev-devel >= 145 @@ -488,23 +428,13 @@ BuildRequires: libpciaccess-devel >= 0.10.9 BuildRequires: yajl-devel %endif %if %{with_sanlock} -# make sure libvirt is built with new enough sanlock on -# distros that have it; required for on_lockfailure - %if 0%{?fedora} >= 17 || 0%{?rhel} >= 6 BuildRequires: sanlock-devel >= 2.4 - %else -BuildRequires: sanlock-devel >= 1.8 - %endif %endif %if %{with_libpcap} BuildRequires: libpcap-devel %endif %if %{with_libnl} - %if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 BuildRequires: libnl3-devel - %else -BuildRequires: libnl-devel - %endif %endif %if %{with_avahi} BuildRequires: avahi-devel @@ -518,7 +448,7 @@ BuildRequires: libapparmor-devel %if %{with_network} BuildRequires: dnsmasq >= 2.41 BuildRequires: iptables - %if (0%{?fedora} && 0%{?fedora} < 17) || (0%{?rhel} && 0%{?rhel} < 7) + %if 0%{?rhel} && 0%{?rhel} < 7 BuildRequires: iptables-ipv6 %endif BuildRequires: radvd @@ -531,16 +461,12 @@ BuildRequires: module-init-tools BuildRequires: cyrus-sasl-devel %endif %if %{with_polkit} - %if 0%{?fedora} >= 20 || 0%{?rhel} >= 7 + %if 0%{?fedora} || 0%{?rhel} >= 7 # F22 polkit-devel doesn't pull in polkit anymore, which we need for pkcheck BuildRequires: polkit >= 0.112 BuildRequires: polkit-devel >= 0.112 %else - %if 0%{?fedora} || 0%{?rhel} >= 6 BuildRequires: polkit-devel >= 0.93 - %else -BuildRequires: PolicyKit-devel >= 0.6 - %endif %endif %endif %if %{with_storage_fs} @@ -567,19 +493,10 @@ BuildRequires: iscsi-initiator-utils %if %{with_storage_disk} # For disk driver BuildRequires: parted-devel - %if 0%{?rhel} == 5 -# Broken RHEL-5 parted RPM is missing a dep -BuildRequires: e2fsprogs-devel - %endif %endif %if %{with_storage_mpath} || %{with_storage_disk} # For Multipath support - %if 0%{?rhel} == 5 -# Broken RHEL-5 packaging has header files in main RPM :-( -BuildRequires: device-mapper - %else BuildRequires: device-mapper-devel - %endif %endif %if %{with_storage_rbd} %if 0%{?rhel} >= 7 @@ -590,13 +507,8 @@ BuildRequires: ceph-devel %endif %endif %if %{with_storage_gluster} - %if 0%{?rhel} >= 6 -BuildRequires: glusterfs-api-devel >= 3.4.0 -BuildRequires: glusterfs-devel >= 3.4.0 - %else BuildRequires: glusterfs-api-devel >= 3.4.1 BuildRequires: glusterfs-devel >= 3.4.1 - %endif %endif %if %{with_numactl} # For QEMU/LXC numa info @@ -613,22 +525,14 @@ BuildRequires: libssh2-devel >= 1.3.0 %endif %if %{with_netcf} - %if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 + %if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: netcf-devel >= 0.2.2 %else - %if 0%{?fedora} >= 16 || 0%{?rhel} >= 6 BuildRequires: netcf-devel >= 0.1.8 - %else -BuildRequires: netcf-devel >= 0.1.4 - %endif %endif %endif %if %{with_esx} - %if 0%{?fedora} || 0%{?rhel} >= 6 BuildRequires: libcurl-devel - %else -BuildRequires: curl-devel - %endif %endif %if %{with_hyperv} BuildRequires: libwsman-devel >= 2.2.3 @@ -698,21 +602,13 @@ Requires: module-init-tools # for /sbin/ip & /sbin/tc Requires: iproute %if %{with_avahi} - %if 0%{?rhel} == 5 -Requires: avahi - %else Requires: avahi-libs - %endif %endif %if %{with_polkit} - %if 0%{?fedora} >= 20 || 0%{?rhel} >= 7 + %if 0%{?fedora} || 0%{?rhel} >= 7 Requires: polkit >= 0.112 %else - %if 0%{?fedora} || 0%{?rhel} >=6 Requires: polkit >= 0.93 - %else -Requires: PolicyKit >= 0.6 - %endif %endif %endif %if %{with_cgconfig} @@ -779,7 +675,7 @@ Requires: libvirt-daemon = %{version}-%{release} Requires: dnsmasq >= 2.41 Requires: radvd Requires: iptables - %if (0%{?fedora} && 0%{?fedora} < 17) || (0%{?rhel} && 0%{?rhel} < 7) + %if 0%{?rhel} && 0%{?rhel} < 7 Requires: iptables-ipv6 %endif @@ -796,7 +692,7 @@ Summary: Nwfilter driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} Requires: iptables - %if (0%{?fedora} && 0%{?fedora} < 17) || (0%{?rhel} && 0%{?rhel} < 7) + %if 0%{?rhel} && 0%{?rhel} < 7 Requires: iptables-ipv6 %endif Requires: ebtables @@ -818,7 +714,7 @@ Requires: libvirt-daemon = %{version}-%{release} Requires: hal %endif %if %{with_udev} - %if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 + %if 0%{?fedora} || 0%{?rhel} >= 7 Requires: systemd >= 185 %else Requires: udev >= 145 @@ -837,7 +733,7 @@ capabilities. Summary: Interface driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_netcf} && (0%{?fedora} >= 18 || 0%{?rhel} >= 7) + %if %{with_netcf} && (0%{?fedora} || 0%{?rhel} >= 7) Requires: netcf-libs >= 0.2.2 %endif @@ -1203,11 +1099,7 @@ Include header files & development libraries for the libvirt C library. %package lock-sanlock Summary: Sanlock lock manager plugin for QEMU driver Group: Development/Libraries - %if 0%{?fedora} >= 17 || 0%{?rhel} >= 6 Requires: sanlock >= 2.4 - %else -Requires: sanlock >= 1.8 - %endif #for virt-sanlock-cleanup require augeas Requires: augeas Requires: %{name}-daemon = %{version}-%{release} @@ -1230,6 +1122,11 @@ Libvirt plugin for NSS for translating domain names into IP addresses. %prep +%if ! %{supported_platform} +echo "This RPM requires either Fedora >= 20 or RHEL >= 6" +exit 1 +%endif + %setup -q # Patches have to be stored in a temporary file because RPM has @@ -1329,10 +1226,6 @@ rm -rf .git %define _without_uml --without-uml %endif -%if %{with_rhel5} - %define _with_rhel5_api --with-rhel5-api -%endif - %if ! %{with_interface} %define _without_interface --without-interface %endif @@ -1470,7 +1363,7 @@ rm -rf .git %endif %if %{with_selinux} - %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 + %if 0%{?fedora} || 0%{?rhel} >= 7 %define with_selinux_mount --with-selinux-mount="/sys/fs/selinux" %else %define with_selinux_mount --with-selinux-mount="/selinux" @@ -1504,7 +1397,6 @@ rm -f po/stamp-po --without-bhyve \ %{?_without_interface} \ %{?_without_network} \ - %{?_with_rhel5_api} \ %{?_without_storage_fs} \ %{?_without_storage_lvm} \ %{?_without_storage_iscsi} \ @@ -1638,10 +1530,6 @@ mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \ %endif %endif -%if 0%{?rhel} == 5 -rm -f $RPM_BUILD_ROOT%{_prefix}/lib/sysctl.d/60-libvirtd.conf -%endif - %clean rm -fr %{buildroot} @@ -1666,7 +1554,6 @@ fi %pre daemon %if ! %{with_driver_modules} %if %{with_qemu} - %if 0%{?fedora} || 0%{?rhel} >= 6 # We want soft static allocation of well-known ids, as disk images # are commonly shared across NFS mounts by id rather than name; see # https://fedoraproject.org/wiki/Packaging:UsersAndGroups @@ -1679,17 +1566,14 @@ if ! getent passwd qemu >/dev/null; then useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu fi fi - %endif %endif %endif %if %{with_polkit} - %if 0%{?fedora} || 0%{?rhel} >= 6 # 'libvirt' group is just to allow password-less polkit access to # libvirtd. The uid number is irrelevant, so we use dynamic allocation # described at the above link. getent group libvirt >/dev/null || groupadd -r libvirt - %endif %endif exit 0 @@ -1712,7 +1596,7 @@ fi %if %{with_cgconfig} # Starting with Fedora 16/RHEL-7, systemd automounts all cgroups, # and cgconfig is no longer a necessary service. - %if (0%{?rhel} && 0%{?rhel} < 7) || (0%{?fedora} && 0%{?fedora} < 16) + %if 0%{?rhel} && 0%{?rhel} < 7 if [ "$1" -eq "1" ]; then /sbin/chkconfig cgconfig on fi @@ -1864,7 +1748,6 @@ fi %if %{with_driver_modules} %if %{with_qemu} %pre daemon-driver-qemu - %if 0%{?fedora} || 0%{?rhel} >= 6 # We want soft static allocation of well-known ids, as disk images # are commonly shared across NFS mounts by id rather than name; see # https://fedoraproject.org/wiki/Packaging:UsersAndGroups @@ -1878,7 +1761,6 @@ if ! getent passwd qemu >/dev/null; then fi fi exit 0 - %endif %endif %endif %endif # %{with_libvirtd} @@ -1987,9 +1869,7 @@ exit 0 %config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf %config(noreplace) %{_sysconfdir}/libvirt/virtlogd.conf %config(noreplace) %{_sysconfdir}/libvirt/virtlockd.conf - %if 0%{?fedora} || 0%{?rhel} >= 6 %config(noreplace) %{_prefix}/lib/sysctl.d/60-libvirtd.conf - %endif %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd %dir %{_datadir}/libvirt/ @@ -2017,13 +1897,9 @@ exit 0 %endif %if %{with_polkit} - %if 0%{?fedora} || 0%{?rhel} >= 6 %{_datadir}/polkit-1/actions/org.libvirt.unix.policy %{_datadir}/polkit-1/actions/org.libvirt.api.policy %{_datadir}/polkit-1/rules.d/50-libvirt.rules - %else -%{_datadir}/PolicyKit/policy/org.libvirt.unix.policy - %endif %endif %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/ -- 2.5.5

A client only build dates back to RHEL5 where some architectures did not build the libvirtd daemon, only the clients. Since RHEL5 was dropped this is no longer required. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 71 +++++++++++++++++++++++---------------------------------- 1 file changed, 29 insertions(+), 42 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 5737b88..fb1cf7f 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -14,19 +14,6 @@ # touch configure.ac or Makefile.am. %{!?enable_autotools:%global enable_autotools 0} -# 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, but with the possibility -# of a command-line or ~/.rpmmacros override for client-only. -%{!?client_only:%global client_only 0} - -# Disable all server side drivers if client only build requested -%if %{client_only} - %define server_drivers 0 -%else - %define server_drivers 1 -%endif - # Always build with dlopen'd modules %define with_driver_modules 1 @@ -34,16 +21,16 @@ # of any particular OS # First the daemon itself -%define with_libvirtd 0%{!?_without_libvirtd:%{server_drivers}} -%define with_avahi 0%{!?_without_avahi:%{server_drivers}} +%define with_libvirtd 0%{!?_without_libvirtd:1} +%define with_avahi 0%{!?_without_avahi:1} # Then the hypervisor drivers that run in libvirtd -%define with_xen 0%{!?_without_xen:%{server_drivers}} -%define with_qemu 0%{!?_without_qemu:%{server_drivers}} -%define with_lxc 0%{!?_without_lxc:%{server_drivers}} -%define with_uml 0%{!?_without_uml:%{server_drivers}} -%define with_libxl 0%{!?_without_libxl:%{server_drivers}} -%define with_vbox 0%{!?_without_vbox:%{server_drivers}} +%define with_xen 0%{!?_without_xen:1} +%define with_qemu 0%{!?_without_qemu:1} +%define with_lxc 0%{!?_without_lxc:1} +%define with_uml 0%{!?_without_uml:1} +%define with_libxl 0%{!?_without_libxl:1} +%define with_vbox 0%{!?_without_vbox:1} %define with_qemu_tcg %{with_qemu} @@ -79,26 +66,26 @@ %define with_hyperv 0%{!?_without_hyperv:1} # Then the secondary host drivers, which run inside libvirtd -%define with_interface 0%{!?_without_interface:%{server_drivers}} -%define with_network 0%{!?_without_network:%{server_drivers}} -%define with_storage_fs 0%{!?_without_storage_fs:%{server_drivers}} -%define with_storage_lvm 0%{!?_without_storage_lvm:%{server_drivers}} -%define with_storage_iscsi 0%{!?_without_storage_iscsi:%{server_drivers}} -%define with_storage_disk 0%{!?_without_storage_disk:%{server_drivers}} -%define with_storage_mpath 0%{!?_without_storage_mpath:%{server_drivers}} +%define with_interface 0%{!?_without_interface:1} +%define with_network 0%{!?_without_network:1} +%define with_storage_fs 0%{!?_without_storage_fs:1} +%define with_storage_lvm 0%{!?_without_storage_lvm:1} +%define with_storage_iscsi 0%{!?_without_storage_iscsi:1} +%define with_storage_disk 0%{!?_without_storage_disk:1} +%define with_storage_mpath 0%{!?_without_storage_mpath:1} %if 0%{?fedora} || 0%{?rhel} >= 7 - %define with_storage_rbd 0%{!?_without_storage_rbd:%{server_drivers}} + %define with_storage_rbd 0%{!?_without_storage_rbd:1} %else %define with_storage_rbd 0 %endif %if 0%{?fedora} - %define with_storage_sheepdog 0%{!?_without_storage_sheepdog:%{server_drivers}} + %define with_storage_sheepdog 0%{!?_without_storage_sheepdog:1} %else %define with_storage_sheepdog 0 %endif -%define with_storage_gluster 0%{!?_without_storage_gluster:%{server_drivers}} -%define with_numactl 0%{!?_without_numactl:%{server_drivers}} -%define with_selinux 0%{!?_without_selinux:%{server_drivers}} +%define with_storage_gluster 0%{!?_without_storage_gluster:1} +%define with_numactl 0%{!?_without_numactl:1} +%define with_selinux 0%{!?_without_selinux:1} # Just hardcode to off, since few people ever have apparmor RPMs installed %define with_apparmor 0%{!?_without_apparmor:0} @@ -204,9 +191,9 @@ %define with_polkit 0%{!?_without_polkit:1} %define with_capng 0%{!?_without_capng:1} -%define with_netcf 0%{!?_without_netcf:%{server_drivers}} -%define with_udev 0%{!?_without_udev:%{server_drivers}} -%define with_yajl 0%{!?_without_yajl:%{server_drivers}} +%define with_netcf 0%{!?_without_netcf:1} +%define with_udev 0%{!?_without_udev:1} +%define with_yajl 0%{!?_without_yajl:1} %define with_dtrace 1 # interface requires netcf @@ -217,11 +204,11 @@ # Enable sanlock library for lock management with QEMU # Sanlock is available only on arches where kvm is available for RHEL %if 0%{?fedora} - %define with_sanlock 0%{!?_without_sanlock:%{server_drivers}} + %define with_sanlock 0%{!?_without_sanlock:1} %endif %if 0%{?rhel} %ifarch %{qemu_kvm_arches} - %define with_sanlock 0%{!?_without_sanlock:%{server_drivers}} + %define with_sanlock 0%{!?_without_sanlock:1} %endif %endif @@ -256,15 +243,15 @@ %endif %if %{with_qemu} || %{with_lxc} || %{with_uml} - %define with_nwfilter 0%{!?_without_nwfilter:%{server_drivers}} + %define with_nwfilter 0%{!?_without_nwfilter:1} # Enable libpcap library - %define with_libpcap 0%{!?_without_libpcap:%{server_drivers}} - %define with_macvtap 0%{!?_without_macvtap:%{server_drivers}} + %define with_libpcap 0%{!?_without_libpcap:1} + %define with_macvtap 0%{!?_without_macvtap:1} # numad is used to manage the CPU and memory placement dynamically, # it's not available on s390[x] and ARM. %ifnarch s390 s390x %{arm} - %define with_numad 0%{!?_without_numad:%{server_drivers}} + %define with_numad 0%{!?_without_numad:1} %endif %endif -- 2.5.5

Both RHEL and Fedora build with driver modules enabled by default, so there is no need for any conditional. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 305 ++++++++++++++++++-------------------------------------- 1 file changed, 97 insertions(+), 208 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index fb1cf7f..870780e 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -14,8 +14,6 @@ # touch configure.ac or Makefile.am. %{!?enable_autotools:%global enable_autotools 0} -# Always build with dlopen'd modules -%define with_driver_modules 1 # Now set the defaults for all the important features, independent # of any particular OS @@ -327,37 +325,35 @@ Requires: libvirt-daemon-config-network = %{version}-%{release} %if %{with_nwfilter} Requires: libvirt-daemon-config-nwfilter = %{version}-%{release} %endif - %if %{with_driver_modules} - %if %{with_libxl} + %if %{with_libxl} Requires: libvirt-daemon-driver-libxl = %{version}-%{release} - %endif - %if %{with_lxc} + %endif + %if %{with_lxc} Requires: libvirt-daemon-driver-lxc = %{version}-%{release} - %endif - %if %{with_qemu} + %endif + %if %{with_qemu} Requires: libvirt-daemon-driver-qemu = %{version}-%{release} - %endif - %if %{with_uml} + %endif + %if %{with_uml} Requires: libvirt-daemon-driver-uml = %{version}-%{release} - %endif - %if %{with_xen} + %endif + %if %{with_xen} Requires: libvirt-daemon-driver-xen = %{version}-%{release} - %endif - %if %{with_vbox} + %endif + %if %{with_vbox} Requires: libvirt-daemon-driver-vbox = %{version}-%{release} - %endif - %if %{with_nwfilter} + %endif + %if %{with_nwfilter} Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} - %endif + %endif - %if %{with_interface} + %if %{with_interface} Requires: libvirt-daemon-driver-interface = %{version}-%{release} - %endif + %endif Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-storage = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} - %endif %endif Requires: libvirt-client = %{version}-%{release} @@ -631,9 +627,7 @@ Summary: Default configuration files for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_driver_modules} Requires: libvirt-daemon-driver-network = %{version}-%{release} - %endif %description daemon-config-network Default configuration files for setting up NAT based networking @@ -645,16 +639,13 @@ Summary: Network filter configuration files for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_driver_modules} Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} - %endif %description daemon-config-nwfilter Network filter configuration files for cleaning guest traffic %endif - %if %{with_driver_modules} - %if %{with_network} + %if %{with_network} %package daemon-driver-network Summary: Network driver plugin for the libvirtd daemon Group: Development/Libraries @@ -662,73 +653,73 @@ Requires: libvirt-daemon = %{version}-%{release} Requires: dnsmasq >= 2.41 Requires: radvd Requires: iptables - %if 0%{?rhel} && 0%{?rhel} < 7 + %if 0%{?rhel} && 0%{?rhel} < 7 Requires: iptables-ipv6 - %endif + %endif %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. - %endif + %endif - %if %{with_nwfilter} + %if %{with_nwfilter} %package daemon-driver-nwfilter Summary: Nwfilter driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} Requires: iptables - %if 0%{?rhel} && 0%{?rhel} < 7 + %if 0%{?rhel} && 0%{?rhel} < 7 Requires: iptables-ipv6 - %endif + %endif Requires: ebtables %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 - %endif + %endif - %if %{with_nodedev} + %if %{with_nodedev} %package daemon-driver-nodedev Summary: Nodedev driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} # needed for device enumeration - %if %{with_hal} + %if %{with_hal} Requires: hal - %endif - %if %{with_udev} - %if 0%{?fedora} || 0%{?rhel} >= 7 + %endif + %if %{with_udev} + %if 0%{?fedora} || 0%{?rhel} >= 7 Requires: systemd >= 185 - %else + %else Requires: udev >= 145 - %endif %endif + %endif %description daemon-driver-nodedev The nodedev driver plugin for the libvirtd daemon, providing an implementation of the node device APIs using the udev capabilities. - %endif + %endif - %if %{with_interface} + %if %{with_interface} %package daemon-driver-interface Summary: Interface driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_netcf} && (0%{?fedora} || 0%{?rhel} >= 7) + %if %{with_netcf} && (0%{?fedora} || 0%{?rhel} >= 7) Requires: netcf-libs >= 0.2.2 - %endif + %endif %description daemon-driver-interface The interface driver plugin for the libvirtd daemon, providing an implementation of the network interface APIs using the netcf library - %endif + %endif %package daemon-driver-secret @@ -741,59 +732,59 @@ The secret driver plugin for the libvirtd daemon, providing an implementation of the secret key APIs. - %if %{with_storage} + %if %{with_storage} %package daemon-driver-storage Summary: Storage driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_storage_fs} + %if %{with_storage_fs} Requires: nfs-utils # For mkfs Requires: util-linux # For glusterfs - %if 0%{?fedora} + %if 0%{?fedora} Requires: glusterfs-client >= 2.0.1 - %endif %endif - %if %{with_storage_lvm} + %endif + %if %{with_storage_lvm} # For LVM drivers Requires: lvm2 - %endif - %if %{with_storage_iscsi} + %endif + %if %{with_storage_iscsi} # For ISCSI driver Requires: iscsi-initiator-utils - %endif - %if %{with_storage_disk} + %endif + %if %{with_storage_disk} # For disk driver Requires: parted Requires: device-mapper - %endif - %if %{with_storage_mpath} + %endif + %if %{with_storage_mpath} # For multipath support Requires: device-mapper - %endif - %if %{with_storage_sheepdog} + %endif + %if %{with_storage_sheepdog} # For Sheepdog support Requires: sheepdog - %endif - %if %{with_qemu} + %endif + %if %{with_qemu} # From QEMU RPMs Requires: /usr/bin/qemu-img - %else - %if %{with_xen} + %else + %if %{with_xen} # From Xen RPMs Requires: /usr/sbin/qcow-create - %endif %endif + %endif %description daemon-driver-storage The storage driver plugin for the libvirtd daemon, providing an implementation of the storage APIs using LVM, iSCSI, parted and more. - %endif + %endif - %if %{with_qemu} + %if %{with_qemu} %package daemon-driver-qemu Summary: Qemu driver plugin for the libvirtd daemon Group: Development/Libraries @@ -811,10 +802,10 @@ Requires: xz The qemu driver plugin for the libvirtd daemon, providing an implementation of the hypervisor driver APIs using QEMU - %endif + %endif - %if %{with_lxc} + %if %{with_lxc} %package daemon-driver-lxc Summary: LXC driver plugin for the libvirtd daemon Group: Development/Libraries @@ -826,10 +817,10 @@ Requires: libvirt-daemon-driver-network = %{version}-%{release} The LXC driver plugin for the libvirtd daemon, providing an implementation of the hypervisor driver APIs using the Linux kernel - %endif + %endif - %if %{with_uml} + %if %{with_uml} %package daemon-driver-uml Summary: Uml driver plugin for the libvirtd daemon Group: Development/Libraries @@ -839,10 +830,10 @@ Requires: libvirt-daemon = %{version}-%{release} The UML driver plugin for the libvirtd daemon, providing an implementation of the hypervisor driver APIs using User Mode Linux - %endif + %endif - %if %{with_xen} + %if %{with_xen} %package daemon-driver-xen Summary: Xen driver plugin for the libvirtd daemon Group: Development/Libraries @@ -852,10 +843,10 @@ Requires: libvirt-daemon = %{version}-%{release} The Xen driver plugin for the libvirtd daemon, providing an implementation of the hypervisor driver APIs using Xen - %endif + %endif - %if %{with_vbox} + %if %{with_vbox} %package daemon-driver-vbox Summary: VirtualBox driver plugin for the libvirtd daemon Group: Development/Libraries @@ -865,10 +856,10 @@ Requires: libvirt-daemon = %{version}-%{release} The vbox driver plugin for the libvirtd daemon, providing an implementation of the hypervisor driver APIs using VirtualBox - %endif + %endif - %if %{with_libxl} + %if %{with_libxl} %package daemon-driver-libxl Summary: Libxl driver plugin for the libvirtd daemon Group: Development/Libraries @@ -878,8 +869,7 @@ Requires: libvirt-daemon = %{version}-%{release} The Libxl driver plugin for the libvirtd daemon, providing an implementation of the hypervisor driver APIs using Libxl - %endif - %endif # %{with_driver_modules} + %endif @@ -889,7 +879,6 @@ Summary: Server side daemon & driver required to run QEMU guests Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_driver_modules} Requires: libvirt-daemon-driver-qemu = %{version}-%{release} Requires: libvirt-daemon-driver-interface = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} @@ -897,7 +886,6 @@ Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-storage = %{version}-%{release} - %endif Requires: qemu %description daemon-qemu @@ -912,7 +900,6 @@ Summary: Server side daemon & driver required to run KVM guests Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_driver_modules} Requires: libvirt-daemon-driver-qemu = %{version}-%{release} Requires: libvirt-daemon-driver-interface = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} @@ -920,7 +907,6 @@ Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-storage = %{version}-%{release} - %endif Requires: qemu-kvm %description daemon-kvm @@ -935,7 +921,6 @@ Summary: Server side daemon & driver required to run LXC guests Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_driver_modules} Requires: libvirt-daemon-driver-lxc = %{version}-%{release} Requires: libvirt-daemon-driver-interface = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} @@ -943,7 +928,6 @@ Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-storage = %{version}-%{release} - %endif %description daemon-lxc Server side daemon and driver required to manage the virtualization @@ -957,7 +941,6 @@ Summary: Server side daemon & driver required to run UML guests Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_driver_modules} Requires: libvirt-daemon-driver-uml = %{version}-%{release} Requires: libvirt-daemon-driver-interface = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} @@ -965,7 +948,6 @@ Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-storage = %{version}-%{release} - %endif # There are no UML kernel RPMs in Fedora/RHEL to depend on. %description daemon-uml @@ -980,20 +962,18 @@ Summary: Server side daemon & driver required to run XEN guests Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_driver_modules} - %if %{with_xen} + %if %{with_xen} Requires: libvirt-daemon-driver-xen = %{version}-%{release} - %endif - %if %{with_libxl} + %endif + %if %{with_libxl} Requires: libvirt-daemon-driver-libxl = %{version}-%{release} - %endif + %endif Requires: libvirt-daemon-driver-interface = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-storage = %{version}-%{release} - %endif Requires: xen %description daemon-xen @@ -1007,7 +987,6 @@ Summary: Server side daemon & driver required to run VirtualBox guests Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_driver_modules} Requires: libvirt-daemon-driver-vbox = %{version}-%{release} Requires: libvirt-daemon-driver-interface = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} @@ -1015,7 +994,6 @@ Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-storage = %{version}-%{release} - %endif %description daemon-vbox Server side daemon and driver required to manage the virtualization @@ -1313,10 +1291,6 @@ rm -rf .git %define _without_dtrace --without-dtrace %endif -%if ! %{with_driver_modules} - %define _without_driver_modules --without-driver-modules -%endif - %if %{with_firewalld} %define _with_firewalld --with-firewalld %endif @@ -1408,7 +1382,7 @@ rm -f po/stamp-po %{?_without_macvtap} \ %{?_without_audit} \ %{?_without_dtrace} \ - %{?_without_driver_modules} \ + --with-driver-modules \ %{?_with_firewalld} \ %{?_without_wireshark} \ %{?_without_systemd_daemon} \ @@ -1439,10 +1413,8 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/*.a rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/lock-driver/*.a -%if %{with_driver_modules} rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/libvirt/connection-driver/*.a -%endif %if %{with_wireshark} rm -f $RPM_BUILD_ROOT%{_libdir}/wireshark/plugins/*/libvirt.la mv $RPM_BUILD_ROOT%{_libdir}/wireshark/plugins/*/libvirt.so \ @@ -1539,23 +1511,6 @@ fi %if %{with_libvirtd} %pre daemon - %if ! %{with_driver_modules} - %if %{with_qemu} -# We want soft static allocation of well-known ids, as disk images -# are commonly shared across NFS mounts by id rather than name; see -# https://fedoraproject.org/wiki/Packaging:UsersAndGroups -getent group kvm >/dev/null || groupadd -f -g 36 -r kvm -getent group qemu >/dev/null || groupadd -f -g 107 -r qemu -if ! getent passwd qemu >/dev/null; then - if ! getent passwd 107 >/dev/null; then - useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu - else - useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu - fi -fi - %endif - %endif - %if %{with_polkit} # 'libvirt' group is just to allow password-less polkit access to # libvirtd. The uid number is irrelevant, so we use dynamic allocation @@ -1732,8 +1687,7 @@ fi /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || : %endif - %if %{with_driver_modules} - %if %{with_qemu} + %if %{with_qemu} %pre daemon-driver-qemu # We want soft static allocation of well-known ids, as disk images # are commonly shared across NFS mounts by id rather than name; see @@ -1748,7 +1702,6 @@ if ! getent passwd qemu >/dev/null; then fi fi exit 0 - %endif %endif %endif # %{with_libvirtd} @@ -1905,68 +1858,6 @@ exit 0 %{_mandir}/man8/virtlogd.8* %{_mandir}/man8/virtlockd.8* - %if ! %{with_driver_modules} - %if %{with_network} || %{with_qemu} -%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/ - %endif - %if %{with_network} || %{with_nwfilter} -%ghost %dir %{_localstatedir}/run/libvirt/network/ - %endif - %if %{with_network} -%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/ -%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/ -%attr(0755, root, root) %{_libexecdir}/libvirt_leaseshelper - %endif - %if %{with_nwfilter} -%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/ - %endif - %if %{with_storage_disk} -%attr(0755, root, root) %{_libexecdir}/libvirt_parthelper - %endif - %if %{with_qemu} -%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf -%config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf -%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu -%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/ -%ghost %dir %attr(0700, root, root) %{_localstatedir}/run/libvirt/qemu/ -%dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/ -%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libvirt/qemu/ -%{_datadir}/augeas/lenses/libvirtd_qemu.aug -%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug - %endif - %if %{with_lxc} -%config(noreplace) %{_sysconfdir}/libvirt/lxc.conf -%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc -%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/ -%ghost %dir %{_localstatedir}/run/libvirt/lxc/ -%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/lxc/ -%{_datadir}/augeas/lenses/libvirtd_lxc.aug -%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug -%attr(0755, root, root) %{_libexecdir}/libvirt_lxc - %endif - %if %{with_uml} -%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.uml -%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/ -%ghost %dir %{_localstatedir}/run/libvirt/uml/ -%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/uml/ - %endif - %if %{with_libxl} -%config(noreplace) %{_sysconfdir}/libvirt/libxl.conf -%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.libxl -%config(noreplace) %{_sysconfdir}/libvirt/libxl-lockd.conf -%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/ -%ghost %dir %{_localstatedir}/run/libvirt/libxl/ -%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/ -%{_datadir}/augeas/lenses/libvirtd_libxl.aug -%{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug - %endif - %if %{with_xen} -%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/xen/ - %endif - %endif # ! %{with_driver_modules} - %doc examples/polkit/*.rules %if %{with_network} @@ -1982,14 +1873,13 @@ exit 0 %{_sysconfdir}/libvirt/nwfilter/*.xml %endif - %if %{with_driver_modules} - %if %{with_interface} + %if %{with_interface} %files daemon-driver-interface %defattr(-, root, root) %{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so - %endif + %endif - %if %{with_network} + %if %{with_network} %files daemon-driver-network %defattr(-, root, root) %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/ @@ -2000,36 +1890,36 @@ exit 0 %dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/ %attr(0755, root, root) %{_libexecdir}/libvirt_leaseshelper %{_libdir}/%{name}/connection-driver/libvirt_driver_network.so - %endif + %endif - %if %{with_nodedev} + %if %{with_nodedev} %files daemon-driver-nodedev %defattr(-, root, root) %{_libdir}/%{name}/connection-driver/libvirt_driver_nodedev.so - %endif + %endif - %if %{with_nwfilter} + %if %{with_nwfilter} %files daemon-driver-nwfilter %defattr(-, root, root) %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/ %ghost %dir %{_localstatedir}/run/libvirt/network/ %{_libdir}/%{name}/connection-driver/libvirt_driver_nwfilter.so - %endif + %endif %files daemon-driver-secret %defattr(-, root, root) %{_libdir}/%{name}/connection-driver/libvirt_driver_secret.so - %if %{with_storage} + %if %{with_storage} %files daemon-driver-storage %defattr(-, root, root) - %if %{with_storage_disk} + %if %{with_storage_disk} %attr(0755, root, root) %{_libexecdir}/libvirt_parthelper - %endif -%{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so %endif +%{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so + %endif - %if %{with_qemu} + %if %{with_qemu} %files daemon-driver-qemu %defattr(-, root, root) %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/ @@ -2043,9 +1933,9 @@ exit 0 %{_datadir}/augeas/lenses/libvirtd_qemu.aug %{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug %{_libdir}/%{name}/connection-driver/libvirt_driver_qemu.so - %endif + %endif - %if %{with_lxc} + %if %{with_lxc} %files daemon-driver-lxc %defattr(-, root, root) %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/ @@ -2057,9 +1947,9 @@ exit 0 %{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug %attr(0755, root, root) %{_libexecdir}/libvirt_lxc %{_libdir}/%{name}/connection-driver/libvirt_driver_lxc.so - %endif + %endif - %if %{with_uml} + %if %{with_uml} %files daemon-driver-uml %defattr(-, root, root) %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/ @@ -2067,16 +1957,16 @@ exit 0 %ghost %dir %{_localstatedir}/run/libvirt/uml/ %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/uml/ %{_libdir}/%{name}/connection-driver/libvirt_driver_uml.so - %endif + %endif - %if %{with_xen} + %if %{with_xen} %files daemon-driver-xen %defattr(-, root, root) %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/xen/ %{_libdir}/%{name}/connection-driver/libvirt_driver_xen.so - %endif + %endif - %if %{with_libxl} + %if %{with_libxl} %files daemon-driver-libxl %defattr(-, root, root) %config(noreplace) %{_sysconfdir}/libvirt/libxl.conf @@ -2088,14 +1978,13 @@ exit 0 %ghost %dir %{_localstatedir}/run/libvirt/libxl/ %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/ %{_libdir}/%{name}/connection-driver/libvirt_driver_libxl.so - %endif + %endif - %if %{with_vbox} + %if %{with_vbox} %files daemon-driver-vbox %defattr(-, root, root) %{_libdir}/%{name}/connection-driver/libvirt_driver_vbox.so - %endif - %endif # %{with_driver_modules} + %endif %if %{with_qemu_tcg} %files daemon-qemu -- 2.5.5

Both RHEL and Fedora build with libvirtd enabled at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 419 ++++++++++++++++++++++++++------------------------------ 1 file changed, 192 insertions(+), 227 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 870780e..4d70ded 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -18,8 +18,6 @@ # Now set the defaults for all the important features, independent # of any particular OS -# First the daemon itself -%define with_libvirtd 0%{!?_without_libvirtd:1} %define with_avahi 0%{!?_without_avahi:1} # Then the hypervisor drivers that run in libvirtd @@ -220,25 +218,6 @@ %define with_wireshark 0%{!?_without_wireshark:1} %endif -# Disable some drivers when building without libvirt daemon. -# The logic is the same as in configure.ac -%if ! %{with_libvirtd} - %define with_interface 0 - %define with_network 0 - %define with_qemu 0 - %define with_lxc 0 - %define with_uml 0 - %define with_hal 0 - %define with_udev 0 - %define with_storage_fs 0 - %define with_storage_lvm 0 - %define with_storage_iscsi 0 - %define with_storage_mpath 0 - %define with_storage_rbd 0 - %define with_storage_sheepdog 0 - %define with_storage_gluster 0 - %define with_storage_disk 0 -%endif %if %{with_qemu} || %{with_lxc} || %{with_uml} %define with_nwfilter 0%{!?_without_nwfilter:1} @@ -317,44 +296,42 @@ URL: http://libvirt.org/ %endif Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.gz -%if %{with_libvirtd} Requires: libvirt-daemon = %{version}-%{release} - %if %{with_network} +%if %{with_network} Requires: libvirt-daemon-config-network = %{version}-%{release} - %endif - %if %{with_nwfilter} +%endif +%if %{with_nwfilter} Requires: libvirt-daemon-config-nwfilter = %{version}-%{release} - %endif - %if %{with_libxl} +%endif +%if %{with_libxl} Requires: libvirt-daemon-driver-libxl = %{version}-%{release} - %endif - %if %{with_lxc} +%endif +%if %{with_lxc} Requires: libvirt-daemon-driver-lxc = %{version}-%{release} - %endif - %if %{with_qemu} +%endif +%if %{with_qemu} Requires: libvirt-daemon-driver-qemu = %{version}-%{release} - %endif - %if %{with_uml} +%endif +%if %{with_uml} Requires: libvirt-daemon-driver-uml = %{version}-%{release} - %endif - %if %{with_xen} +%endif +%if %{with_xen} Requires: libvirt-daemon-driver-xen = %{version}-%{release} - %endif - %if %{with_vbox} +%endif +%if %{with_vbox} Requires: libvirt-daemon-driver-vbox = %{version}-%{release} - %endif - %if %{with_nwfilter} +%endif +%if %{with_nwfilter} Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} - %endif +%endif - %if %{with_interface} +%if %{with_interface} Requires: libvirt-daemon-driver-interface = %{version}-%{release} - %endif +%endif Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-storage = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} -%endif Requires: libvirt-client = %{version}-%{release} # All build-time requirements. Run-time requirements are @@ -390,10 +367,8 @@ BuildRequires: libgcrypt-devel %endif BuildRequires: gnutls-devel BuildRequires: libattr-devel -%if %{with_libvirtd} # For pool-build probing for existing pools BuildRequires: libblkid-devel >= 2.17 -%endif # for augparse, optionally used in testing BuildRequires: augeas %if %{with_hal} @@ -569,7 +544,6 @@ Group: Development/Libraries Includes the API reference for the libvirt C library, and a complete copy of the libvirt.org website documentation. -%if %{with_libvirtd} %package daemon Summary: Server side daemon and supporting files for libvirt library Group: Development/Libraries @@ -584,33 +558,33 @@ Requires: %{name}-client = %{version}-%{release} Requires: module-init-tools # for /sbin/ip & /sbin/tc Requires: iproute - %if %{with_avahi} +%if %{with_avahi} Requires: avahi-libs - %endif - %if %{with_polkit} - %if 0%{?fedora} || 0%{?rhel} >= 7 +%endif +%if %{with_polkit} + %if 0%{?fedora} || 0%{?rhel} >= 7 Requires: polkit >= 0.112 - %else + %else Requires: polkit >= 0.93 - %endif %endif - %if %{with_cgconfig} +%endif +%if %{with_cgconfig} Requires: libcgroup - %endif - %ifarch %{ix86} x86_64 ia64 +%endif +%ifarch %{ix86} x86_64 ia64 # For virConnectGetSysinfo Requires: dmidecode - %endif +%endif # For service management - %if %{with_systemd} +%if %{with_systemd} Requires(post): systemd-units Requires(post): systemd-sysv Requires(preun): systemd-units Requires(postun): systemd-units - %endif - %if %{with_numad} +%endif +%if %{with_numad} Requires: numad - %endif +%endif # libvirtd depends on 'messagebus' service Requires: dbus # For uid creation during pre @@ -621,7 +595,7 @@ Server side daemon required to manage the virtualization capabilities of recent versions of Linux. Requires a hypervisor specific sub-RPM for specific drivers. - %if %{with_network} +%if %{with_network} %package daemon-config-network Summary: Default configuration files for the libvirtd daemon Group: Development/Libraries @@ -631,9 +605,9 @@ Requires: libvirt-daemon-driver-network = %{version}-%{release} %description daemon-config-network Default configuration files for setting up NAT based networking - %endif +%endif - %if %{with_nwfilter} +%if %{with_nwfilter} %package daemon-config-nwfilter Summary: Network filter configuration files for the libvirtd daemon Group: Development/Libraries @@ -643,9 +617,9 @@ Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} %description daemon-config-nwfilter Network filter configuration files for cleaning guest traffic - %endif +%endif - %if %{with_network} +%if %{with_network} %package daemon-driver-network Summary: Network driver plugin for the libvirtd daemon Group: Development/Libraries @@ -653,73 +627,73 @@ Requires: libvirt-daemon = %{version}-%{release} Requires: dnsmasq >= 2.41 Requires: radvd Requires: iptables - %if 0%{?rhel} && 0%{?rhel} < 7 + %if 0%{?rhel} && 0%{?rhel} < 7 Requires: iptables-ipv6 - %endif + %endif %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. - %endif +%endif - %if %{with_nwfilter} +%if %{with_nwfilter} %package daemon-driver-nwfilter Summary: Nwfilter driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} Requires: iptables - %if 0%{?rhel} && 0%{?rhel} < 7 + %if 0%{?rhel} && 0%{?rhel} < 7 Requires: iptables-ipv6 - %endif + %endif Requires: ebtables %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 - %endif +%endif - %if %{with_nodedev} +%if %{with_nodedev} %package daemon-driver-nodedev Summary: Nodedev driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} # needed for device enumeration - %if %{with_hal} + %if %{with_hal} Requires: hal - %endif - %if %{with_udev} - %if 0%{?fedora} || 0%{?rhel} >= 7 + %endif + %if %{with_udev} + %if 0%{?fedora} || 0%{?rhel} >= 7 Requires: systemd >= 185 - %else + %else Requires: udev >= 145 - %endif %endif + %endif %description daemon-driver-nodedev The nodedev driver plugin for the libvirtd daemon, providing an implementation of the node device APIs using the udev capabilities. - %endif +%endif - %if %{with_interface} +%if %{with_interface} %package daemon-driver-interface Summary: Interface driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_netcf} && (0%{?fedora} || 0%{?rhel} >= 7) + %if %{with_netcf} && (0%{?fedora} || 0%{?rhel} >= 7) Requires: netcf-libs >= 0.2.2 - %endif + %endif %description daemon-driver-interface The interface driver plugin for the libvirtd daemon, providing an implementation of the network interface APIs using the netcf library - %endif +%endif %package daemon-driver-secret @@ -732,59 +706,59 @@ The secret driver plugin for the libvirtd daemon, providing an implementation of the secret key APIs. - %if %{with_storage} +%if %{with_storage} %package daemon-driver-storage Summary: Storage driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_storage_fs} + %if %{with_storage_fs} Requires: nfs-utils # For mkfs Requires: util-linux # For glusterfs - %if 0%{?fedora} + %if 0%{?fedora} Requires: glusterfs-client >= 2.0.1 - %endif %endif - %if %{with_storage_lvm} + %endif + %if %{with_storage_lvm} # For LVM drivers Requires: lvm2 - %endif - %if %{with_storage_iscsi} + %endif + %if %{with_storage_iscsi} # For ISCSI driver Requires: iscsi-initiator-utils - %endif - %if %{with_storage_disk} + %endif + %if %{with_storage_disk} # For disk driver Requires: parted Requires: device-mapper - %endif - %if %{with_storage_mpath} + %endif + %if %{with_storage_mpath} # For multipath support Requires: device-mapper - %endif - %if %{with_storage_sheepdog} + %endif + %if %{with_storage_sheepdog} # For Sheepdog support Requires: sheepdog - %endif - %if %{with_qemu} + %endif + %if %{with_qemu} # From QEMU RPMs Requires: /usr/bin/qemu-img - %else - %if %{with_xen} + %else + %if %{with_xen} # From Xen RPMs Requires: /usr/sbin/qcow-create - %endif %endif + %endif %description daemon-driver-storage The storage driver plugin for the libvirtd daemon, providing an implementation of the storage APIs using LVM, iSCSI, parted and more. - %endif +%endif - %if %{with_qemu} +%if %{with_qemu} %package daemon-driver-qemu Summary: Qemu driver plugin for the libvirtd daemon Group: Development/Libraries @@ -802,10 +776,10 @@ Requires: xz The qemu driver plugin for the libvirtd daemon, providing an implementation of the hypervisor driver APIs using QEMU - %endif +%endif - %if %{with_lxc} +%if %{with_lxc} %package daemon-driver-lxc Summary: LXC driver plugin for the libvirtd daemon Group: Development/Libraries @@ -817,10 +791,10 @@ Requires: libvirt-daemon-driver-network = %{version}-%{release} The LXC driver plugin for the libvirtd daemon, providing an implementation of the hypervisor driver APIs using the Linux kernel - %endif +%endif - %if %{with_uml} +%if %{with_uml} %package daemon-driver-uml Summary: Uml driver plugin for the libvirtd daemon Group: Development/Libraries @@ -830,10 +804,10 @@ Requires: libvirt-daemon = %{version}-%{release} The UML driver plugin for the libvirtd daemon, providing an implementation of the hypervisor driver APIs using User Mode Linux - %endif +%endif - %if %{with_xen} +%if %{with_xen} %package daemon-driver-xen Summary: Xen driver plugin for the libvirtd daemon Group: Development/Libraries @@ -843,10 +817,10 @@ Requires: libvirt-daemon = %{version}-%{release} The Xen driver plugin for the libvirtd daemon, providing an implementation of the hypervisor driver APIs using Xen - %endif +%endif - %if %{with_vbox} +%if %{with_vbox} %package daemon-driver-vbox Summary: VirtualBox driver plugin for the libvirtd daemon Group: Development/Libraries @@ -856,10 +830,10 @@ Requires: libvirt-daemon = %{version}-%{release} The vbox driver plugin for the libvirtd daemon, providing an implementation of the hypervisor driver APIs using VirtualBox - %endif +%endif - %if %{with_libxl} +%if %{with_libxl} %package daemon-driver-libxl Summary: Libxl driver plugin for the libvirtd daemon Group: Development/Libraries @@ -869,11 +843,11 @@ Requires: libvirt-daemon = %{version}-%{release} The Libxl driver plugin for the libvirtd daemon, providing an implementation of the hypervisor driver APIs using Libxl - %endif +%endif - %if %{with_qemu_tcg} +%if %{with_qemu_tcg} %package daemon-qemu Summary: Server side daemon & driver required to run QEMU guests Group: Development/Libraries @@ -891,10 +865,10 @@ Requires: qemu %description daemon-qemu Server side daemon and driver required to manage the virtualization capabilities of the QEMU TCG emulators - %endif +%endif - %if %{with_qemu_kvm} +%if %{with_qemu_kvm} %package daemon-kvm Summary: Server side daemon & driver required to run KVM guests Group: Development/Libraries @@ -912,10 +886,10 @@ Requires: qemu-kvm %description daemon-kvm Server side daemon and driver required to manage the virtualization capabilities of the KVM hypervisor - %endif +%endif - %if %{with_lxc} +%if %{with_lxc} %package daemon-lxc Summary: Server side daemon & driver required to run LXC guests Group: Development/Libraries @@ -932,10 +906,10 @@ Requires: libvirt-daemon-driver-storage = %{version}-%{release} %description daemon-lxc Server side daemon and driver required to manage the virtualization capabilities of LXC - %endif +%endif - %if %{with_uml} +%if %{with_uml} %package daemon-uml Summary: Server side daemon & driver required to run UML guests Group: Development/Libraries @@ -953,21 +927,21 @@ Requires: libvirt-daemon-driver-storage = %{version}-%{release} %description daemon-uml Server side daemon and driver required to manage the virtualization capabilities of UML - %endif +%endif - %if %{with_xen} || %{with_libxl} +%if %{with_xen} || %{with_libxl} %package daemon-xen Summary: Server side daemon & driver required to run XEN guests Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_xen} + %if %{with_xen} Requires: libvirt-daemon-driver-xen = %{version}-%{release} - %endif - %if %{with_libxl} + %endif + %if %{with_libxl} Requires: libvirt-daemon-driver-libxl = %{version}-%{release} - %endif + %endif Requires: libvirt-daemon-driver-interface = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} Requires: libvirt-daemon-driver-nodedev = %{version}-%{release} @@ -979,9 +953,9 @@ Requires: xen %description daemon-xen Server side daemon and driver required to manage the virtualization capabilities of XEN - %endif +%endif - %if %{with_vbox} +%if %{with_vbox} %package daemon-vbox Summary: Server side daemon & driver required to run VirtualBox guests Group: Development/Libraries @@ -998,8 +972,7 @@ Requires: libvirt-daemon-driver-storage = %{version}-%{release} %description daemon-vbox Server side daemon and driver required to manage the virtualization capabilities of VirtualBox - %endif -%endif # %{with_libvirtd} +%endif %package client Summary: Client side library and utilities of the libvirt library @@ -1183,10 +1156,6 @@ rm -rf .git %define _without_polkit --without-polkit %endif -%if ! %{with_libvirtd} - %define _without_libvirtd --without-libvirtd -%endif - %if ! %{with_uml} %define _without_uml --without-uml %endif @@ -1347,7 +1316,7 @@ rm -f po/stamp-po %{?_without_sasl} \ %{?_without_avahi} \ %{?_without_polkit} \ - %{?_without_libvirtd} \ + --with-libvirtd \ %{?_without_uml} \ %{?_without_phyp} \ %{?_without_esx} \ @@ -1509,23 +1478,22 @@ then exit 1 fi -%if %{with_libvirtd} %pre daemon - %if %{with_polkit} +%if %{with_polkit} # 'libvirt' group is just to allow password-less polkit access to # libvirtd. The uid number is irrelevant, so we use dynamic allocation # described at the above link. getent group libvirt >/dev/null || groupadd -r libvirt - %endif +%endif exit 0 %post daemon - %if %{with_systemd} - %if %{with_systemd_macros} - %systemd_post virtlockd.socket virtlogd.socket libvirtd.service - %else +%if %{with_systemd} + %if %{with_systemd_macros} + %systemd_post virtlockd.socket virtlogd.socket libvirtd.service + %else if [ $1 -eq 1 ] ; then # Initial installation /bin/systemctl enable \ @@ -1533,28 +1501,28 @@ if [ $1 -eq 1 ] ; then virtlogd.socket \ libvirtd.service >/dev/null 2>&1 || : fi - %endif - %else - %if %{with_cgconfig} + %endif +%else + %if %{with_cgconfig} # Starting with Fedora 16/RHEL-7, systemd automounts all cgroups, # and cgconfig is no longer a necessary service. - %if 0%{?rhel} && 0%{?rhel} < 7 + %if 0%{?rhel} && 0%{?rhel} < 7 if [ "$1" -eq "1" ]; then /sbin/chkconfig cgconfig on fi - %endif %endif + %endif /sbin/chkconfig --add libvirtd /sbin/chkconfig --add virtlogd /sbin/chkconfig --add virtlockd - %endif +%endif %preun daemon - %if %{with_systemd} - %if %{with_systemd_macros} - %systemd_preun libvirtd.service virtlogd.socket virtlogd.service virtlockd.socket virtlockd.service - %else +%if %{with_systemd} + %if %{with_systemd_macros} + %systemd_preun libvirtd.service virtlogd.socket virtlogd.service virtlockd.socket virtlockd.service + %else if [ $1 -eq 0 ] ; then # Package removal, not upgrade /bin/systemctl --no-reload disable \ @@ -1570,8 +1538,8 @@ if [ $1 -eq 0 ] ; then virtlockd.socket \ virtlockd.service > /dev/null 2>&1 || : fi - %endif - %else + %endif +%else if [ $1 = 0 ]; then /sbin/service libvirtd stop 1>/dev/null 2>&1 /sbin/chkconfig --del libvirtd @@ -1580,33 +1548,33 @@ if [ $1 = 0 ]; then /sbin/service virtlockd stop 1>/dev/null 2>&1 /sbin/chkconfig --del virtlockd fi - %endif +%endif %postun daemon - %if %{with_systemd} +%if %{with_systemd} /bin/systemctl daemon-reload >/dev/null 2>&1 || : if [ $1 -ge 1 ] ; then /bin/systemctl reload-or-try-restart virtlockd.service >/dev/null 2>&1 || : /bin/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || : /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || : fi - %else +%else if [ $1 -ge 1 ]; then /sbin/service virtlockd reload > /dev/null 2>&1 || : /sbin/service virtlogd reload > /dev/null 2>&1 || : /sbin/service libvirtd condrestart > /dev/null 2>&1 fi - %endif +%endif - %if %{with_systemd} - %else +%if %{with_systemd} +%else %triggerpostun daemon -- libvirt-daemon < 1.2.1 if [ "$1" -ge "1" ]; then /sbin/service virtlockd reload > /dev/null 2>&1 || : /sbin/service virtlogd reload > /dev/null 2>&1 || : /sbin/service libvirtd condrestart > /dev/null 2>&1 fi - %endif +%endif # In upgrade scenario we must explicitly enable virtlockd/virtlogd # sockets, if libvirtd is already enabled and start them if @@ -1614,20 +1582,20 @@ fi # guests %triggerpostun daemon -- libvirt-daemon < 1.3.0 if [ $1 -ge 1 ] ; then - %if %{with_systemd} +%if %{with_systemd} /bin/systemctl is-enabled libvirtd.service 1>/dev/null 2>&1 && /bin/systemctl enable virtlogd.socket || : /bin/systemctl is-active libvirtd.service 1>/dev/null 2>&1 && /bin/systemctl start virtlogd.socket || : - %else +%else /sbin/chkconfig libvirtd 1>/dev/null 2>&1 && /sbin/chkconfig virtlogd on || : /sbin/service libvirtd status 1>/dev/null 2>&1 && /sbin/service virtlogd start || : - %endif +%endif fi - %if %{with_network} +%if %{with_network} %post daemon-config-network if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; then # see if the network used by default network creates a conflict, @@ -1666,16 +1634,16 @@ if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml # Make sure libvirt picks up the new network defininiton - %if %{with_systemd} + %if %{with_systemd} /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 ||: - %else + %else /sbin/service libvirtd condrestart > /dev/null 2>&1 || : - %endif + %endif fi - %endif +%endif - %if %{with_systemd} +%if %{with_systemd} %triggerun -- libvirt < 0.9.4 %{_bindir}/systemd-sysv-convert --save libvirtd >/dev/null 2>&1 ||: @@ -1685,9 +1653,9 @@ fi # Run these because the SysV package being removed won't do them /sbin/chkconfig --del libvirtd >/dev/null 2>&1 || : /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 || : - %endif +%endif - %if %{with_qemu} +%if %{with_qemu} %pre daemon-driver-qemu # We want soft static allocation of well-known ids, as disk images # are commonly shared across NFS mounts by id rather than name; see @@ -1702,8 +1670,7 @@ if ! getent passwd qemu >/dev/null; then fi fi exit 0 - %endif -%endif # %{with_libvirtd} +%endif %preun client @@ -1785,23 +1752,22 @@ exit 0 %doc examples/systemtap -%if %{with_libvirtd} %files daemon %defattr(-, root, root) %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/ - %if %{with_systemd} +%if %{with_systemd} %{_unitdir}/libvirtd.service %{_unitdir}/virtlogd.service %{_unitdir}/virtlogd.socket %{_unitdir}/virtlockd.service %{_unitdir}/virtlockd.socket - %else +%else %{_sysconfdir}/rc.d/init.d/libvirtd %{_sysconfdir}/rc.d/init.d/virtlogd %{_sysconfdir}/rc.d/init.d/virtlockd - %endif +%endif %doc daemon/libvirtd.upstart %config(noreplace) %{_sysconfdir}/sysconfig/libvirtd %config(noreplace) %{_sysconfdir}/sysconfig/virtlogd @@ -1832,23 +1798,23 @@ exit 0 %{_datadir}/augeas/lenses/virtlockd.aug %{_datadir}/augeas/lenses/tests/test_virtlockd.aug %{_datadir}/augeas/lenses/libvirt_lockd.aug - %if %{with_qemu} +%if %{with_qemu} %{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug - %endif +%endif - %if %{with_polkit} +%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 +%endif %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/ %attr(0755, root, root) %{_libexecdir}/libvirt_iohelper - %if %{with_apparmor} +%if %{with_apparmor} %attr(0755, root, root) %{_libexecdir}/virt-aa-helper - %endif +%endif %attr(0755, root, root) %{_sbindir}/libvirtd %attr(0755, root, root) %{_sbindir}/virtlogd @@ -1860,26 +1826,26 @@ exit 0 %doc examples/polkit/*.rules - %if %{with_network} +%if %{with_network} %files daemon-config-network %defattr(-, root, root) %dir %{_datadir}/libvirt/networks/ %{_datadir}/libvirt/networks/default.xml - %endif +%endif - %if %{with_nwfilter} +%if %{with_nwfilter} %files daemon-config-nwfilter %defattr(-, root, root) %{_sysconfdir}/libvirt/nwfilter/*.xml - %endif +%endif - %if %{with_interface} +%if %{with_interface} %files daemon-driver-interface %defattr(-, root, root) %{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so - %endif +%endif - %if %{with_network} +%if %{with_network} %files daemon-driver-network %defattr(-, root, root) %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/ @@ -1890,36 +1856,36 @@ exit 0 %dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/ %attr(0755, root, root) %{_libexecdir}/libvirt_leaseshelper %{_libdir}/%{name}/connection-driver/libvirt_driver_network.so - %endif +%endif - %if %{with_nodedev} +%if %{with_nodedev} %files daemon-driver-nodedev %defattr(-, root, root) %{_libdir}/%{name}/connection-driver/libvirt_driver_nodedev.so - %endif +%endif - %if %{with_nwfilter} +%if %{with_nwfilter} %files daemon-driver-nwfilter %defattr(-, root, root) %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/ %ghost %dir %{_localstatedir}/run/libvirt/network/ %{_libdir}/%{name}/connection-driver/libvirt_driver_nwfilter.so - %endif +%endif %files daemon-driver-secret %defattr(-, root, root) %{_libdir}/%{name}/connection-driver/libvirt_driver_secret.so - %if %{with_storage} +%if %{with_storage} %files daemon-driver-storage %defattr(-, root, root) - %if %{with_storage_disk} + %if %{with_storage_disk} %attr(0755, root, root) %{_libexecdir}/libvirt_parthelper - %endif -%{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so %endif +%{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so +%endif - %if %{with_qemu} +%if %{with_qemu} %files daemon-driver-qemu %defattr(-, root, root) %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/ @@ -1933,9 +1899,9 @@ exit 0 %{_datadir}/augeas/lenses/libvirtd_qemu.aug %{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug %{_libdir}/%{name}/connection-driver/libvirt_driver_qemu.so - %endif +%endif - %if %{with_lxc} +%if %{with_lxc} %files daemon-driver-lxc %defattr(-, root, root) %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/ @@ -1947,9 +1913,9 @@ exit 0 %{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug %attr(0755, root, root) %{_libexecdir}/libvirt_lxc %{_libdir}/%{name}/connection-driver/libvirt_driver_lxc.so - %endif +%endif - %if %{with_uml} +%if %{with_uml} %files daemon-driver-uml %defattr(-, root, root) %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/ @@ -1957,16 +1923,16 @@ exit 0 %ghost %dir %{_localstatedir}/run/libvirt/uml/ %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/uml/ %{_libdir}/%{name}/connection-driver/libvirt_driver_uml.so - %endif +%endif - %if %{with_xen} +%if %{with_xen} %files daemon-driver-xen %defattr(-, root, root) %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/xen/ %{_libdir}/%{name}/connection-driver/libvirt_driver_xen.so - %endif +%endif - %if %{with_libxl} +%if %{with_libxl} %files daemon-driver-libxl %defattr(-, root, root) %config(noreplace) %{_sysconfdir}/libvirt/libxl.conf @@ -1978,44 +1944,43 @@ exit 0 %ghost %dir %{_localstatedir}/run/libvirt/libxl/ %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/ %{_libdir}/%{name}/connection-driver/libvirt_driver_libxl.so - %endif +%endif - %if %{with_vbox} +%if %{with_vbox} %files daemon-driver-vbox %defattr(-, root, root) %{_libdir}/%{name}/connection-driver/libvirt_driver_vbox.so - %endif +%endif - %if %{with_qemu_tcg} +%if %{with_qemu_tcg} %files daemon-qemu %defattr(-, root, root) - %endif +%endif - %if %{with_qemu_kvm} +%if %{with_qemu_kvm} %files daemon-kvm %defattr(-, root, root) - %endif +%endif - %if %{with_lxc} +%if %{with_lxc} %files daemon-lxc %defattr(-, root, root) - %endif +%endif - %if %{with_uml} +%if %{with_uml} %files daemon-uml %defattr(-, root, root) - %endif +%endif - %if %{with_xen} || %{with_libxl} +%if %{with_xen} || %{with_libxl} %files daemon-xen %defattr(-, root, root) - %endif +%endif - %if %{with_vbox} +%if %{with_vbox} %files daemon-vbox %defattr(-, root, root) - %endif -%endif # %{with_libvirtd} +%endif %if %{with_sanlock} %files lock-sanlock -- 2.5.5

Both RHEL and Fedora build with avahi enabled at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 4d70ded..6e597f1 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -15,12 +15,7 @@ %{!?enable_autotools:%global enable_autotools 0} -# Now set the defaults for all the important features, independent -# of any particular OS - -%define with_avahi 0%{!?_without_avahi:1} - -# Then the hypervisor drivers that run in libvirtd +# The hypervisor drivers that run in libvirtd %define with_xen 0%{!?_without_xen:1} %define with_qemu 0%{!?_without_qemu:1} %define with_lxc 0%{!?_without_lxc:1} @@ -394,9 +389,7 @@ BuildRequires: libpcap-devel %if %{with_libnl} BuildRequires: libnl3-devel %endif -%if %{with_avahi} BuildRequires: avahi-devel -%endif %if %{with_selinux} BuildRequires: libselinux-devel %endif @@ -558,9 +551,7 @@ Requires: %{name}-client = %{version}-%{release} Requires: module-init-tools # for /sbin/ip & /sbin/tc Requires: iproute -%if %{with_avahi} Requires: avahi-libs -%endif %if %{with_polkit} %if 0%{?fedora} || 0%{?rhel} >= 7 Requires: polkit >= 0.112 @@ -1132,10 +1123,6 @@ rm -rf .git %define _without_sasl --without-sasl %endif -%if ! %{with_avahi} - %define _without_avahi --without-avahi -%endif - %if ! %{with_phyp} %define _without_phyp --without-phyp %endif @@ -1314,7 +1301,7 @@ rm -f po/stamp-po %{?_without_vbox} \ %{?_without_libxl} \ %{?_without_sasl} \ - %{?_without_avahi} \ + --with-avahi \ %{?_without_polkit} \ --with-libvirtd \ %{?_without_uml} \ -- 2.5.5

Neither RHEL or Fedora build HAL anymore. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 6e597f1..9ada4d4 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -87,7 +87,6 @@ %define with_fuse 0%{!?_without_fuse:0} %define with_netcf 0%{!?_without_netcf:0} %define with_udev 0%{!?_without_udev:0} -%define with_hal 0%{!?_without_hal:0} %define with_yajl 0%{!?_without_yajl:0} %define with_nwfilter 0%{!?_without_nwfilter:0} %define with_libpcap 0%{!?_without_libpcap:0} @@ -236,7 +235,7 @@ %define with_cgconfig 0%{!?_without_cgconfig:1} %endif -%if %{with_udev} || %{with_hal} +%if %{with_udev} %define with_nodedev 1 %else %define with_nodedev 0 @@ -366,9 +365,6 @@ BuildRequires: libattr-devel BuildRequires: libblkid-devel >= 2.17 # for augparse, optionally used in testing BuildRequires: augeas -%if %{with_hal} -BuildRequires: hal-devel -%endif %if %{with_udev} %if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: systemd-devel >= 185 @@ -653,9 +649,6 @@ Summary: Nodedev driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} # needed for device enumeration - %if %{with_hal} -Requires: hal - %endif %if %{with_udev} %if 0%{?fedora} || 0%{?rhel} >= 7 Requires: systemd >= 185 @@ -1215,10 +1208,6 @@ rm -rf .git %define _without_apparmor --without-apparmor %endif -%if ! %{with_hal} - %define _without_hal --without-hal -%endif - %if ! %{with_udev} %define _without_udev --without-udev %endif @@ -1330,7 +1319,7 @@ rm -f po/stamp-po %{?_without_selinux} \ %{?_with_selinux_mount} \ %{?_without_apparmor} \ - %{?_without_hal} \ + --without-hal \ %{?_without_udev} \ %{?_without_yajl} \ %{?_without_sanlock} \ -- 2.5.5

Neither RHEL or Fedora build apparmor Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 9ada4d4..9b3221f 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -78,9 +78,6 @@ %define with_numactl 0%{!?_without_numactl:1} %define with_selinux 0%{!?_without_selinux:1} -# Just hardcode to off, since few people ever have apparmor RPMs installed -%define with_apparmor 0%{!?_without_apparmor:0} - # A few optional bits off by default, we enable later %define with_polkit 0%{!?_without_polkit:0} %define with_capng 0%{!?_without_capng:0} @@ -389,9 +386,6 @@ BuildRequires: avahi-devel %if %{with_selinux} BuildRequires: libselinux-devel %endif -%if %{with_apparmor} -BuildRequires: libapparmor-devel -%endif %if %{with_network} BuildRequires: dnsmasq >= 2.41 BuildRequires: iptables @@ -1204,10 +1198,6 @@ rm -rf .git %define _without_selinux --without-selinux %endif -%if ! %{with_apparmor} - %define _without_apparmor --without-apparmor -%endif - %if ! %{with_udev} %define _without_udev --without-udev %endif @@ -1318,7 +1308,7 @@ rm -f po/stamp-po %{?_without_netcf} \ %{?_without_selinux} \ %{?_with_selinux_mount} \ - %{?_without_apparmor} \ + --without-apparmor \ --without-hal \ %{?_without_udev} \ %{?_without_yajl} \ @@ -1788,10 +1778,6 @@ exit 0 %attr(0755, root, root) %{_libexecdir}/libvirt_iohelper -%if %{with_apparmor} -%attr(0755, root, root) %{_libexecdir}/virt-aa-helper -%endif - %attr(0755, root, root) %{_sbindir}/libvirtd %attr(0755, root, root) %{_sbindir}/virtlogd %attr(0755, root, root) %{_sbindir}/virtlockd -- 2.5.5

Both RHEL and Fedora build with capng enabled at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 9b3221f..760763a 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -80,7 +80,6 @@ # A few optional bits off by default, we enable later %define with_polkit 0%{!?_without_polkit:0} -%define with_capng 0%{!?_without_capng:0} %define with_fuse 0%{!?_without_fuse:0} %define with_netcf 0%{!?_without_netcf:0} %define with_udev 0%{!?_without_udev:0} @@ -177,7 +176,6 @@ %endif %define with_polkit 0%{!?_without_polkit:1} -%define with_capng 0%{!?_without_capng:1} %define with_netcf 0%{!?_without_netcf:1} %define with_udev 0%{!?_without_udev:1} %define with_yajl 0%{!?_without_yajl:1} @@ -455,9 +453,7 @@ BuildRequires: glusterfs-devel >= 3.4.1 # For QEMU/LXC numa info BuildRequires: numactl-devel %endif -%if %{with_capng} BuildRequires: libcap-ng-devel >= 0.5.0 -%endif %if %{with_fuse} BuildRequires: fuse-devel >= 2.8.6 %endif @@ -1182,10 +1178,6 @@ rm -rf .git %define _without_numad --without-numad %endif -%if ! %{with_capng} - %define _without_capng --without-capng -%endif - %if ! %{with_fuse} %define _without_fuse --without-fuse %endif @@ -1303,7 +1295,7 @@ rm -f po/stamp-po %{?_without_storage_gluster} \ %{?_without_numactl} \ %{?_without_numad} \ - %{?_without_capng} \ + --with-capng \ %{?_without_fuse} \ %{?_without_netcf} \ %{?_without_selinux} \ -- 2.5.5

Both RHEL and Fedora build with udev enabled at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 760763a..87aecef 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -82,7 +82,6 @@ %define with_polkit 0%{!?_without_polkit:0} %define with_fuse 0%{!?_without_fuse:0} %define with_netcf 0%{!?_without_netcf:0} -%define with_udev 0%{!?_without_udev:0} %define with_yajl 0%{!?_without_yajl:0} %define with_nwfilter 0%{!?_without_nwfilter:0} %define with_libpcap 0%{!?_without_libpcap:0} @@ -177,7 +176,6 @@ %define with_polkit 0%{!?_without_polkit:1} %define with_netcf 0%{!?_without_netcf:1} -%define with_udev 0%{!?_without_udev:1} %define with_yajl 0%{!?_without_yajl:1} %define with_dtrace 1 @@ -230,11 +228,7 @@ %define with_cgconfig 0%{!?_without_cgconfig:1} %endif -%if %{with_udev} - %define with_nodedev 1 -%else - %define with_nodedev 0 -%endif +%define with_nodedev 1 %if %{with_storage_fs} || %{with_storage_mpath} || %{with_storage_iscsi} || %{with_storage_lvm} || %{with_storage_disk} %define with_storage 1 @@ -360,14 +354,12 @@ BuildRequires: libattr-devel BuildRequires: libblkid-devel >= 2.17 # for augparse, optionally used in testing BuildRequires: augeas -%if %{with_udev} - %if 0%{?fedora} || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: systemd-devel >= 185 - %else +%else BuildRequires: libudev-devel >= 145 - %endif -BuildRequires: libpciaccess-devel >= 0.10.9 %endif +BuildRequires: libpciaccess-devel >= 0.10.9 %if %{with_yajl} BuildRequires: yajl-devel %endif @@ -639,13 +631,12 @@ Summary: Nodedev driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} # needed for device enumeration - %if %{with_udev} - %if 0%{?fedora} || 0%{?rhel} >= 7 + %if 0%{?fedora} || 0%{?rhel} >= 7 Requires: systemd >= 185 - %else + %else Requires: udev >= 145 - %endif %endif +%endif %description daemon-driver-nodedev The nodedev driver plugin for the libvirtd daemon, providing @@ -1190,10 +1181,6 @@ rm -rf .git %define _without_selinux --without-selinux %endif -%if ! %{with_udev} - %define _without_udev --without-udev -%endif - %if ! %{with_yajl} %define _without_yajl --without-yajl %endif @@ -1302,7 +1289,7 @@ rm -f po/stamp-po %{?_with_selinux_mount} \ --without-apparmor \ --without-hal \ - %{?_without_udev} \ + --with-udev \ %{?_without_yajl} \ %{?_without_sanlock} \ %{?_without_libpcap} \ -- 2.5.5

Both RHEL and Fedora build with netcf enabled at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 87aecef..6abe3a2 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -81,7 +81,6 @@ # A few optional bits off by default, we enable later %define with_polkit 0%{!?_without_polkit:0} %define with_fuse 0%{!?_without_fuse:0} -%define with_netcf 0%{!?_without_netcf:0} %define with_yajl 0%{!?_without_yajl:0} %define with_nwfilter 0%{!?_without_nwfilter:0} %define with_libpcap 0%{!?_without_libpcap:0} @@ -175,15 +174,9 @@ %endif %define with_polkit 0%{!?_without_polkit:1} -%define with_netcf 0%{!?_without_netcf:1} %define with_yajl 0%{!?_without_yajl:1} %define with_dtrace 1 -# interface requires netcf -%if ! 0%{?with_netcf} - %define with_interface 0 -%endif - # Enable sanlock library for lock management with QEMU # Sanlock is available only on arches where kvm is available for RHEL %if 0%{?fedora} @@ -453,12 +446,10 @@ BuildRequires: fuse-devel >= 2.8.6 BuildRequires: libssh2-devel >= 1.3.0 %endif -%if %{with_netcf} - %if 0%{?fedora} || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 7 BuildRequires: netcf-devel >= 0.2.2 - %else +%else BuildRequires: netcf-devel >= 0.1.8 - %endif %endif %if %{with_esx} BuildRequires: libcurl-devel @@ -650,7 +641,7 @@ capabilities. Summary: Interface driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_netcf} && (0%{?fedora} || 0%{?rhel} >= 7) + %if (0%{?fedora} || 0%{?rhel} >= 7) Requires: netcf-libs >= 0.2.2 %endif @@ -1173,10 +1164,6 @@ rm -rf .git %define _without_fuse --without-fuse %endif -%if ! %{with_netcf} - %define _without_netcf --without-netcf -%endif - %if ! %{with_selinux} %define _without_selinux --without-selinux %endif @@ -1284,7 +1271,7 @@ rm -f po/stamp-po %{?_without_numad} \ --with-capng \ %{?_without_fuse} \ - %{?_without_netcf} \ + --with-netcf \ %{?_without_selinux} \ %{?_with_selinux_mount} \ --without-apparmor \ -- 2.5.5

Both RHEL and Fedora build with audit enabled at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 6abe3a2..5c397d3 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -99,7 +99,6 @@ # Non-server/HV driver defaults which are always enabled %define with_sasl 0%{!?_without_sasl:1} -%define with_audit 0%{!?_without_audit:1} %define with_nss_plugin 0%{!?_without_nss_plugin:1} @@ -457,9 +456,7 @@ BuildRequires: libcurl-devel %if %{with_hyperv} BuildRequires: libwsman-devel >= 2.2.3 %endif -%if %{with_audit} BuildRequires: audit-libs-devel -%endif %if %{with_dtrace} # we need /usr/sbin/dtrace BuildRequires: systemtap-sdt-devel @@ -1184,10 +1181,6 @@ rm -rf .git %define _without_macvtap --without-macvtap %endif -%if ! %{with_audit} - %define _without_audit --without-audit -%endif - %if ! %{with_dtrace} %define _without_dtrace --without-dtrace %endif @@ -1281,7 +1274,7 @@ rm -f po/stamp-po %{?_without_sanlock} \ %{?_without_libpcap} \ %{?_without_macvtap} \ - %{?_without_audit} \ + --with-audit \ %{?_without_dtrace} \ --with-driver-modules \ %{?_with_firewalld} \ -- 2.5.5

Both RHEL and Fedora build with dtrace enabled at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 5c397d3..c07821a 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -86,7 +86,6 @@ %define with_libpcap 0%{!?_without_libpcap:0} %define with_macvtap 0%{!?_without_macvtap:0} %define with_libnl 0%{!?_without_libnl:0} -%define with_dtrace 0%{!?_without_dtrace:0} %define with_cgconfig 0%{!?_without_cgconfig:0} %define with_sanlock 0%{!?_without_sanlock:0} %define with_systemd 0%{!?_without_systemd:0} @@ -174,7 +173,6 @@ %define with_polkit 0%{!?_without_polkit:1} %define with_yajl 0%{!?_without_yajl:1} -%define with_dtrace 1 # Enable sanlock library for lock management with QEMU # Sanlock is available only on arches where kvm is available for RHEL @@ -457,10 +455,8 @@ BuildRequires: libcurl-devel BuildRequires: libwsman-devel >= 2.2.3 %endif BuildRequires: audit-libs-devel -%if %{with_dtrace} # we need /usr/sbin/dtrace BuildRequires: systemtap-sdt-devel -%endif %if %{with_storage_fs} # For mount/umount in FS driver @@ -1181,10 +1177,6 @@ rm -rf .git %define _without_macvtap --without-macvtap %endif -%if ! %{with_dtrace} - %define _without_dtrace --without-dtrace -%endif - %if %{with_firewalld} %define _with_firewalld --with-firewalld %endif @@ -1275,7 +1267,7 @@ rm -f po/stamp-po %{?_without_libpcap} \ %{?_without_macvtap} \ --with-audit \ - %{?_without_dtrace} \ + --with-dtrace \ --with-driver-modules \ %{?_with_firewalld} \ %{?_without_wireshark} \ @@ -1374,13 +1366,11 @@ rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.uml # Copied into libvirt-docs subpackage eventually mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-%{version} libvirt-docs -%if %{with_dtrace} - %ifarch %{power64} s390x x86_64 ia64 alpha sparc64 +%ifarch %{power64} s390x x86_64 ia64 alpha sparc64 mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes.stp \ $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_probes-64.stp mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \ $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes-64.stp - %endif %endif %clean @@ -1939,11 +1929,9 @@ exit 0 %{_libdir}/libvirt-lxc.so.* %{_libdir}/libvirt-admin.so.* -%if %{with_dtrace} %{_datadir}/systemtap/tapset/libvirt_probes*.stp %{_datadir}/systemtap/tapset/libvirt_qemu_probes*.stp %{_datadir}/systemtap/tapset/libvirt_functions.stp -%endif %dir %{_datadir}/libvirt/ %dir %{_datadir}/libvirt/schemas/ -- 2.5.5

Both RHEL and Fedora build with sasl enabled at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index c07821a..f2b83b6 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -97,7 +97,6 @@ %define with_pm_utils 1 # Non-server/HV driver defaults which are always enabled -%define with_sasl 0%{!?_without_sasl:1} %define with_nss_plugin 0%{!?_without_nss_plugin:1} @@ -378,9 +377,7 @@ BuildRequires: radvd BuildRequires: ebtables %endif BuildRequires: module-init-tools -%if %{with_sasl} BuildRequires: cyrus-sasl-devel -%endif %if %{with_polkit} %if 0%{?fedora} || 0%{?rhel} >= 7 # F22 polkit-devel doesn't pull in polkit anymore, which we need for pkcheck @@ -939,12 +936,10 @@ Requires: gnutls-utils # Needed for probing the power management features of the host. Requires: pm-utils %endif -%if %{with_sasl} Requires: cyrus-sasl # Not technically required, but makes 'out-of-box' config # work correctly & doesn't have onerous dependencies Requires: cyrus-sasl-md5 -%endif %description client Shared libraries and client binaries needed to access to the @@ -1077,10 +1072,6 @@ rm -rf .git %define _without_libxl --without-libxl %endif -%if ! %{with_sasl} - %define _without_sasl --without-sasl -%endif - %if ! %{with_phyp} %define _without_phyp --without-phyp %endif @@ -1230,7 +1221,7 @@ rm -f po/stamp-po %{?_without_lxc} \ %{?_without_vbox} \ %{?_without_libxl} \ - %{?_without_sasl} \ + --with-sasl \ --with-avahi \ %{?_without_polkit} \ --with-libvirtd \ @@ -1964,9 +1955,7 @@ exit 0 %attr(0755, root, root) %{_libexecdir}/libvirt-guests.sh %dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/ -%if %{with_sasl} %config(noreplace) %{_sysconfdir}/sasl2/libvirt.conf -%endif %if %{with_wireshark} %files wireshark -- 2.5.5

Both RHEL and Fedora build with polkit enabled at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index f2b83b6..01c7b6a 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -79,7 +79,6 @@ %define with_selinux 0%{!?_without_selinux:1} # A few optional bits off by default, we enable later -%define with_polkit 0%{!?_without_polkit:0} %define with_fuse 0%{!?_without_fuse:0} %define with_yajl 0%{!?_without_yajl:0} %define with_nwfilter 0%{!?_without_nwfilter:0} @@ -170,7 +169,6 @@ %define with_fuse 0%{!?_without_fuse:1} %endif -%define with_polkit 0%{!?_without_polkit:1} %define with_yajl 0%{!?_without_yajl:1} # Enable sanlock library for lock management with QEMU @@ -378,14 +376,12 @@ BuildRequires: ebtables %endif BuildRequires: module-init-tools BuildRequires: cyrus-sasl-devel -%if %{with_polkit} - %if 0%{?fedora} || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 7 # F22 polkit-devel doesn't pull in polkit anymore, which we need for pkcheck BuildRequires: polkit >= 0.112 BuildRequires: polkit-devel >= 0.112 - %else +%else BuildRequires: polkit-devel >= 0.93 - %endif %endif %if %{with_storage_fs} # For mount/umount in FS driver @@ -462,10 +458,8 @@ BuildRequires: util-linux BuildRequires: nfs-utils %endif -%if %{with_firewalld} || %{with_polkit} # Communication with the firewall and polkit daemons use DBus BuildRequires: dbus-devel -%endif # Fedora build root suckage BuildRequires: gawk @@ -511,12 +505,10 @@ Requires: module-init-tools # for /sbin/ip & /sbin/tc Requires: iproute Requires: avahi-libs -%if %{with_polkit} - %if 0%{?fedora} || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 7 Requires: polkit >= 0.112 - %else +%else Requires: polkit >= 0.93 - %endif %endif %if %{with_cgconfig} Requires: libcgroup @@ -1088,10 +1080,6 @@ rm -rf .git %define _without_vmware --without-vmware %endif -%if ! %{with_polkit} - %define _without_polkit --without-polkit -%endif - %if ! %{with_uml} %define _without_uml --without-uml %endif @@ -1223,7 +1211,7 @@ rm -f po/stamp-po %{?_without_libxl} \ --with-sasl \ --with-avahi \ - %{?_without_polkit} \ + --with-polkit \ --with-libvirtd \ %{?_without_uml} \ %{?_without_phyp} \ @@ -1385,12 +1373,10 @@ then fi %pre daemon -%if %{with_polkit} # 'libvirt' group is just to allow password-less polkit access to # libvirtd. The uid number is irrelevant, so we use dynamic allocation # described at the above link. getent group libvirt >/dev/null || groupadd -r libvirt -%endif exit 0 @@ -1708,11 +1694,9 @@ exit 0 %{_datadir}/augeas/lenses/tests/test_libvirt_lockd.aug %endif -%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 %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/ -- 2.5.5

Both RHEL and Fedora build with yajl enabled at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 01c7b6a..224e235 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -80,7 +80,6 @@ # A few optional bits off by default, we enable later %define with_fuse 0%{!?_without_fuse:0} -%define with_yajl 0%{!?_without_yajl:0} %define with_nwfilter 0%{!?_without_nwfilter:0} %define with_libpcap 0%{!?_without_libpcap:0} %define with_macvtap 0%{!?_without_macvtap:0} @@ -169,8 +168,6 @@ %define with_fuse 0%{!?_without_fuse:1} %endif -%define with_yajl 0%{!?_without_yajl:1} - # Enable sanlock library for lock management with QEMU # Sanlock is available only on arches where kvm is available for RHEL %if 0%{?fedora} @@ -347,9 +344,7 @@ BuildRequires: systemd-devel >= 185 BuildRequires: libudev-devel >= 145 %endif BuildRequires: libpciaccess-devel >= 0.10.9 -%if %{with_yajl} BuildRequires: yajl-devel -%endif %if %{with_sanlock} BuildRequires: sanlock-devel >= 2.4 %endif @@ -1140,10 +1135,6 @@ rm -rf .git %define _without_selinux --without-selinux %endif -%if ! %{with_yajl} - %define _without_yajl --without-yajl -%endif - %if ! %{with_sanlock} %define _without_sanlock --without-sanlock %endif @@ -1241,7 +1232,7 @@ rm -f po/stamp-po --without-apparmor \ --without-hal \ --with-udev \ - %{?_without_yajl} \ + --with-yajl \ %{?_without_sanlock} \ %{?_without_libpcap} \ %{?_without_macvtap} \ -- 2.5.5

Both RHEL and Fedora build with selinux enabled at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 224e235..71c1794 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -76,7 +76,6 @@ %endif %define with_storage_gluster 0%{!?_without_storage_gluster:1} %define with_numactl 0%{!?_without_numactl:1} -%define with_selinux 0%{!?_without_selinux:1} # A few optional bits off by default, we enable later %define with_fuse 0%{!?_without_fuse:0} @@ -355,9 +354,7 @@ BuildRequires: libpcap-devel BuildRequires: libnl3-devel %endif BuildRequires: avahi-devel -%if %{with_selinux} BuildRequires: libselinux-devel -%endif %if %{with_network} BuildRequires: dnsmasq >= 2.41 BuildRequires: iptables @@ -1131,10 +1128,6 @@ rm -rf .git %define _without_fuse --without-fuse %endif -%if ! %{with_selinux} - %define _without_selinux --without-selinux -%endif - %if ! %{with_sanlock} %define _without_sanlock --without-sanlock %endif @@ -1179,12 +1172,10 @@ rm -rf .git %define with_init_script --with-init-script=redhat %endif -%if %{with_selinux} - %if 0%{?fedora} || 0%{?rhel} >= 7 - %define with_selinux_mount --with-selinux-mount="/sys/fs/selinux" - %else - %define with_selinux_mount --with-selinux-mount="/selinux" - %endif +%if 0%{?fedora} || 0%{?rhel} >= 7 + %define with_selinux_mount --with-selinux-mount="/sys/fs/selinux" +%else + %define with_selinux_mount --with-selinux-mount="/selinux" %endif # place macros above and build commands below this comment @@ -1227,7 +1218,7 @@ rm -f po/stamp-po --with-capng \ %{?_without_fuse} \ --with-netcf \ - %{?_without_selinux} \ + --with-selinux \ %{?_with_selinux_mount} \ --without-apparmor \ --without-hal \ -- 2.5.5

Both RHEL and Fedora build with the interface driver enabled at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 71c1794..7d9b398 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -57,7 +57,6 @@ %define with_hyperv 0%{!?_without_hyperv:1} # Then the secondary host drivers, which run inside libvirtd -%define with_interface 0%{!?_without_interface:1} %define with_network 0%{!?_without_network:1} %define with_storage_fs 0%{!?_without_storage_fs:1} %define with_storage_lvm 0%{!?_without_storage_lvm:1} @@ -291,9 +290,7 @@ Requires: libvirt-daemon-driver-vbox = %{version}-%{release} Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} %endif -%if %{with_interface} Requires: libvirt-daemon-driver-interface = %{version}-%{release} -%endif Requires: libvirt-daemon-driver-secret = %{version}-%{release} Requires: libvirt-daemon-driver-storage = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release} @@ -610,20 +607,18 @@ capabilities. %endif -%if %{with_interface} %package daemon-driver-interface Summary: Interface driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if (0%{?fedora} || 0%{?rhel} >= 7) +%if (0%{?fedora} || 0%{?rhel} >= 7) Requires: netcf-libs >= 0.2.2 - %endif +%endif %description daemon-driver-interface The interface driver plugin for the libvirtd daemon, providing an implementation of the network interface APIs using the netcf library -%endif %package daemon-driver-secret @@ -1076,10 +1071,6 @@ rm -rf .git %define _without_uml --without-uml %endif -%if ! %{with_interface} - %define _without_interface --without-interface -%endif - %if ! %{with_network} %define _without_network --without-network %endif @@ -1203,7 +1194,7 @@ rm -f po/stamp-po --without-xenapi \ --without-vz \ --without-bhyve \ - %{?_without_interface} \ + --with-interface \ %{?_without_network} \ %{?_without_storage_fs} \ %{?_without_storage_lvm} \ @@ -1707,11 +1698,9 @@ exit 0 %{_sysconfdir}/libvirt/nwfilter/*.xml %endif -%if %{with_interface} %files daemon-driver-interface %defattr(-, root, root) %{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so -%endif %if %{with_network} %files daemon-driver-network @@ -1724,7 +1713,6 @@ exit 0 %dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/ %attr(0755, root, root) %{_libexecdir}/libvirt_leaseshelper %{_libdir}/%{name}/connection-driver/libvirt_driver_network.so -%endif %if %{with_nodedev} %files daemon-driver-nodedev -- 2.5.5

Both RHEL and Fedora build with the network driver enabled at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 39 ++++++++------------------------------- 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 7d9b398..69c6af4 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -57,7 +57,6 @@ %define with_hyperv 0%{!?_without_hyperv:1} # Then the secondary host drivers, which run inside libvirtd -%define with_network 0%{!?_without_network:1} %define with_storage_fs 0%{!?_without_storage_fs:1} %define with_storage_lvm 0%{!?_without_storage_lvm:1} %define with_storage_iscsi 0%{!?_without_storage_iscsi:1} @@ -262,9 +261,7 @@ URL: http://libvirt.org/ Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.gz Requires: libvirt-daemon = %{version}-%{release} -%if %{with_network} Requires: libvirt-daemon-config-network = %{version}-%{release} -%endif %if %{with_nwfilter} Requires: libvirt-daemon-config-nwfilter = %{version}-%{release} %endif @@ -352,14 +349,12 @@ BuildRequires: libnl3-devel %endif BuildRequires: avahi-devel BuildRequires: libselinux-devel -%if %{with_network} BuildRequires: dnsmasq >= 2.41 BuildRequires: iptables - %if 0%{?rhel} && 0%{?rhel} < 7 +%if 0%{?rhel} && 0%{?rhel} < 7 BuildRequires: iptables-ipv6 - %endif -BuildRequires: radvd %endif +BuildRequires: radvd %if %{with_nwfilter} BuildRequires: ebtables %endif @@ -526,7 +521,6 @@ Server side daemon required to manage the virtualization capabilities of recent versions of Linux. Requires a hypervisor specific sub-RPM for specific drivers. -%if %{with_network} %package daemon-config-network Summary: Default configuration files for the libvirtd daemon Group: Development/Libraries @@ -536,7 +530,6 @@ Requires: libvirt-daemon-driver-network = %{version}-%{release} %description daemon-config-network Default configuration files for setting up NAT based networking -%endif %if %{with_nwfilter} %package daemon-config-nwfilter @@ -550,7 +543,6 @@ Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} Network filter configuration files for cleaning guest traffic %endif -%if %{with_network} %package daemon-driver-network Summary: Network driver plugin for the libvirtd daemon Group: Development/Libraries @@ -558,15 +550,14 @@ Requires: libvirt-daemon = %{version}-%{release} Requires: dnsmasq >= 2.41 Requires: radvd Requires: iptables - %if 0%{?rhel} && 0%{?rhel} < 7 +%if 0%{?rhel} && 0%{?rhel} < 7 Requires: iptables-ipv6 - %endif +%endif %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. -%endif %if %{with_nwfilter} @@ -1071,10 +1062,6 @@ rm -rf .git %define _without_uml --without-uml %endif -%if ! %{with_network} - %define _without_network --without-network -%endif - %if ! %{with_storage_fs} %define _without_storage_fs --without-storage-fs %endif @@ -1195,7 +1182,7 @@ rm -f po/stamp-po --without-vz \ --without-bhyve \ --with-interface \ - %{?_without_network} \ + --with-network \ %{?_without_storage_fs} \ %{?_without_storage_lvm} \ %{?_without_storage_iscsi} \ @@ -1265,7 +1252,6 @@ rm -f $RPM_BUILD_ROOT%{_bindir}/virt-admin rm -f $RPM_BUILD_ROOT%{_mandir}/man1/virt-admin.1* rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/libvirt-admin.conf -%if %{with_network} install -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/lib/libvirt/dnsmasq/ # We don't want to install /etc/libvirt/qemu/networks in the main %files list # because if the admin wants to delete the default network completely, we don't @@ -1277,10 +1263,6 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml # Strip auto-generated UUID - we need it generated per-install sed -i -e "/<uuid>/d" $RPM_BUILD_ROOT%{_datadir}/libvirt/networks/default.xml -%else -rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/default.xml -rm -f $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml -%endif %if ! %{with_qemu} rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug @@ -1460,7 +1442,6 @@ if [ $1 -ge 1 ] ; then %endif fi -%if %{with_network} %post daemon-config-network if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; then # see if the network used by default network creates a conflict, @@ -1499,14 +1480,13 @@ if test $1 -eq 1 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ; ln -s ../default.xml %{_sysconfdir}/libvirt/qemu/networks/autostart/default.xml # Make sure libvirt picks up the new network defininiton - %if %{with_systemd} +%if %{with_systemd} /bin/systemctl try-restart libvirtd.service >/dev/null 2>&1 ||: - %else +%else /sbin/service libvirtd condrestart > /dev/null 2>&1 || : - %endif +%endif fi -%endif %if %{with_systemd} %triggerun -- libvirt < 0.9.4 @@ -1685,12 +1665,10 @@ exit 0 %doc examples/polkit/*.rules -%if %{with_network} %files daemon-config-network %defattr(-, root, root) %dir %{_datadir}/libvirt/networks/ %{_datadir}/libvirt/networks/default.xml -%endif %if %{with_nwfilter} %files daemon-config-nwfilter @@ -1702,7 +1680,6 @@ exit 0 %defattr(-, root, root) %{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so -%if %{with_network} %files daemon-driver-network %defattr(-, root, root) %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/ -- 2.5.5

Both RHEL and Fedora build with the storage driver and most of its sub-drivers enabled at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 86 +++++++++------------------------------------------------ 1 file changed, 13 insertions(+), 73 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 69c6af4..829cdd1 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -57,11 +57,6 @@ %define with_hyperv 0%{!?_without_hyperv:1} # Then the secondary host drivers, which run inside libvirtd -%define with_storage_fs 0%{!?_without_storage_fs:1} -%define with_storage_lvm 0%{!?_without_storage_lvm:1} -%define with_storage_iscsi 0%{!?_without_storage_iscsi:1} -%define with_storage_disk 0%{!?_without_storage_disk:1} -%define with_storage_mpath 0%{!?_without_storage_mpath:1} %if 0%{?fedora} || 0%{?rhel} >= 7 %define with_storage_rbd 0%{!?_without_storage_rbd:1} %else @@ -211,13 +206,6 @@ %define with_nodedev 1 -%if %{with_storage_fs} || %{with_storage_mpath} || %{with_storage_iscsi} || %{with_storage_lvm} || %{with_storage_disk} - %define with_storage 1 -%else - %define with_storage 0 -%endif - - # Force QEMU to run as non-root %define qemu_user qemu %define qemu_group qemu @@ -367,10 +355,8 @@ BuildRequires: polkit-devel >= 0.112 %else BuildRequires: polkit-devel >= 0.93 %endif -%if %{with_storage_fs} # For mount/umount in FS driver BuildRequires: util-linux -%endif %if %{with_qemu} # From QEMU RPMs BuildRequires: /usr/bin/qemu-img @@ -380,22 +366,14 @@ BuildRequires: /usr/bin/qemu-img BuildRequires: /usr/sbin/qcow-create %endif %endif -%if %{with_storage_lvm} # For LVM drivers BuildRequires: lvm2 -%endif -%if %{with_storage_iscsi} # For ISCSI driver BuildRequires: iscsi-initiator-utils -%endif -%if %{with_storage_disk} # For disk driver BuildRequires: parted-devel -%endif -%if %{with_storage_mpath} || %{with_storage_disk} # For Multipath support BuildRequires: device-mapper-devel -%endif %if %{with_storage_rbd} %if 0%{?rhel} >= 7 BuildRequires: librados2-devel @@ -435,12 +413,10 @@ BuildRequires: audit-libs-devel # we need /usr/sbin/dtrace BuildRequires: systemtap-sdt-devel -%if %{with_storage_fs} # For mount/umount in FS driver BuildRequires: util-linux # For showmount in FS driver (netfs discovery) BuildRequires: nfs-utils -%endif # Communication with the firewall and polkit daemons use DBus BuildRequires: dbus-devel @@ -622,56 +598,44 @@ The secret driver plugin for the libvirtd daemon, providing an implementation of the secret key APIs. -%if %{with_storage} %package daemon-driver-storage Summary: Storage driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_storage_fs} Requires: nfs-utils # For mkfs Requires: util-linux # For glusterfs - %if 0%{?fedora} +%if 0%{?fedora} Requires: glusterfs-client >= 2.0.1 - %endif - %endif - %if %{with_storage_lvm} +%endif # For LVM drivers Requires: lvm2 - %endif - %if %{with_storage_iscsi} # For ISCSI driver Requires: iscsi-initiator-utils - %endif - %if %{with_storage_disk} # For disk driver Requires: parted Requires: device-mapper - %endif - %if %{with_storage_mpath} # For multipath support Requires: device-mapper - %endif - %if %{with_storage_sheepdog} +%if %{with_storage_sheepdog} # For Sheepdog support Requires: sheepdog - %endif - %if %{with_qemu} +%endif +%if %{with_qemu} # From QEMU RPMs Requires: /usr/bin/qemu-img - %else - %if %{with_xen} +%else + %if %{with_xen} # From Xen RPMs Requires: /usr/sbin/qcow-create - %endif %endif +%endif %description daemon-driver-storage The storage driver plugin for the libvirtd daemon, providing an implementation of the storage APIs using LVM, iSCSI, parted and more. -%endif %if %{with_qemu} @@ -1062,26 +1026,6 @@ rm -rf .git %define _without_uml --without-uml %endif -%if ! %{with_storage_fs} - %define _without_storage_fs --without-storage-fs -%endif - -%if ! %{with_storage_lvm} - %define _without_storage_lvm --without-storage-lvm -%endif - -%if ! %{with_storage_iscsi} - %define _without_storage_iscsi --without-storage-iscsi -%endif - -%if ! %{with_storage_disk} - %define _without_storage_disk --without-storage-disk -%endif - -%if ! %{with_storage_mpath} - %define _without_storage_mpath --without-storage-mpath -%endif - %if ! %{with_storage_rbd} %define _without_storage_rbd --without-storage-rbd %endif @@ -1183,11 +1127,11 @@ rm -f po/stamp-po --without-bhyve \ --with-interface \ --with-network \ - %{?_without_storage_fs} \ - %{?_without_storage_lvm} \ - %{?_without_storage_iscsi} \ - %{?_without_storage_disk} \ - %{?_without_storage_mpath} \ + --with-storage-fs \ + --with-storage-lvm \ + --with-storage-iscsi \ + --with-storage-disk \ + --with-storage-mpath \ %{?_without_storage_rbd} \ %{?_without_storage_sheepdog} \ %{?_without_storage_gluster} \ @@ -1709,14 +1653,10 @@ exit 0 %defattr(-, root, root) %{_libdir}/%{name}/connection-driver/libvirt_driver_secret.so -%if %{with_storage} %files daemon-driver-storage %defattr(-, root, root) - %if %{with_storage_disk} %attr(0755, root, root) %{_libexecdir}/libvirt_parthelper - %endif %{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so -%endif %if %{with_qemu} %files daemon-driver-qemu -- 2.5.5

On 04.05.2016 18:17, Daniel P. Berrange wrote:
Both RHEL and Fedora build with the storage driver and most of its sub-drivers enabled at all times.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 86 +++++++++------------------------------------------------ 1 file changed, 13 insertions(+), 73 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 69c6af4..829cdd1 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -57,11 +57,6 @@ %define with_hyperv 0%{!?_without_hyperv:1}
# Then the secondary host drivers, which run inside libvirtd -%define with_storage_fs 0%{!?_without_storage_fs:1} -%define with_storage_lvm 0%{!?_without_storage_lvm:1} -%define with_storage_iscsi 0%{!?_without_storage_iscsi:1} -%define with_storage_disk 0%{!?_without_storage_disk:1} -%define with_storage_mpath 0%{!?_without_storage_mpath:1} %if 0%{?fedora} || 0%{?rhel} >= 7 %define with_storage_rbd 0%{!?_without_storage_rbd:1} %else @@ -211,13 +206,6 @@
%define with_nodedev 1
-%if %{with_storage_fs} || %{with_storage_mpath} || %{with_storage_iscsi} || %{with_storage_lvm} || %{with_storage_disk} - %define with_storage 1 -%else - %define with_storage 0 -%endif - - # Force QEMU to run as non-root %define qemu_user qemu %define qemu_group qemu @@ -367,10 +355,8 @@ BuildRequires: polkit-devel >= 0.112 %else BuildRequires: polkit-devel >= 0.93 %endif -%if %{with_storage_fs} # For mount/umount in FS driver BuildRequires: util-linux -%endif %if %{with_qemu} # From QEMU RPMs BuildRequires: /usr/bin/qemu-img @@ -380,22 +366,14 @@ BuildRequires: /usr/bin/qemu-img BuildRequires: /usr/sbin/qcow-create %endif %endif -%if %{with_storage_lvm} # For LVM drivers BuildRequires: lvm2 -%endif -%if %{with_storage_iscsi} # For ISCSI driver BuildRequires: iscsi-initiator-utils -%endif -%if %{with_storage_disk} # For disk driver BuildRequires: parted-devel -%endif -%if %{with_storage_mpath} || %{with_storage_disk} # For Multipath support BuildRequires: device-mapper-devel -%endif %if %{with_storage_rbd} %if 0%{?rhel} >= 7 BuildRequires: librados2-devel @@ -435,12 +413,10 @@ BuildRequires: audit-libs-devel # we need /usr/sbin/dtrace BuildRequires: systemtap-sdt-devel
-%if %{with_storage_fs} # For mount/umount in FS driver BuildRequires: util-linux # For showmount in FS driver (netfs discovery) BuildRequires: nfs-utils -%endif
# Communication with the firewall and polkit daemons use DBus BuildRequires: dbus-devel @@ -622,56 +598,44 @@ The secret driver plugin for the libvirtd daemon, providing an implementation of the secret key APIs.
-%if %{with_storage} %package daemon-driver-storage Summary: Storage driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_storage_fs} Requires: nfs-utils # For mkfs Requires: util-linux # For glusterfs - %if 0%{?fedora} +%if 0%{?fedora} Requires: glusterfs-client >= 2.0.1 - %endif - %endif - %if %{with_storage_lvm} +%endif # For LVM drivers Requires: lvm2 - %endif - %if %{with_storage_iscsi} # For ISCSI driver Requires: iscsi-initiator-utils - %endif - %if %{with_storage_disk} # For disk driver Requires: parted Requires: device-mapper - %endif - %if %{with_storage_mpath} # For multipath support Requires: device-mapper - %endif - %if %{with_storage_sheepdog} +%if %{with_storage_sheepdog} # For Sheepdog support Requires: sheepdog
This is interesting. I did not have sheepdog installed on my system and rpmbuild failed for me at configure phase because sheepdog was enabled but not installed. I wonder how this could have ever worked. s/Requires/BuildRequires/ please. Or should we set some default in our configure script? Third option would be to have both Requires and BuildRequires in the spec file.
- %endif - %if %{with_qemu} +%endif +%if %{with_qemu} # From QEMU RPMs Requires: /usr/bin/qemu-img - %else - %if %{with_xen} +%else + %if %{with_xen} # From Xen RPMs Requires: /usr/sbin/qcow-create - %endif %endif +%endif
Michal

On Thu, May 05, 2016 at 01:11:45PM +0200, Michal Privoznik wrote:
On 04.05.2016 18:17, Daniel P. Berrange wrote:
Both RHEL and Fedora build with the storage driver and most of its sub-drivers enabled at all times.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 86 +++++++++------------------------------------------------ 1 file changed, 13 insertions(+), 73 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 69c6af4..829cdd1 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -57,11 +57,6 @@ %define with_hyperv 0%{!?_without_hyperv:1}
# Then the secondary host drivers, which run inside libvirtd -%define with_storage_fs 0%{!?_without_storage_fs:1} -%define with_storage_lvm 0%{!?_without_storage_lvm:1} -%define with_storage_iscsi 0%{!?_without_storage_iscsi:1} -%define with_storage_disk 0%{!?_without_storage_disk:1} -%define with_storage_mpath 0%{!?_without_storage_mpath:1} %if 0%{?fedora} || 0%{?rhel} >= 7 %define with_storage_rbd 0%{!?_without_storage_rbd:1} %else @@ -211,13 +206,6 @@
%define with_nodedev 1
-%if %{with_storage_fs} || %{with_storage_mpath} || %{with_storage_iscsi} || %{with_storage_lvm} || %{with_storage_disk} - %define with_storage 1 -%else - %define with_storage 0 -%endif - - # Force QEMU to run as non-root %define qemu_user qemu %define qemu_group qemu @@ -367,10 +355,8 @@ BuildRequires: polkit-devel >= 0.112 %else BuildRequires: polkit-devel >= 0.93 %endif -%if %{with_storage_fs} # For mount/umount in FS driver BuildRequires: util-linux -%endif %if %{with_qemu} # From QEMU RPMs BuildRequires: /usr/bin/qemu-img @@ -380,22 +366,14 @@ BuildRequires: /usr/bin/qemu-img BuildRequires: /usr/sbin/qcow-create %endif %endif -%if %{with_storage_lvm} # For LVM drivers BuildRequires: lvm2 -%endif -%if %{with_storage_iscsi} # For ISCSI driver BuildRequires: iscsi-initiator-utils -%endif -%if %{with_storage_disk} # For disk driver BuildRequires: parted-devel -%endif -%if %{with_storage_mpath} || %{with_storage_disk} # For Multipath support BuildRequires: device-mapper-devel -%endif %if %{with_storage_rbd} %if 0%{?rhel} >= 7 BuildRequires: librados2-devel @@ -435,12 +413,10 @@ BuildRequires: audit-libs-devel # we need /usr/sbin/dtrace BuildRequires: systemtap-sdt-devel
-%if %{with_storage_fs} # For mount/umount in FS driver BuildRequires: util-linux # For showmount in FS driver (netfs discovery) BuildRequires: nfs-utils -%endif
# Communication with the firewall and polkit daemons use DBus BuildRequires: dbus-devel @@ -622,56 +598,44 @@ The secret driver plugin for the libvirtd daemon, providing an implementation of the secret key APIs.
-%if %{with_storage} %package daemon-driver-storage Summary: Storage driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} - %if %{with_storage_fs} Requires: nfs-utils # For mkfs Requires: util-linux # For glusterfs - %if 0%{?fedora} +%if 0%{?fedora} Requires: glusterfs-client >= 2.0.1 - %endif - %endif - %if %{with_storage_lvm} +%endif # For LVM drivers Requires: lvm2 - %endif - %if %{with_storage_iscsi} # For ISCSI driver Requires: iscsi-initiator-utils - %endif - %if %{with_storage_disk} # For disk driver Requires: parted Requires: device-mapper - %endif - %if %{with_storage_mpath} # For multipath support Requires: device-mapper - %endif - %if %{with_storage_sheepdog} +%if %{with_storage_sheepdog} # For Sheepdog support Requires: sheepdog
This is interesting. I did not have sheepdog installed on my system and rpmbuild failed for me at configure phase because sheepdog was enabled but not installed. I wonder how this could have ever worked. s/Requires/BuildRequires/ please. Or should we set some default in our configure script? Third option would be to have both Requires and BuildRequires in the spec file.
We should have both Requires + BuildRequires, because we don't link to any libs - we just rely on the CLI tools, so would not get any automatic dep on the binary package. Since we had a missing BR, it seems we were silently not building sheepdog support, despite requiring it at install time :-) Anyway, I'll fix this in a separate patch, since its a pre-existing bug Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

Both RHEL and Fedora build with the nodedev driver enabled at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 829cdd1..fc3cf32 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -204,8 +204,6 @@ %define with_cgconfig 0%{!?_without_cgconfig:1} %endif -%define with_nodedev 1 - # Force QEMU to run as non-root %define qemu_user qemu %define qemu_group qemu @@ -554,24 +552,21 @@ iptables and ip6tables capabilities %endif -%if %{with_nodedev} %package daemon-driver-nodedev Summary: Nodedev driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} # needed for device enumeration - %if 0%{?fedora} || 0%{?rhel} >= 7 +%if 0%{?fedora} || 0%{?rhel} >= 7 Requires: systemd >= 185 - %else +%else Requires: udev >= 145 - %endif %endif %description daemon-driver-nodedev The nodedev driver plugin for the libvirtd daemon, providing an implementation of the node device APIs using the udev capabilities. -%endif %package daemon-driver-interface @@ -1635,11 +1630,9 @@ exit 0 %attr(0755, root, root) %{_libexecdir}/libvirt_leaseshelper %{_libdir}/%{name}/connection-driver/libvirt_driver_network.so -%if %{with_nodedev} %files daemon-driver-nodedev %defattr(-, root, root) %{_libdir}/%{name}/connection-driver/libvirt_driver_nodedev.so -%endif %if %{with_nwfilter} %files daemon-driver-nwfilter -- 2.5.5

Both RHEL and Fedora build with the nwfilter driver enabled at all times Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index fc3cf32..3497d72 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -72,7 +72,6 @@ # A few optional bits off by default, we enable later %define with_fuse 0%{!?_without_fuse:0} -%define with_nwfilter 0%{!?_without_nwfilter:0} %define with_libpcap 0%{!?_without_libpcap:0} %define with_macvtap 0%{!?_without_macvtap:0} %define with_libnl 0%{!?_without_libnl:0} @@ -183,7 +182,6 @@ %if %{with_qemu} || %{with_lxc} || %{with_uml} - %define with_nwfilter 0%{!?_without_nwfilter:1} # Enable libpcap library %define with_libpcap 0%{!?_without_libpcap:1} %define with_macvtap 0%{!?_without_macvtap:1} @@ -248,9 +246,7 @@ Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.gz Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} -%if %{with_nwfilter} Requires: libvirt-daemon-config-nwfilter = %{version}-%{release} -%endif %if %{with_libxl} Requires: libvirt-daemon-driver-libxl = %{version}-%{release} %endif @@ -269,9 +265,7 @@ Requires: libvirt-daemon-driver-xen = %{version}-%{release} %if %{with_vbox} Requires: libvirt-daemon-driver-vbox = %{version}-%{release} %endif -%if %{with_nwfilter} Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} -%endif Requires: libvirt-daemon-driver-interface = %{version}-%{release} Requires: libvirt-daemon-driver-secret = %{version}-%{release} @@ -341,9 +335,7 @@ BuildRequires: iptables BuildRequires: iptables-ipv6 %endif BuildRequires: radvd -%if %{with_nwfilter} BuildRequires: ebtables -%endif BuildRequires: module-init-tools BuildRequires: cyrus-sasl-devel %if 0%{?fedora} || 0%{?rhel} >= 7 @@ -505,7 +497,6 @@ Requires: libvirt-daemon-driver-network = %{version}-%{release} %description daemon-config-network Default configuration files for setting up NAT based networking -%if %{with_nwfilter} %package daemon-config-nwfilter Summary: Network filter configuration files for the libvirtd daemon Group: Development/Libraries @@ -515,7 +506,6 @@ Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release} %description daemon-config-nwfilter Network filter configuration files for cleaning guest traffic -%endif %package daemon-driver-network Summary: Network driver plugin for the libvirtd daemon @@ -534,22 +524,20 @@ an implementation of the virtual network APIs using the Linux bridge capabilities. -%if %{with_nwfilter} %package daemon-driver-nwfilter Summary: Nwfilter driver plugin for the libvirtd daemon Group: Development/Libraries Requires: libvirt-daemon = %{version}-%{release} Requires: iptables - %if 0%{?rhel} && 0%{?rhel} < 7 +%if 0%{?rhel} && 0%{?rhel} < 7 Requires: iptables-ipv6 - %endif +%endif Requires: ebtables %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 -%endif %package daemon-driver-nodedev @@ -1609,11 +1597,9 @@ exit 0 %dir %{_datadir}/libvirt/networks/ %{_datadir}/libvirt/networks/default.xml -%if %{with_nwfilter} %files daemon-config-nwfilter %defattr(-, root, root) %{_sysconfdir}/libvirt/nwfilter/*.xml -%endif %files daemon-driver-interface %defattr(-, root, root) @@ -1634,13 +1620,11 @@ exit 0 %defattr(-, root, root) %{_libdir}/%{name}/connection-driver/libvirt_driver_nodedev.so -%if %{with_nwfilter} %files daemon-driver-nwfilter %defattr(-, root, root) %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/ %ghost %dir %{_localstatedir}/run/libvirt/network/ %{_libdir}/%{name}/connection-driver/libvirt_driver_nwfilter.so -%endif %files daemon-driver-secret %defattr(-, root, root) -- 2.5.5

Both RHEL and Fedora build with libpcap at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 3497d72..c2e486e 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -72,7 +72,6 @@ # A few optional bits off by default, we enable later %define with_fuse 0%{!?_without_fuse:0} -%define with_libpcap 0%{!?_without_libpcap:0} %define with_macvtap 0%{!?_without_macvtap:0} %define with_libnl 0%{!?_without_libnl:0} %define with_cgconfig 0%{!?_without_cgconfig:0} @@ -182,8 +181,6 @@ %if %{with_qemu} || %{with_lxc} || %{with_uml} -# Enable libpcap library - %define with_libpcap 0%{!?_without_libpcap:1} %define with_macvtap 0%{!?_without_macvtap:1} # numad is used to manage the CPU and memory placement dynamically, @@ -321,9 +318,7 @@ BuildRequires: yajl-devel %if %{with_sanlock} BuildRequires: sanlock-devel >= 2.4 %endif -%if %{with_libpcap} BuildRequires: libpcap-devel -%endif %if %{with_libnl} BuildRequires: libnl3-devel %endif @@ -1037,10 +1032,6 @@ rm -rf .git %define _without_sanlock --without-sanlock %endif -%if ! %{with_libpcap} - %define _without_libpcap --without-libpcap -%endif - %if ! %{with_macvtap} %define _without_macvtap --without-macvtap %endif @@ -1130,7 +1121,7 @@ rm -f po/stamp-po --with-udev \ --with-yajl \ %{?_without_sanlock} \ - %{?_without_libpcap} \ + --with-libpcap \ %{?_without_macvtap} \ --with-audit \ --with-dtrace \ -- 2.5.5

Both RHEL and Fedora build with macvtap at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index c2e486e..a98d20d 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -72,7 +72,6 @@ # A few optional bits off by default, we enable later %define with_fuse 0%{!?_without_fuse:0} -%define with_macvtap 0%{!?_without_macvtap:0} %define with_libnl 0%{!?_without_libnl:0} %define with_cgconfig 0%{!?_without_cgconfig:0} %define with_sanlock 0%{!?_without_sanlock:0} @@ -181,8 +180,6 @@ %if %{with_qemu} || %{with_lxc} || %{with_uml} - %define with_macvtap 0%{!?_without_macvtap:1} - # numad is used to manage the CPU and memory placement dynamically, # it's not available on s390[x] and ARM. %ifnarch s390 s390x %{arm} @@ -190,9 +187,7 @@ %endif %endif -%if %{with_macvtap} - %define with_libnl 1 -%endif +%define with_libnl 1 # Pull in cgroups config system %if %{with_qemu} || %{with_lxc} @@ -1032,10 +1027,6 @@ rm -rf .git %define _without_sanlock --without-sanlock %endif -%if ! %{with_macvtap} - %define _without_macvtap --without-macvtap -%endif - %if %{with_firewalld} %define _with_firewalld --with-firewalld %endif @@ -1122,7 +1113,7 @@ rm -f po/stamp-po --with-yajl \ %{?_without_sanlock} \ --with-libpcap \ - %{?_without_macvtap} \ + --with-macvtap \ --with-audit \ --with-dtrace \ --with-driver-modules \ -- 2.5.5

Both RHEL and Fedora build with libnl3 at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index a98d20d..1727b52 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -72,7 +72,6 @@ # A few optional bits off by default, we enable later %define with_fuse 0%{!?_without_fuse:0} -%define with_libnl 0%{!?_without_libnl:0} %define with_cgconfig 0%{!?_without_cgconfig:0} %define with_sanlock 0%{!?_without_sanlock:0} %define with_systemd 0%{!?_without_systemd:0} @@ -187,8 +186,6 @@ %endif %endif -%define with_libnl 1 - # Pull in cgroups config system %if %{with_qemu} || %{with_lxc} %define with_cgconfig 0%{!?_without_cgconfig:1} @@ -314,9 +311,7 @@ BuildRequires: yajl-devel BuildRequires: sanlock-devel >= 2.4 %endif BuildRequires: libpcap-devel -%if %{with_libnl} BuildRequires: libnl3-devel -%endif BuildRequires: avahi-devel BuildRequires: libselinux-devel BuildRequires: dnsmasq >= 2.41 -- 2.5.5

Both RHEL and Fedora build the nss plugin at all times. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 1727b52..4a6e294 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -82,10 +82,6 @@ %define with_systemd_daemon 0%{!?_without_systemd_daemon:0} %define with_pm_utils 1 -# Non-server/HV driver defaults which are always enabled -%define with_nss_plugin 0%{!?_without_nss_plugin:1} - - # Finally set the OS / architecture specific special cases # Xen is available only on i386 x86_64 ia64 @@ -894,7 +890,6 @@ Includes the Sanlock lock manager plugin for the QEMU driver %endif -%if %{with_nss_plugin} %package nss Summary: Libvirt plugin for Name Service Switch Group: Development/Libraries @@ -902,7 +897,6 @@ Requires: libvirt-daemon-driver-network = %{version}-%{release} %description nss Libvirt plugin for NSS for translating domain names into IP addresses. -%endif %prep @@ -1038,10 +1032,6 @@ rm -rf .git %define _without_pm_utils --without-pm-utils %endif -%if ! %{with_nss_plugin} - %define _without_nss_plugin --without-nss-plugin -%endif - %define when %(date +"%%F-%%T") %define where %(hostname) %define who %{?packager}%{!?packager:Unknown} @@ -1116,7 +1106,7 @@ rm -f po/stamp-po %{?_without_wireshark} \ %{?_without_systemd_daemon} \ %{?_without_pm_utils} \ - %{?_without_nss_plugin} \ + --with-nss-plugin \ %{with_packager} \ %{with_packager_version} \ --with-qemu-user=%{qemu_user} \ @@ -1787,10 +1777,8 @@ exit 0 %{_libdir}/wireshark/plugins/libvirt.so %endif -%if %{with_nss_plugin} %files nss %{_libdir}/libnss_libvirt.so.2 -%endif %if %{with_lxc} %files login-shell -- 2.5.5

Rather than letting the configure script auto-detect features we expect, use --with-xxx to explicitly mandate them. This ensures that we get an error upfront when running configure, rather than a failure later during build or RPM file packaging time. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- libvirt.spec.in | 198 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 121 insertions(+), 77 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 4a6e294..78eb8aa 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -194,7 +194,7 @@ # Advertise OVMF and AAVMF from nightly firmware repo %if 0%{?fedora} - %define with_loader_nvram --with-loader-nvram="/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd:/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd:/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2.git/aarch64/vars-template-pflash.raw" + %define arg_loader_nvram --with-loader-nvram="/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd:/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd:/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2.git/aarch64/vars-template-pflash.raw" %endif @@ -944,110 +944,154 @@ rm -f $PATCHLIST rm -rf .git %build -%if ! %{with_xen} - %define _without_xen --without-xen +%if %{with_xen} + %define arg_xen --with-xen +%else + %define arg_xen --without-xen %endif -%if ! %{with_qemu} - %define _without_qemu --without-qemu +%if %{with_qemu} + %define arg_qemu --with-qemu +%else + %define arg_qemu --without-qemu %endif -%if ! %{with_openvz} - %define _without_openvz --without-openvz +%if %{with_openvz} + %define arg_openvz --with-openvz +%else + %define arg_openvz --without-openvz %endif -%if ! %{with_lxc} - %define _without_lxc --without-lxc +%if %{with_lxc} + %define arg_lxc --with-lxc +%else + %define arg_lxc --without-lxc %endif -%if ! %{with_vbox} - %define _without_vbox --without-vbox +%if %{with_vbox} + %define arg_vbox --with-vbox +%else + %define arg_vbox --without-vbox %endif -%if ! %{with_libxl} - %define _without_libxl --without-libxl +%if %{with_libxl} + %define arg_libxl --with-libxl +%else + %define arg_libxl --without-libxl %endif -%if ! %{with_phyp} - %define _without_phyp --without-phyp +%if %{with_phyp} + %define arg_phyp --with-phyp +%else + %define arg_phyp --without-phyp %endif -%if ! %{with_esx} - %define _without_esx --without-esx +%if %{with_esx} + %define arg_esx --with-esx +%else + %define arg_esx --without-esx %endif -%if ! %{with_hyperv} - %define _without_hyperv --without-hyperv +%if %{with_hyperv} + %define arg_hyperv --with-hyperv +%else + %define arg_hyperv --without-hyperv %endif -%if ! %{with_vmware} - %define _without_vmware --without-vmware +%if %{with_vmware} + %define arg_vmware --with-vmware +%else + %define arg_vmware --without-vmware %endif -%if ! %{with_uml} - %define _without_uml --without-uml +%if %{with_uml} + %define arg_uml --with-uml +%else + %define arg_uml --without-uml %endif -%if ! %{with_storage_rbd} - %define _without_storage_rbd --without-storage-rbd +%if %{with_storage_rbd} + %define arg_storage_rbd --with-storage-rbd +%else + %define arg_storage_rbd --without-storage-rbd %endif -%if ! %{with_storage_sheepdog} - %define _without_storage_sheepdog --without-storage-sheepdog +%if %{with_storage_sheepdog} + %define arg_storage_sheepdog --with-storage-sheepdog +%else + %define arg_storage_sheepdog --without-storage-sheepdog %endif -%if ! %{with_storage_gluster} - %define _without_storage_gluster --without-storage-gluster +%if %{with_storage_gluster} + %define arg_storage_gluster --with-storage-gluster +%else + %define arg_storage_gluster --without-storage-gluster %endif -%if ! %{with_numactl} - %define _without_numactl --without-numactl +%if %{with_numactl} + %define arg_numactl --with-numactl +%else + %define arg_numactl --without-numactl %endif -%if ! %{with_numad} - %define _without_numad --without-numad +%if %{with_numad} + %define arg_numad --with-numad +%else + %define arg_numad --without-numad %endif -%if ! %{with_fuse} - %define _without_fuse --without-fuse +%if %{with_fuse} + %define arg_fuse --with-fuse +%else + %define arg_fuse --without-fuse %endif -%if ! %{with_sanlock} - %define _without_sanlock --without-sanlock +%if %{with_sanlock} + %define arg_sanlock --with-sanlock +%else + %define arg_sanlock --without-sanlock %endif %if %{with_firewalld} - %define _with_firewalld --with-firewalld + %define arg_firewalld --with-firewalld +%else + %define arg_firewalld --without-firewalld %endif -%if ! %{with_wireshark} - %define _without_wireshark --without-wireshark-dissector +%if %{with_wireshark} + %define arg_wireshark --with-wireshark-dissector +%else + %define arg_wireshark --without-wireshark-dissector %endif -%if ! %{with_systemd_daemon} - %define _without_systemd_daemon --without-systemd-daemon +%if %{with_systemd_daemon} + %define arg_systemd_daemon --with-systemd-daemon +%else + %define arg_systemd_daemon --without-systemd-daemon %endif -%if ! %{with_pm_utils} - %define _without_pm_utils --without-pm-utils +%if %{with_pm_utils} + %define arg_pm_utils --with-pm-utils +%else + %define arg_pm_utils --without-pm-utils %endif %define when %(date +"%%F-%%T") %define where %(hostname) %define who %{?packager}%{!?packager:Unknown} -%define with_packager --with-packager="%{who}, %{when}, %{where}" -%define with_packager_version --with-packager-version="%{release}" +%define arg_packager --with-packager="%{who}, %{when}, %{where}" +%define arg_packager_version --with-packager-version="%{release}" %if %{with_systemd} - %define with_init_script --with-init-script=systemd + %define arg_init_script --with-init-script=systemd %else - %define with_init_script --with-init-script=redhat + %define arg_init_script --with-init-script=redhat %endif %if 0%{?fedora} || 0%{?rhel} >= 7 - %define with_selinux_mount --with-selinux-mount="/sys/fs/selinux" + %define arg_selinux_mount --with-selinux-mount="/sys/fs/selinux" %else - %define with_selinux_mount --with-selinux-mount="/selinux" + %define arg_selinux_mount --with-selinux-mount="/selinux" %endif # place macros above and build commands below this comment @@ -1057,21 +1101,21 @@ rm -rf .git %endif rm -f po/stamp-po -%configure %{?_without_xen} \ - %{?_without_qemu} \ - %{?_without_openvz} \ - %{?_without_lxc} \ - %{?_without_vbox} \ - %{?_without_libxl} \ +%configure %{?arg_xen} \ + %{?arg_qemu} \ + %{?arg_openvz} \ + %{?arg_lxc} \ + %{?arg_vbox} \ + %{?arg_libxl} \ --with-sasl \ --with-avahi \ --with-polkit \ --with-libvirtd \ - %{?_without_uml} \ - %{?_without_phyp} \ - %{?_without_esx} \ - %{?_without_hyperv} \ - %{?_without_vmware} \ + %{?arg_uml} \ + %{?arg_phyp} \ + %{?arg_esx} \ + %{?arg_hyperv} \ + %{?arg_vmware} \ --without-xenapi \ --without-vz \ --without-bhyve \ @@ -1082,39 +1126,39 @@ rm -f po/stamp-po --with-storage-iscsi \ --with-storage-disk \ --with-storage-mpath \ - %{?_without_storage_rbd} \ - %{?_without_storage_sheepdog} \ - %{?_without_storage_gluster} \ - %{?_without_numactl} \ - %{?_without_numad} \ + %{?arg_storage_rbd} \ + %{?arg_storage_sheepdog} \ + %{?arg_storage_gluster} \ + %{?arg_numactl} \ + %{?arg_numad} \ --with-capng \ - %{?_without_fuse} \ + %{?arg_fuse} \ --with-netcf \ --with-selinux \ - %{?_with_selinux_mount} \ + %{?arg_selinux_mount} \ --without-apparmor \ --without-hal \ --with-udev \ --with-yajl \ - %{?_without_sanlock} \ + %{?arg_sanlock} \ --with-libpcap \ --with-macvtap \ --with-audit \ --with-dtrace \ --with-driver-modules \ - %{?_with_firewalld} \ - %{?_without_wireshark} \ - %{?_without_systemd_daemon} \ - %{?_without_pm_utils} \ + %{?arg_firewalld} \ + %{?arg_wireshark} \ + %{?arg_systemd_daemon} \ + %{?arg_pm_utils} \ --with-nss-plugin \ - %{with_packager} \ - %{with_packager_version} \ + %{arg_packager} \ + %{arg_packager_version} \ --with-qemu-user=%{qemu_user} \ --with-qemu-group=%{qemu_group} \ - %{?with_loader_nvram} \ + %{?arg_loader_nvram} \ %{?enable_werror} \ --enable-expensive-tests \ - %{with_init_script} + %{arg_init_script} make %{?_smp_mflags} gzip -9 ChangeLog -- 2.5.5

On 04.05.2016 18:17, Daniel P. Berrange wrote:
Cole previously suggested that we should simplify the RPM spec by removing conditionals that we never need to toggle for RHEL / Fedora builds, rather than having conditionals for every single feature that exists.
This series does just that....
Daniel P. Berrange (27): libvirt.spec.in: explicitly disable xenapi & vz drivers libvirt.spec.in: drop Fedora < 20 and RHEL < 6 libvirt.spec.in: remove client only build option libvirt.spec.in: remove conditional for driver modules libvirt.spec.in: remove libvirtd conditional libvirt.spec.in: remove avahi conditional libvirt.spec.in: remove hal conditional libvirt.spec.in: remove apparmor conditional libvirt.spec.in: remove capng conditional libvirt.spec.in: remove udev conditional libvirt.spec.in: remove netcf conditional libvirt.spec.in: remove audit conditional libvirt.spec.in: remove dtrace conditional libvirt.spec.in: remove sasl conditionals libvirt.spec.in: remove polkit conditional libvirt.spec.in: remove yajl conditional libvirt.spec.in: remove selinux conditional libvirt.spec.in: remove interface driver conditional libvirt.spec.in: remove network driver conditiaonl libvirt.spec.in: remove most storage conditionals libvirt.spec.in: remove nodedev conditional libvirt.spec.in: remove nwfilter driver conditional libvirt.spec.in: remove libpcap conditional libvirt.spec.in: remove macvtap conditional libvirt.spec.in: remove libnl conditional libvirt.spec.in: remove nss plugin conditional libvirt.spec.in: use explicit --with-xxx for all features
libvirt.spec.in | 1205 +++++++++++++++---------------------------------------- 1 file changed, 333 insertions(+), 872 deletions(-)
Looking good. ACK Michal
participants (2)
-
Daniel P. Berrange
-
Michal Privoznik