From da79de0322d9b05d8569408bbe5e63adf289abc4 Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Feb 26 2021 21:27:41 +0000 Subject: remove support for Python 2 subpackages as version 1.12 only supports Python 3.6+ --- diff --git a/python-acme.spec b/python-acme.spec index 1e54fe4..03e5433 100644 --- a/python-acme.spec +++ b/python-acme.spec @@ -1,18 +1,6 @@ %global srcname acme -%if (0%{?fedora}) || (0%{?rhel} && 0%{?rhel} >= 8) -%bcond_without python3 -%else -%bcond_with python3 -%endif - -%if (0%{?fedora} && 0%{?fedora} >= 30) || (0%{?rhel} && 0%{?rhel} >= 8) -%bcond_with python2 %global SPHINXBUILD sphinx-build-3 -%else -%bcond_without python2 -%global SPHINXBUILD sphinx-build -%endif Name: python-acme Version: 1.12.0 @@ -38,20 +26,6 @@ Patch1: %{name}-lower-pyopenssl-requirement-epel7.patch BuildRequires: make %endif -%if %{with python2} -BuildRequires: python2-devel -BuildRequires: python2-sphinx -%if 0%{?fedora} -BuildRequires: python2-sphinx_rtd_theme -%endif -BuildRequires: python2-cryptography -BuildRequires: python2-mock -BuildRequires: python2-requests >= 2.6.0 -BuildRequires: python2-pyrfc3339 -BuildRequires: python2-josepy >= 1.1.0 -%endif - -%if %{with python3} BuildRequires: python3-devel BuildRequires: python3-sphinx BuildRequires: python3-sphinx_rtd_theme @@ -62,37 +36,10 @@ BuildRequires: python3-requests-toolbelt BuildRequires: python3-setuptools BuildRequires: python3-pyrfc3339 BuildRequires: python3-josepy >= 1.1.0 -%endif - -%if %{with python2} -%if 0%{?fedora} >= 28 -# Fedora 28 added versioned names for this package -BuildRequires: python2-pytz -%else -BuildRequires: pytz -%endif -%if 0%{?rhel} && 0%{?rhel} <= 7 -# EL7 has unversioned names for these packages -BuildRequires: pytest -BuildRequires: python-ndg_httpsclient -BuildRequires: python-requests-toolbelt -BuildRequires: python-setuptools -BuildRequires: pyOpenSSL >= 0.13.1 -%else -BuildRequires: python2-ndg_httpsclient -BuildRequires: python2-pytest -BuildRequires: python2-requests-toolbelt -BuildRequires: python2-setuptools -BuildRequires: python2-pyOpenSSL >= 0.13.1 -%endif -%endif - -%if %{with python3} BuildRequires: python3-ndg_httpsclient BuildRequires: python3-pytest BuildRequires: python3-pytz -%endif # Used to verify OpenPGP signature BuildRequires: gnupg2 @@ -107,47 +54,6 @@ BuildArch: noarch Python libraries implementing the Automatic Certificate Management Environment (ACME) protocol. It is used by the Let's Encrypt project. -%if %{with python2} -%package -n python2-acme -Requires: python2-cryptography -Requires: python2-pyasn1 -Requires: python2-pyrfc3339 -Requires: python2-requests >= 2.6.0 -Requires: python2-six -Requires: python2-josepy >= 1.1.0 - -%if 0%{?fedora} >= 28 -# Fedora 28 added versioned names for this package -Requires: python2-pytz -%else -Requires: pytz -%endif - -%if 0%{?rhel} && 0%{?rhel} <= 7 -# EL7 has unversioned names for these packages -Requires: python-ndg_httpsclient -Requires: python-requests-toolbelt -Requires: pyOpenSSL >= 0.13.1 -%else -Requires: python2-ndg_httpsclient -Requires: python2-requests-toolbelt -Requires: python2-pyOpenSSL >= 0.13.1 -%endif - -%if %{with python3} -# Recommends not supported by rpm on EL7 -#Recommends: python-acme-doc -%endif -Summary: %{summary} -%{?python_provide:%python_provide python2-acme} - - -%description -n python2-acme -Python 2 library for use of the Automatic Certificate Management Environment -protocol as defined by the IETF. It's used by the Let's Encrypt project. -%endif - -%if %{with python3} %package -n python3-acme Requires: python3-cryptography Requires: python3-ndg_httpsclient @@ -166,7 +72,6 @@ Summary: %{summary} %description -n python3-acme Python 3 library for use of the Automatic Certificate Management Environment protocol as defined by the IETF. It's used by the Let's Encrypt project. -%endif %if 0%{?fedora} %package doc @@ -190,20 +95,10 @@ rm -rf %{srcname}.egg-info %build -%if %{with python2} -%py2_build -%endif -%if %{with python3} %py3_build -%endif %install -%if %{with python2} -%py2_install -%endif -%if %{with python3} %py3_install -%endif # Doc generation is currently broken on EL7, see bz#1492884 %if 0%{?fedora} @@ -216,29 +111,13 @@ rm -rf docs/_build/html/{.buildinfo,man,_sources} %endif %check -%if %{with python2} -%{__python2} setup.py test -%endif - -%if %{with python3} PYTHONPATH=%{buildroot}%{python3_sitelib} py.test-%{python3_version} -v -%endif -%if %{with python2} -%files -n python2-acme -%license LICENSE.txt -%doc README.rst -%{python2_sitelib}/%{srcname} -%{python2_sitelib}/%{srcname}-%{version}*.egg-info -%endif - -%if %{with python3} %files -n python3-acme %license LICENSE.txt %doc README.rst %{python3_sitelib}/%{srcname} %{python3_sitelib}/%{srcname}-%{version}*.egg-info -%endif %if 0%{?fedora} %files doc