]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
spec: Drop supported_platform variable
authorAndrea Bolognani <abologna@redhat.com>
Wed, 5 May 2021 17:35:42 +0000 (19:35 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Thu, 6 May 2021 09:06:08 +0000 (11:06 +0200)
It's only used in one place, and it's nicer to keep the error
message close to the check that causes it to be emitted.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
libvirt.spec.in
mingw-libvirt.spec.in

index 013c7742a25ac2e6c3100d3765423ebd3115f0ee..9dea6c67874cc8d51876cb69cb3421c2415c6b47 100644 (file)
@@ -6,12 +6,6 @@
 %define min_rhel 8
 %define min_fedora 33
 
-%if 0%{?fedora} >= %{min_fedora} || 0%{?rhel} >= %{min_rhel}
-    %define supported_platform 1
-%else
-    %define supported_platform 0
-%endif
-
 %define arches_qemu_kvm         %{ix86} x86_64 %{power64} %{arm} aarch64 s390x
 %if 0%{?rhel}
     %define arches_qemu_kvm     x86_64 aarch64 s390x
@@ -929,9 +923,9 @@ Libvirt plugin for NSS for translating domain names into IP addresses.
 %autosetup -S git_am
 
 %build
-%if ! %{supported_platform}
-echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}"
-exit 1
+%if (0%{?fedora} && 0%{?fedora} < %{min_fedora}) || (0%{?rhel} && 0%{?rhel} < %{min_rhel})
+    echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}"
+    exit 1
 %endif
 
 %if %{with_qemu}
index 84b8998f747dfe378cb3b12d966c59ca9c7fc3d0..61a4843fb38f806609f1a53df148739e5dc2e0f9 100644 (file)
@@ -5,12 +5,6 @@
 # or versions, but no effort will be made to ensure that going forward.
 %define min_fedora 33
 
-%if 0%{?fedora} && 0%{?fedora} >= %{min_fedora}
-    %define supported_platform 1
-%else
-    %define supported_platform 0
-%endif
-
 Name:           mingw-libvirt
 Version:        @VERSION@
 Release:        1%{?dist}
@@ -95,9 +89,9 @@ MinGW Windows libvirt virtualization library.
 %setup -q -n libvirt-%{version}
 
 %build
-%if ! %{supported_platform}
-echo "This RPM requires Fedora >= %{min_fedora}"
-exit 1
+%if 0%{?fedora} < %{min_fedora}
+    echo "This RPM requires Fedora >= %{min_fedora}"
+    exit 1
 %endif
 
 %mingw_meson \