diff --git a/python-certbot-nginx.spec b/python-certbot-nginx.spec index cd8f13f..166e3df 100644 --- a/python-certbot-nginx.spec +++ b/python-certbot-nginx.spec @@ -1,12 +1,17 @@ %global pyname certbot-nginx -# On fedora use python3 for certbot %if 0%{?fedora} %bcond_without python3 %else %bcond_with python3 %endif +%if 0%{?fedora} && 0%{?fedora} >= 30 +%bcond_with python2 +%else +%bcond_without python2 +%endif + Name: python-%{pyname} Version: 0.29.1 Release: 1%{?dist} @@ -18,12 +23,15 @@ Source0: https://files.pythonhosted.org/packages/source/c/%{pyname}/%{pyname} BuildArch: noarch +%if %{with python2} BuildRequires: python2-devel +%endif %if %{with python3} BuildRequires: python3-devel %endif +%if %{with python2} #For running tests BuildRequires: python2-acme >= 0.26.0 BuildRequires: python2-certbot >= 0.22.0 @@ -32,6 +40,7 @@ BuildRequires: pyparsing %else BuildRequires: python2-pyparsing %endif +%endif %if %{with python3} BuildRequires: python3-acme >= 0.26.0 @@ -42,6 +51,7 @@ BuildRequires: python3-pyparsing %description Plugin for certbot that allows for automatic configuration of ngnix +%if %{with python2} %package -n python2-%{pyname} # Provide the name users expect as a certbot plugin %if ( 0%{?rhel} && 0%{?rhel} <= 7 ) || ( 0%{?fedora} && 0%{?fedora} <= 25 ) @@ -67,6 +77,7 @@ Summary: The nginx plugin for certbot %description -n python2-%{pyname} Plugin for certbot that allows for automatic configuration of nginx +%endif %if %{with python3} %package -n python3-%{pyname} @@ -96,30 +107,38 @@ Plugin for certbot that allows for automatic configuration of nginx %autosetup -p1 -n %{pyname}-%{version} %build +%if %{with python2} %{py2_build} +%endif %if %{with python3} %py3_build %endif %check +%if %{with python2} %{__python2} setup.py test +%endif %if %{with python3} %{__python3} setup.py test %endif %install +%if %{with python2} %{py2_install} +%endif %if %{with python3} %py3_install %endif +%if %{with python2} %files -n python2-%{pyname} %license LICENSE.txt %doc README.rst %{python2_sitelib}/certbot_nginx %exclude %{python2_sitelib}/certbot_nginx/tests %{python2_sitelib}/certbot_nginx-%{version}*.egg-info +%endif %if %{with python3} %files -n python3-%{pyname} @@ -133,6 +152,7 @@ Plugin for certbot that allows for automatic configuration of nginx %changelog * Tue Dec 11 2018 Eli Young - 0.29.1-1 - Update to 0.29.1 +- Remove Python 2 package in Fedora 30+ (#1654016) * Wed Nov 14 2018 Eli Young - 0.28.0-1 - Update to 0.28.0