spec: Bump min_fedora and min_rhel

According to our platform support policy

  https://libvirt.org/platforms.html

RHEL 7 and all versions of Fedora older than 33 are going to
be out of scope by the time libvirt 7.4.0 is released.

Dropping RHEL 7 in particular allows us to greatly simplify
many parts of the spec file.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Andrea Bolognani 2021-05-05 19:30:46 +02:00
parent d9f4470549
commit 0f601d2f86
2 changed files with 19 additions and 85 deletions

View File

@ -3,8 +3,8 @@
# This spec file assumes you are building on a Fedora or RHEL version # This spec file assumes you are building on a Fedora or RHEL version
# that's still supported by the vendor. It may work on other distros # that's still supported by the vendor. It may work on other distros
# or versions, but no effort will be made to ensure that going forward. # or versions, but no effort will be made to ensure that going forward.
%define min_rhel 7 %define min_rhel 8
%define min_fedora 31 %define min_fedora 33
%if 0%{?fedora} >= %{min_fedora} || 0%{?rhel} >= %{min_rhel} %if 0%{?fedora} >= %{min_fedora} || 0%{?rhel} >= %{min_rhel}
%define supported_platform 1 %define supported_platform 1
@ -12,18 +12,9 @@
%define supported_platform 0 %define supported_platform 0
%endif %endif
# On RHEL 7 and older macro _vpath_builddir is not defined.
%if 0%{?rhel} && 0%{?rhel} <= 7
%define _vpath_builddir %{_target_platform}
%endif
%define arches_qemu_kvm %{ix86} x86_64 %{power64} %{arm} aarch64 s390x %define arches_qemu_kvm %{ix86} x86_64 %{power64} %{arm} aarch64 s390x
%if 0%{?rhel} %if 0%{?rhel}
%if 0%{?rhel} <= 8 %define arches_qemu_kvm x86_64 aarch64 s390x
%define arches_qemu_kvm x86_64 %{power64} aarch64 s390x
%else
%define arches_qemu_kvm x86_64 aarch64 s390x
%endif
%endif %endif
%define arches_64bit x86_64 %{power64} aarch64 s390x riscv64 %define arches_64bit x86_64 %{power64} aarch64 s390x riscv64
@ -77,25 +68,20 @@
%define with_storage_gluster 0%{!?_without_storage_gluster:1} %define with_storage_gluster 0%{!?_without_storage_gluster:1}
%ifnarch %{arches_qemu_kvm} %ifnarch %{arches_qemu_kvm}
# gluster is only built where qemu driver is enabled on RHEL 8 # gluster is only built where qemu driver is enabled on RHEL
%if 0%{?rhel} >= 8 %if 0%{?rhel}
%define with_storage_gluster 0 %define with_storage_gluster 0
%endif %endif
%endif %endif
# F25+ has zfs-fuse # Fedora has zfs-fuse
%if 0%{?fedora} %if 0%{?fedora}
%define with_storage_zfs 0%{!?_without_storage_zfs:1} %define with_storage_zfs 0%{!?_without_storage_zfs:1}
%else %else
%define with_storage_zfs 0 %define with_storage_zfs 0
%endif %endif
# We need a recent enough libiscsi (>= 1.18.0) %define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1}
%if 0%{?fedora} || 0%{?rhel} > 7
%define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1}
%else
%define with_storage_iscsi_direct 0
%endif
# Other optional features # Other optional features
%define with_numactl 0%{!?_without_numactl:1} %define with_numactl 0%{!?_without_numactl:1}
@ -130,9 +116,7 @@
%define with_storage_rbd 0 %define with_storage_rbd 0
%endif %endif
# RHEL doesn't ship OpenVZ, VBox, PowerHypervisor, # RHEL doesn't ship many hypervisor drivers
# VMware, libxenlight (Xen 4.1 and newer),
# or HyperV.
%if 0%{?rhel} %if 0%{?rhel}
%define with_openvz 0 %define with_openvz 0
%define with_vbox 0 %define with_vbox 0
@ -140,15 +124,10 @@
%define with_libxl 0 %define with_libxl 0
%define with_hyperv 0 %define with_hyperv 0
%define with_vz 0 %define with_vz 0
%define with_lxc 0
%if 0%{?rhel} > 7
%define with_lxc 0
%endif
%endif %endif
%if 0%{?fedora} || 0%{?rhel} > 7 %define with_firewalld_zone 0%{!?_without_firewalld_zone:1}
%define with_firewalld_zone 0%{!?_without_firewalld_zone:1}
%endif
%if (0%{?fedora} && 0%{?fedora} < 34) || (0%{?rhel} && 0%{?rhel} < 9) %if (0%{?fedora} && 0%{?fedora} < 34) || (0%{?rhel} && 0%{?rhel} < 9)
%define with_netcf 0%{!?_without_netcf:1} %define with_netcf 0%{!?_without_netcf:1}
@ -176,16 +155,12 @@
%define with_libssh2 0%{!?_without_libssh2:1} %define with_libssh2 0%{!?_without_libssh2:1}
%endif %endif
# Enable wireshark plugins for all distros except RHEL-7 # Enable wireshark plugins for all distros
%if 0%{?fedora} || 0%{?rhel} > 7 %define with_wireshark 0%{!?_without_wireshark:1}
%define with_wireshark 0%{!?_without_wireshark:1} %define wireshark_plugindir %(pkg-config --variable plugindir wireshark)/epan
%define wireshark_plugindir %(pkg-config --variable plugindir wireshark)/epan
%endif
# Enable libssh transport for new enough distros # Enable libssh transport for all distros
%if 0%{?fedora} || 0%{?rhel} > 7 %define with_libssh 0%{!?_without_libssh:1}
%define with_libssh 0%{!?_without_libssh:1}
%endif
%if %{with_qemu} || %{with_lxc} %if %{with_qemu} || %{with_lxc}
# numad is used to manage the CPU and memory placement dynamically, # numad is used to manage the CPU and memory placement dynamically,
@ -213,11 +188,7 @@
%define enable_werror -Dwerror=false %define enable_werror -Dwerror=false
%endif %endif
%if 0%{?rhel} == 7 %define tls_priority "@LIBVIRT,SYSTEM"
%define tls_priority "NORMAL"
%else
%define tls_priority "@LIBVIRT,SYSTEM"
%endif
Summary: Library providing a simple virtualization API Summary: Library providing a simple virtualization API
@ -262,20 +233,12 @@ Requires: libvirt-libs = %{version}-%{release}
# All build-time requirements. Run-time requirements are # All build-time requirements. Run-time requirements are
# listed against each sub-RPM # listed against each sub-RPM
%if 0%{?rhel} == 7
BuildRequires: python36-docutils
%else
BuildRequires: python3-docutils BuildRequires: python3-docutils
%endif
BuildRequires: gcc BuildRequires: gcc
BuildRequires: meson >= 0.54.0 BuildRequires: meson >= 0.54.0
BuildRequires: ninja-build BuildRequires: ninja-build
BuildRequires: git BuildRequires: git
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: perl-interpreter BuildRequires: perl-interpreter
%else
BuildRequires: perl
%endif
BuildRequires: python3 BuildRequires: python3
BuildRequires: systemd-units BuildRequires: systemd-units
%if %{with_libxl} %if %{with_libxl}
@ -333,13 +296,8 @@ BuildRequires: device-mapper-devel
# For XFS reflink clone support # For XFS reflink clone support
BuildRequires: xfsprogs-devel BuildRequires: xfsprogs-devel
%if %{with_storage_rbd} %if %{with_storage_rbd}
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: librados-devel BuildRequires: librados-devel
BuildRequires: librbd-devel BuildRequires: librbd-devel
%else
BuildRequires: librados2-devel
BuildRequires: librbd1-devel
%endif
%endif %endif
%if %{with_storage_gluster} %if %{with_storage_gluster}
BuildRequires: glusterfs-api-devel >= 3.4.1 BuildRequires: glusterfs-api-devel >= 3.4.1
@ -401,11 +359,7 @@ BuildRequires: wireshark-devel
BuildRequires: libssh-devel >= 0.7.0 BuildRequires: libssh-devel >= 0.7.0
%endif %endif
# On RHEL-7 rpcgen is still part of glibc-common package
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: rpcgen BuildRequires: rpcgen
%endif
BuildRequires: libtirpc-devel BuildRequires: libtirpc-devel
# Needed for the firewalld_reload macro # Needed for the firewalld_reload macro
@ -440,12 +394,10 @@ Requires: /usr/bin/nc
# for modprobe of pci devices # for modprobe of pci devices
Requires: module-init-tools Requires: module-init-tools
# for /sbin/ip & /sbin/tc # for /sbin/ip
Requires: iproute Requires: iproute
# tc is provided by iproute-tc since at least Fedora 26 # for /sbin/tc
%if 0%{?fedora} || 0%{?rhel} > 7
Requires: iproute-tc Requires: iproute-tc
%endif
Requires: polkit >= 0.112 Requires: polkit >= 0.112
%if %{with_dmidecode} %if %{with_dmidecode}
@ -529,9 +481,7 @@ Requires: libvirt-libs = %{version}-%{release}
# needed for device enumeration # needed for device enumeration
Requires: systemd >= 185 Requires: systemd >= 185
# For managing persistent mediated devices # For managing persistent mediated devices
%if 0%{?fedora} || 0%{?rhel} > 7
Requires: mdevctl Requires: mdevctl
%endif
%description daemon-driver-nodedev %description daemon-driver-nodedev
The nodedev driver plugin for the libvirtd daemon, providing The nodedev driver plugin for the libvirtd daemon, providing
@ -747,12 +697,8 @@ Requires: gzip
Requires: bzip2 Requires: bzip2
Requires: lzop Requires: lzop
Requires: xz Requires: xz
%if 0%{?fedora} || 0%{?rhel} > 7
Requires: systemd-container Requires: systemd-container
%endif
%if 0%{?fedora} || 0%{?rhel} > 7
Requires: swtpm-tools Requires: swtpm-tools
%endif
%description daemon-driver-qemu %description daemon-driver-qemu
The qemu driver plugin for the libvirtd daemon, providing The qemu driver plugin for the libvirtd daemon, providing
@ -768,9 +714,7 @@ Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-libs = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release}
# There really is a hard cross-driver dependency here # There really is a hard cross-driver dependency here
Requires: libvirt-daemon-driver-network = %{version}-%{release} Requires: libvirt-daemon-driver-network = %{version}-%{release}
%if 0%{?fedora} || 0%{?rhel} > 7
Requires: systemd-container Requires: systemd-container
%endif
%description daemon-driver-lxc %description daemon-driver-lxc
The LXC driver plugin for the libvirtd daemon, providing The LXC driver plugin for the libvirtd daemon, providing
@ -1292,16 +1236,6 @@ mv $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/libvirt_qemu_probes.stp \
# raising the test timeout # raising the test timeout
VIR_TEST_DEBUG=1 %meson_test --no-suite syntax-check --timeout-multiplier 10 VIR_TEST_DEBUG=1 %meson_test --no-suite syntax-check --timeout-multiplier 10
%post libs
%if 0%{?rhel} == 7
/sbin/ldconfig
%endif
%postun libs
%if 0%{?rhel} == 7
/sbin/ldconfig
%endif
%pre daemon %pre daemon
# 'libvirt' group is just to allow password-less polkit access to # 'libvirt' group is just to allow password-less polkit access to
# libvirtd. The uid number is irrelevant, so we use dynamic allocation # libvirtd. The uid number is irrelevant, so we use dynamic allocation

View File

@ -3,7 +3,7 @@
# This spec file assumes you are building on a Fedora version # This spec file assumes you are building on a Fedora version
# that's still supported by the vendor. It may work on other distros # that's still supported by the vendor. It may work on other distros
# or versions, but no effort will be made to ensure that going forward. # or versions, but no effort will be made to ensure that going forward.
%define min_fedora 31 %define min_fedora 33
%if 0%{?fedora} && 0%{?fedora} >= %{min_fedora} %if 0%{?fedora} && 0%{?fedora} >= %{min_fedora}
%define supported_platform 1 %define supported_platform 1