Restore use of bcond for python conditionals

This commit is contained in:
John Dennis 2018-07-10 15:47:11 -04:00
parent ef8395cff1
commit 3ea2ad2426

View File

@ -1,13 +1,13 @@
%bcond_with jwcrypto %bcond_with jwcrypto
%global with_python2 0
%global with_python3 0
%if (0%{?fedora} > 0 && 0%{?fedora} < 32) || (0%{?rhel} > 0 && 0%{?rhel} <= 7) %if (0%{?fedora} > 0 && 0%{?fedora} < 32) || (0%{?rhel} > 0 && 0%{?rhel} <= 7)
%global with_python2 1 %bcond_without python2
%bcond_without python3
%endif %endif
%if 0%{?fedora} || 0%{?rhel} >= 8 %if 0%{?fedora} || 0%{?rhel} >= 8
%global with_python3 1 %bcond_with python2
%bcond_without python3
%endif %endif
%if 0%{?rhel} && 0%{?rhel} <= 7 %if 0%{?rhel} && 0%{?rhel} <= 7
@ -30,7 +30,7 @@
Name: python-oauthlib Name: python-oauthlib
Version: 2.0.1 Version: 2.0.1
Release: 9%{?dist} Release: 10%{?dist}
Summary: An implementation of the OAuth request-signing logic Summary: An implementation of the OAuth request-signing logic
Group: Development/Libraries Group: Development/Libraries
@ -52,7 +52,7 @@ onto your favourite web framework. If you're a maintainer of such a
library, write a thin veneer on top of OAuthLib and get OAuth support for library, write a thin veneer on top of OAuthLib and get OAuth support for
very little effort. very little effort.
%if 0%{with_python2} %if %{with python2}
%package -n python2-oauthlib %package -n python2-oauthlib
Summary: An implementation of the OAuth request-signing logic Summary: An implementation of the OAuth request-signing logic
Group: Development/Libraries Group: Development/Libraries
@ -88,7 +88,7 @@ library, write a thin veneer on top of OAuthLib and get OAuth support for
very little effort. very little effort.
%endif # with python2 %endif # with python2
%if 0%{with_python3} %if %{with python3}
%package -n python3-oauthlib %package -n python3-oauthlib
Summary: An implementation of the OAuth request-signing logic Summary: An implementation of the OAuth request-signing logic
Group: Development/Libraries Group: Development/Libraries
@ -140,30 +140,30 @@ sed -i "s/'unittest2', //" setup.py
rm -rf %{modname}.egg-info rm -rf %{modname}.egg-info
%build %build
%if 0%{with_python2} %if %{with python2}
%py2_build %py2_build
%endif # with python2 %endif # with python2
%if 0%{with_python3} %if %{with python3}
%py3_build %py3_build
%endif # with python3 %endif # with python3
%install %install
%if 0%{with_python2} %if %{with python2}
%py2_install %py2_install
%endif # with python2 %endif # with python2
%if 0%{with_python3} %if %{with python3}
%py3_install %py3_install
%endif # with python3 %endif # with python3
%check %check
%if 0%{with_python2} %if %{with python2}
%{__python2} setup.py test %{__python2} setup.py test
%endif # with python2 %endif # with python2
%if 0%{with_python3} %if %{with python3}
%{__python3} setup.py test %{__python3} setup.py test
%endif # with python3 %endif # with python3
%if 0%{with_python2} %if %{with python2}
%files -n python2-oauthlib %files -n python2-oauthlib
%doc README.rst %doc README.rst
%license LICENSE %license LICENSE
@ -171,7 +171,7 @@ rm -rf %{modname}.egg-info
%{python2_sitelib}/%{modname}-%{version}* %{python2_sitelib}/%{modname}-%{version}*
%endif # with python2 %endif # with python2
%if 0%{with_python3} %if %{with python3}
%files -n python3-oauthlib %files -n python3-oauthlib
%doc README.rst %doc README.rst
%license LICENSE %license LICENSE
@ -180,6 +180,9 @@ rm -rf %{modname}.egg-info
%endif # with python3 %endif # with python3
%changelog %changelog
* Tue Jul 10 2018 <jdennis@redhat.com> - 2.0.1-10
- Restore use of bcond for python conditionals
* Tue Jul 10 2018 <jdennis@redhat.com> - 2.0.1-9 * Tue Jul 10 2018 <jdennis@redhat.com> - 2.0.1-9
- Unify spec file between Fedora and RHEL - Unify spec file between Fedora and RHEL