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

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