From 2ed829ec18cbe5ca9a50b9fcd0fb984a29ad2c87 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sep 03 2019 17:16:44 +0000 Subject: Drop python2 subpackages: python2-fedora, python2-fedora-flask --- diff --git a/python-fedora.spec b/python-fedora.spec index b915bc4..8ce5ec3 100644 --- a/python-fedora.spec +++ b/python-fedora.spec @@ -1,6 +1,8 @@ %if 0%{?fedora} %global with_python3 1 %global py3dir ../python3 +%else +%global with_python2 1 %endif #%%global prerel c2 @@ -13,7 +15,7 @@ and FAS2.\ Name: python-fedora Version: 0.10.0 -Release: 10%{?dist} +Release: 11%{?dist} BuildArch: noarch License: LGPLv2+ @@ -21,20 +23,12 @@ Summary: Python modules for talking to Fedora Infrastructure Services URL: https://github.com/fedora-infra/python-fedora Source0: https://github.com/fedora-infra/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz -BuildRequires: python2-devel -%if 0%{?fedora} -BuildRequires: python2-lockfile -BuildRequires: python2-munch -BuildRequires: python2-openid -BuildRequires: python2-openid-cla -BuildRequires: python2-openid-teams -%else +%if 0%{?with_python2} BuildRequires: python-lockfile BuildRequires: python-munch BuildRequires: python-openid BuildRequires: python-openid-cla BuildRequires: python-openid-teams -%endif %if 0%{?rhel} == 6 BuildRequires: python-sphinx10 @@ -47,6 +41,7 @@ BuildRequires: python-sphinx %if (0%{?fedora} && (0%{?fedora} <= 30)) || (0%{?rhel} >= 7) BuildRequires: python-cherrypy2 %endif +%endif # Needed for tests and for the way we build docs %if 0%{?rhel} && 0%{?rhel} < 7 @@ -54,14 +49,7 @@ BuildRequires: python-cherrypy2 BuildRequires: TurboGears %endif -%if 0%{?fedora} -BuildRequires: python2-babel -BuildRequires: python2-nose -BuildRequires: python2-requests >= 2.6.0 -BuildRequires: python2-setuptools -BuildRequires: python2-kitchen -BuildRequires: python2-six -%else +%if 0%{?with_python2} BuildRequires: python-babel BuildRequires: python-kitchen BuildRequires: python-nose @@ -90,44 +78,29 @@ BuildRequires: python3-sphinx %description %{desc} - +%if 0%{?with_python2} %package -n python2-fedora Summary: %{summary} -%if 0%{?fedora} -Requires: python2-beautifulsoup4 -Requires: python2-lockfile -Requires: python2-munch -%else Requires: python-beautifulsoup4 Requires: python-lockfile Requires: python-munch -%endif # These are now optional dependencies. Some bodhi methods will not work if # they aren't installed but they aren't needed for most functionality of the # module. #Requires: koji python-iniparse yum -%if 0%{?fedora} -Requires: python2-openidc-client -Requires: python2-requests >= 2.6.0 -Requires: python2-kitchen -Requires: python2-six -%else Requires: python-openidc-client Requires: python-requests >= 2.6.0 Requires: python-kitchen Requires: python-six -%endif - %{?python_provide:%python_provide python2-fedora} - %description -n python2-fedora %{desc} - +%endif %if 0%{?with_python3} %package -n python3-fedora @@ -192,23 +165,16 @@ other helper functions for TurboGears applications. %endif +%if 0%{?with_python2} %package -n python2-fedora-flask Summary: Python modules for flask applications authing to Fedora Account System License: LGPLv2+ -%if 0%{?fedora} -Requires: python2-flask-wtf -Requires: python2-openid -Requires: python2-openid-cla -Requires: python2-openid-teams -Requires: python2-flask -%else Requires: python-flask-wtf Requires: python-openid Requires: python-openid-cla Requires: python-openid-teams Requires: python-flask -%endif Requires: python2-fedora = %{version}-%{release} %{?python_provide:%python_provide python2-fedora-flask} @@ -218,6 +184,7 @@ Requires: python2-fedora = %{version}-%{release} Python modules that help with building Fedora Services. This package includes an auth provider to let flask applications authenticate against the Fedora Account System. +%endif %prep %autosetup -c -n %{name}-%{version} @@ -246,9 +213,11 @@ rm -rf python2/fedora/django %build +%if 0%{?with_python2} pushd python2 %{__python2} setup.py build popd +%endif %if 0%{?with_python3} pushd python3 @@ -256,7 +225,7 @@ pushd python3 ## No docs, because that tries to hit the tg pathways (py2-only) #%{__python3} setup.py build_sphinx ## We can probably port releaseutils.py, but we haven't yet. -#%{__python3} releaseutils.py build_catalogs +%{__python3} releaseutils.py build_catalogs popd %endif @@ -265,7 +234,10 @@ pushd python2 ## No docs. Sphinx 2 in Fedora 31+ doesn't support Python 2 %{__python2} setup_docs.py build_sphinx %endif + +%if 0%{?with_python2} %{__python2} releaseutils.py build_catalogs +%endif popd %install @@ -273,18 +245,21 @@ popd pushd python3 %{__python3} setup.py install --skip-build --root %{buildroot} ## We can probably port releaseutils.py, but we haven't yet. -#DESTDIR=%{buildroot} %{__python3} releaseutils.py install_catalogs +DESTDIR=%{buildroot} %{__python3} releaseutils.py install_catalogs # Remove regression tests rm -rf %{buildroot}%{python3_sitelib}/fedora/wsgi/test rm -rf %{buildroot}%{python3_sitelib}/tests/ +%find_lang %{name} + popd %endif +%if 0%{?with_python2} pushd python2 %{__python2} setup.py install --skip-build --root %{buildroot} -DESTDIR=%{buildroot} %{__python2} releaseutils.py install_catalogs +DESTDIR=%{buildroot} %{__python3} releaseutils.py install_catalogs # Cleanup doc %if (0%{?rhel} != 6) && (0%{?fedora} < 31) @@ -301,7 +276,9 @@ rm -rf %{buildroot}%{python2_sitelib}/tests/ %find_lang %{name} popd +%endif +%if 0%{?with_python2} %files -f python2/%{name}.lang -n python2-fedora %license python2/COPYING %doc python2/NEWS python2/README.rst python2/AUTHORS @@ -314,9 +291,10 @@ popd %exclude %{python2_sitelib}/fedora/tg2/ %exclude %{python2_sitelib}/fedora/wsgi/ %exclude %{python2_sitelib}/flask_fas_openid.py* +%endif %if 0%{?with_python3} -%files -f python2/%{name}.lang -n python3-fedora +%files -f python3/%{name}.lang -n python3-fedora %license python3/COPYING %doc python2/NEWS python2/README.rst python2/AUTHORS %if (0%{?rhel} != 6) && (0%{?fedora} < 31) @@ -340,10 +318,15 @@ popd %{python2_sitelib}/fedora/tg/ %endif +%if 0%{?with_python2} %files -n python2-fedora-flask %{python2_sitelib}/flask_fas_openid.py* +%endif %changelog +* Tue Sep 3 2019 Zbigniew Jędrzejewski-Szmek - 0.10.0-11 +- Drop python2 subpackages: python2-fedora, python2-fedora-flask (#1748242) + * Sun Aug 18 2019 Miro Hrončok - 0.10.0-10 - Rebuilt for Python 3.8