diff --git a/python-requests-file.spec b/python-requests-file.spec index e321ad8..82f86f8 100644 --- a/python-requests-file.spec +++ b/python-requests-file.spec @@ -1,8 +1,14 @@ %global srcname requests-file +%if 0%{?rhel} && 0%{?rhel} <= 7 +%bcond_with python3 +%else +%bcond_without python3 +%endif + Name: python-%{srcname} Version: 1.4.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Transport adapter for using file:// URLs with python-requests License: ASL 2.0 @@ -21,6 +27,16 @@ This is the Python 2 version of the requests_file module Summary: Transport adapter for using file:// URLs with python-requests %{?python_provide:%python_provide python2-%{srcname}} +%if 0%{?rhel} && 0%{?rhel} <= 7 +# EL7 has unversioned names for these packages +BuildRequires: python-devel +BuildRequires: python-setuptools +BuildRequires: python-requests +BuildRequires: python-six + +Requires: python-requests +Requires: python-six +%else BuildRequires: python2-devel BuildRequires: python2-setuptools BuildRequires: python2-requests @@ -28,6 +44,7 @@ BuildRequires: python2-six Requires: python2-requests Requires: python2-six +%endif %description -n python2-%{srcname} Requests-File is a transport adapter for use with the Requests Python @@ -35,6 +52,7 @@ library to allow local file system access via file:// URLs. This is the Python 2 version of the requests_file module +%if %{with python3} %package -n python3-requests-file Summary: Transport adapter for using file:// URLs with python3-requests %{?python_provide:%python_provide python3-%{srcname}} @@ -52,6 +70,7 @@ Requests-File is a transport adapter for use with the Requests Python library to allow local file system access via file:// URLs. This is the Python 3 version of the requests_file module +%endif %prep %autosetup -n %{srcname}-%{version} @@ -59,15 +78,21 @@ rm -rf requests_file.egg-info %build %py2_build +%if %{with python3} %py3_build +%endif %install %py2_install +%if %{with python3} %py3_install +%endif %check %{__python2} setup.py test +%if %{with python3} %{__python3} setup.py test +%endif %files -n python2-%{srcname} %license LICENSE @@ -75,14 +100,19 @@ rm -rf requests_file.egg-info %{python2_sitelib}/requests_file.py* %{python2_sitelib}/requests_file*.egg-info* +%if %{with python3} %files -n python3-requests-file %license LICENSE %doc README.rst %{python3_sitelib}/requests_file.py* %{python3_sitelib}/__pycache__/requests_file.* %{python3_sitelib}/requests_file*.egg-info* +%endif %changelog +* Wed Feb 7 2018 Eli Young - 1.4.3-3 +- Package for EPEL7 + * Sat Jan 27 2018 Iryna Shcherbina - 1.4.3-2 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)