From 2cfeed6b361f4e537981e54792a811be7806f35e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Mon, 9 Sep 2019 22:28:54 +0100 Subject: [PATCH] Build python3-html2text on epel 7 (#1740322) Drop python2 on Fedora >= 31 (#1741010) --- python-html2text.spec | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/python-html2text.spec b/python-html2text.spec index 77bac12..6642428 100644 --- a/python-html2text.spec +++ b/python-html2text.spec @@ -1,4 +1,10 @@ -%if 0%{?rhel} >= 8 || 0%{?fedora} >= 16 +%if (0%{?rhel} && 0%{?rhel} <= 7) || (0%{?fedora} && 0%{?fedora} <= 30) +%bcond_without python2 +%else +%bcond_with python2 +%endif + +%if 0%{?rhel} >= 7 || 0%{?fedora} >= 16 %bcond_without python3 %else %bcond_with python3 @@ -42,18 +48,19 @@ Obsoletes: %{upname} <= 1.3.2a-17 %{common_desc} -%if %{with python3} %package -n python3-%{upname} Summary: %{common_sum} BuildRequires: python3-devel BuildRequires: python3-setuptools Provides: %{upname} = %{version}-%{release} Obsoletes: %{upname} <= 1.3.2a-17 +%if !%{with python2} +Obsoletes: python2-%{upname} <= %{version}-%{release} +%endif %{?python_provide:%python_provide python3-%{upname}} %description -n python3-%{upname} %{common_desc} -%endif # with_python3 %prep @@ -62,18 +69,22 @@ Obsoletes: %{upname} <= 1.3.2a-17 %build +%if %{with python2} %py2_build +%endif %if %{with python3} %py3_build %endif %install +%if %{with python2} %{__mkdir} -p %{buildroot}%{_mandir}/man1 %py2_install %{__mv} -f %{buildroot}%{_bindir}/%{upname} %{buildroot}%{_bindir}/python2-%{upname} export PYTHONPATH="%{buildroot}%{python2_sitelib}" %{_bindir}/help2man -s 1 -N -o %{buildroot}%{_mandir}/man1/python2-%{upname}.1 %{buildroot}%{_bindir}/python2-%{upname} +%endif %if !%{with python3} pushd %{buildroot}%{_bindir} ln -s python2-%{upname} %{upname} @@ -102,12 +113,15 @@ popd %check +%if %{with python2} %{__python2} setup.py test -vv +%endif %if %{with python3} %{__python3} setup.py test -vv %endif +%if %{with python2} %files -n python2-%{upname} %license AUTHORS.* COPYING %doc README.* ChangeLog.* PKG-INFO @@ -121,6 +135,7 @@ popd %endif %{python2_sitelib}/%{upname} %{python2_sitelib}/%{upname}-%{version}-py%{python2_version}.egg-info +%endif %if %{with python3} @@ -141,6 +156,8 @@ popd %changelog * Mon Sep 09 2019 Sérgio Basto - 2019.8.11-1 - Update to 2019.8.11 +- Build python3-html2text on epel 7 (#1740322) +- Drop python2 on Fedora >= 31 (#1741010) * Mon Aug 19 2019 Miro Hrončok - 2018.1.9-3 - Rebuilt for Python 3.8