diff --git a/python-certbot-dns-google.spec b/python-certbot-dns-google.spec index ba75a06..88e8689 100644 --- a/python-certbot-dns-google.spec +++ b/python-certbot-dns-google.spec @@ -6,6 +6,14 @@ %bcond_without python3 %endif +# TODO: Remove this once either upstream replaces oauth2client with google-auth +# (upstream #6507) or python2-oauth2client no longer requres python2-keyring +%if 0%{?fedora} && 0%{?fedora} >= 30 +%bcond_with python2 +%else +%bcond_without python2 +%endif + Name: python-%{pyname} Version: 0.28.0 Release: 1%{?dist} @@ -17,6 +25,7 @@ Source0: https://files.pythonhosted.org/packages/source/c/%{pyname}/%{pyn BuildArch: noarch +%if %{with python2} BuildRequires: python2-acme >= 0.21.1 BuildRequires: python2-certbot >= 0.21.1 BuildRequires: python2-devel @@ -31,6 +40,7 @@ BuildRequires: python-httplib2 %else BuildRequires: python2-httplib2 %endif +%endif %if %{with python3} BuildRequires: python3-acme >= 0.21.1 @@ -49,6 +59,7 @@ This certbot plugin automates the process of completing an ACME dns-01 challenge by creating, and subsequently removing, TXT records using Google Cloud DNS. +%if %{with python2} %package -n python2-%{pyname} # Provide the name users expect as a certbot plugin %if 0%{?rhel} && 0%{?rhel} <= 7 @@ -84,6 +95,7 @@ dns-01 challenge by creating, and subsequently removing, TXT records using Google Cloud DNS. This is the Python 2 version of the package. +%endif %if %{with python3} %package -n python3-%{pyname} @@ -122,28 +134,39 @@ This is the Python 3 version of the package. %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_dns_google %{python2_sitelib}/certbot_dns_google-%{version}*.egg-info +%endif %if %{with python3} %files -n python3-%{pyname}