From 591792c760170fb4ed08aea246e6aa0fcafa25de Mon Sep 17 00:00:00 2001 From: Eli Young Date: Dec 11 2018 01:46:58 +0000 Subject: Remove Python 2 package in Fedora 30+ (#1654016) --- diff --git a/python-certbot-apache.spec b/python-certbot-apache.spec index a4122ee..f4d1f8f 100644 --- a/python-certbot-apache.spec +++ b/python-certbot-apache.spec @@ -1,12 +1,17 @@ %global pyname certbot-apache -# 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.25.0 BuildRequires: python2-certbot >= 0.26.0 @@ -32,6 +40,7 @@ BuildRequires: python-augeas %else BuildRequires: python2-augeas %endif +%endif %if %{with python3} BuildRequires: python3-acme >= 0.25.0 @@ -42,6 +51,7 @@ BuildRequires: python3-augeas %description Plugin for certbot that allows for automatic configuration of apache +%if %{with python2} %package -n python2-%{pyname} # Provide the name users expect as a certbot plugin @@ -70,6 +80,7 @@ Summary: The apache plugin for certbot %description -n python2-%{pyname} Plugin for certbot that allows for automatic configuration of apache +%endif %if %{with python3} %package -n python3-%{pyname} @@ -102,29 +113,37 @@ Plugin for certbot that allows for automatic configuration of apache %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_apache %{python2_sitelib}/certbot_apache-%{version}*.egg-info +%endif %if %{with python3} %files -n python3-%{pyname} @@ -137,6 +156,7 @@ Plugin for certbot that allows for automatic configuration of apache %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