Blame SOURCES/dnf-plugin-spacewalk-2.8.5-3-el8-to-dnf-plugin-spacewalk-2.8.5-4-el8.patch

051232
diff --git a/dnf-plugin-spacewalk.spec b/dnf-plugin-spacewalk.spec
051232
index d0533dc..e73ef9b 100644
051232
--- a/dnf-plugin-spacewalk.spec
051232
+++ b/dnf-plugin-spacewalk.spec
051232
@@ -3,12 +3,16 @@
051232
 %global default_py3 1
051232
 %endif
051232
 
051232
+%if ( 0%{?fedora} && 0%{?fedora} < 28 ) || ( 0%{?rhel} && 0%{?rhel} < 8 )
051232
+%global build_py2   1
051232
+%endif
051232
+
051232
 %define pythonX %{?default_py3: python3}%{!?default_py3: python2}
051232
 
051232
 Summary: DNF plugin for Spacewalk
051232
 Name: dnf-plugin-spacewalk
051232
 Version: 2.8.5
051232
-Release: 3%{?dist}
051232
+Release: 4%{?dist}
051232
 License: GPLv2
051232
 Source0: https://github.com/spacewalkproject/spacewalk/archive/%{name}-%{version}.tar.gz
051232
 URL:     https://github.com/spacewalkproject/spacewalk
051232
@@ -29,6 +33,7 @@ Obsoletes: yum-rhn-plugin < 2.7
051232
 %description
051232
 This DNF plugin provides access to a Spacewalk server for software updates.
051232
 
051232
+%if 0%{?build_py2}
051232
 %package -n python2-%{name}
051232
 Summary: DNF plugin for Spacewalk
051232
 %{?python_provide:%python_provide python2-%{name}}
051232
@@ -37,6 +42,7 @@ Requires: %{name} = %{version}-%{release}
051232
 Requires: python2-rhn-client-tools >= 2.8.4
051232
 %description -n python2-%{name}
051232
 Python 2 specific files for %{name}.
051232
+%endif
051232
 
051232
 %if 0%{?build_py3}
051232
 %package -n python3-%{name}
051232
@@ -67,11 +73,13 @@ install -m 644 man/spacewalk.conf.5 %{buildroot}%{_mandir}/man5/
051232
 install -m 644 man/dnf.plugin.spacewalk.8 %{buildroot}%{_mandir}/man8/
051232
 
051232
 # python2
051232
+%if 0%{?build_py2}
051232
 install -d %{buildroot}%{python2_sitelib}/rhn/actions
051232
 install -d %{buildroot}%{python2_sitelib}/dnf-plugins/
051232
 install -m 644 spacewalk.py %{buildroot}%{python2_sitelib}/dnf-plugins/
051232
 install -m 644 actions/packages.py %{buildroot}%{python2_sitelib}/rhn/actions/
051232
 install -m 644 actions/errata.py %{buildroot}%{python2_sitelib}/rhn/actions/
051232
+%endif
051232
 
051232
 %if 0%{?build_py3}
051232
 install -d %{buildroot}%{python3_sitelib}/rhn/actions
051232
@@ -91,9 +99,11 @@ install -m 644 actions/errata.py %{buildroot}%{python3_sitelib}/rhn/actions/
051232
 %dir /var/lib/up2date
051232
 %{_mandir}/man*/*
051232
 
051232
+%if 0%{?build_py2}
051232
 %files -n python2-%{name}
051232
 %{python_sitelib}/dnf-plugins/*
051232
 %{python_sitelib}/rhn/actions/*
051232
+%endif
051232
 
051232
 %if 0%{?build_py3}
051232
 %files -n python3-%{name}
051232
@@ -102,6 +112,10 @@ install -m 644 actions/errata.py %{buildroot}%{python3_sitelib}/rhn/actions/
051232
 %endif
051232
 
051232
 %changelog
051232
+* Tue Mar 20 2018 Tomas Kasparek <tkasparek@redhat.com> 2.8.5-4
051232
+- don't build python2 subpackages on systems with default python2
051232
+  (tkasparek@redhat.com)
051232
+
051232
 * Tue Feb 20 2018 Tomas Kasparek <tkasparek@redhat.com> 2.8.5-3
051232
 - %%if 0%%{?fedora} <= 25 is always true on rhel (tkasparek@redhat.com)
051232
 - rhel8 utilizes python3 (tkasparek@redhat.com)