# -*- 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.
# If neither fedora nor rhel was defined, try to guess them from %{dist}
%if !0%{?rhel} && !0%{?fedora}
%{expand:%(echo "%{?dist}" | \
%define with_libpcap 0%{!?_without_libpcap:0}
%define with_macvtap 0%{!?_without_macvtap:0}
%define with_libnl 0%{!?_without_libnl:0}
-%define with_audit 0%{!?_without_audit:0}
%define with_dtrace 0%{!?_without_dtrace:0}
%define with_cgconfig 0%{!?_without_cgconfig:0}
%define with_sanlock 0%{!?_without_sanlock:0}
# Non-server/HV driver defaults which are always enabled
%define with_sasl 0%{!?_without_sasl:1}
+%define with_audit 0%{!?_without_audit:1}
# Finally set the OS / architecture specific special cases
%define with_libxl 0
%endif
-# PolicyKit was introduced in Fedora 8 / RHEL-6 or newer
-%if 0%{?fedora} >= 8 || 0%{?rhel} >= 6
- %define with_polkit 0%{!?_without_polkit:1}
-%endif
-
-# libcapng is used to manage capabilities in Fedora 12 / RHEL-6 or newer
-%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
- %define with_capng 0%{!?_without_capng:1}
-%endif
-
# fuse is used to provide virtualized /proc for LXC
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
%define with_fuse 0%{!?_without_fuse:1}
%endif
-# netcf is used to manage network interfaces in Fedora 12 / RHEL-6 or newer
-%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
- %define with_netcf 0%{!?_without_netcf:%{server_drivers}}
-%endif
-
-# udev is used to manage host devices in Fedora 12 / RHEL-6 or newer
-%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
- %define with_udev 0%{!?_without_udev:%{server_drivers}}
-%else
+# 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
# interface requires netcf
%define with_interface 0
%endif
-# Enable yajl library for JSON mode with QEMU
-%if 0%{?fedora} >= 13 || 0%{?rhel} >= 6
- %define with_yajl 0%{!?_without_yajl:%{server_drivers}}
-%endif
-
# Enable sanlock library for lock management with QEMU
# Sanlock is available only on arches where kvm is available for RHEL
%if 0%{?fedora} >= 16
%define with_libnl 1
%endif
-%if 0%{?fedora} >= 11 || 0%{?rhel} >= 5
- %define with_audit 0%{!?_without_audit:1}
-%endif
-
-%if 0%{?fedora} >= 13 || 0%{?rhel} >= 6
- %define with_dtrace 1
-%endif
-
# Pull in cgroups config system
-%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
+%if 0%{?fedora} || 0%{?rhel} >= 6
%if %{with_qemu} || %{with_lxc}
%define with_cgconfig 0%{!?_without_cgconfig:1}
%endif
# Force QEMU to run as non-root
-%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
+%if 0%{?fedora} || 0%{?rhel} >= 6
%define qemu_user qemu
%define qemu_group qemu
%else
# For pool-build probing for existing pools
BuildRequires: libblkid-devel >= 2.17
%endif
-%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
+%if 0%{?fedora} || 0%{?rhel} >= 6
# for augparse, optionally used in testing
BuildRequires: augeas
%endif
%if 0%{?fedora} >= 20 || 0%{?rhel} >= 7
BuildRequires: polkit-devel >= 0.112
%else
- %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
+ %if 0%{?fedora} || 0%{?rhel} >= 6
BuildRequires: polkit-devel >= 0.93
%else
BuildRequires: PolicyKit-devel >= 0.6
%endif
%endif
%if %{with_esx}
- %if 0%{?fedora} >= 9 || 0%{?rhel} >= 6
+ %if 0%{?fedora} || 0%{?rhel} >= 6
BuildRequires: libcurl-devel
%else
BuildRequires: curl-devel
%if 0%{?fedora} >= 20 || 0%{?rhel} >= 7
Requires: polkit >= 0.112
%else
- %if 0%{?fedora} >= 12 || 0%{?rhel} >=6
+ %if 0%{?fedora} || 0%{?rhel} >=6
Requires: polkit >= 0.93
%else
Requires: PolicyKit >= 0.6
# For mkfs
Requires: util-linux
# For glusterfs
- %if 0%{?fedora} >= 11
+ %if 0%{?fedora}
Requires: glusterfs-client >= 2.0.1
%endif
%endif
%endif
%endif
-%if 0%{?fedora} < 14 && 0%{?rhel} < 6
+%if 0%{?rhel} == 5
rm -f $RPM_BUILD_ROOT%{_prefix}/lib/sysctl.d/libvirtd.conf
%endif
%if ! %{with_driver_modules}
%if %{with_qemu}
%pre daemon
- %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
+ %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
%if %{with_driver_modules}
%if %{with_qemu}
%pre daemon-driver-qemu
- %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
+ %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
%config(noreplace) %{_sysconfdir}/sysconfig/virtlockd
%config(noreplace) %{_sysconfdir}/libvirt/libvirtd.conf
%config(noreplace) %{_sysconfdir}/libvirt/virtlockd.conf
- %if 0%{?fedora} >= 14 || 0%{?rhel} >= 6
+ %if 0%{?fedora} || 0%{?rhel} >= 6
%config(noreplace) %{_prefix}/lib/sysctl.d/libvirtd.conf
%endif
%endif
%if %{with_polkit}
- %if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
+ %if 0%{?fedora} || 0%{?rhel} >= 6
%{_datadir}/polkit-1/actions/org.libvirt.unix.policy
%{_datadir}/polkit-1/actions/org.libvirt.api.policy
%else