summaryrefslogtreecommitdiff
path: root/libvirt-python.spec.in
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2018-01-11 16:32:40 +0000
committerDaniel P. Berrange <berrange@redhat.com>2018-01-12 18:15:45 +0000
commitf6ea01496a212be720b95615b89ad41385818aea (patch)
treefffe9276a4a937d8d0395dd56e7018f555d91ec6 /libvirt-python.spec.in
parent7cde26caa9535373ff0e35a3d25d6c3a756f4b5e (diff)
downloadlibvirt-python-f6ea01496a212be720b95615b89ad41385818aea.tar.gz
Add checks for min supported distros
Be clear about which distros we aim to support with the specfile, so we know what we can cleanup in the spec later. Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'libvirt-python.spec.in')
-rw-r--r--libvirt-python.spec.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in
index 1619e26..a98b902 100644
--- a/libvirt-python.spec.in
+++ b/libvirt-python.spec.in
@@ -1,3 +1,14 @@
+# 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
+# or versions, but no effort will be made to ensure that going forward
+%define min_rhel 6
+%define min_fedora 25
+
+%if (0%{?fedora} && 0%{?fedora} >= %{min_fedora}) || (0%{?rhel} && 0%{?rhel} >= %{min_rhel})
+ %define supported_platform 1
+%else
+ %define supported_platform 0
+%endif
%define _with_python2 1
%define _with_python3 0
@@ -81,6 +92,11 @@ of recent versions of Linux (and other OSes).
find examples -type f -exec chmod 0644 \{\} \;
%build
+%if ! %{supported_platform}
+echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}"
+exit 1
+%endif
+
%if %{with_python2}
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%endif