diff --git a/python-requests-file.spec b/python-requests-file.spec index 2469f4a..a4d1f0e 100644 --- a/python-requests-file.spec +++ b/python-requests-file.spec @@ -6,9 +6,16 @@ %bcond_without python3 %endif +%if 0%{?rhel} > 7 +# Disable python2 build by default +%bcond_with python2 +%else +%bcond_without python2 +%endif + Name: python-%{srcname} Version: 1.4.3 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Transport adapter for using file:// URLs with python-requests License: ASL 2.0 @@ -23,6 +30,7 @@ library to allow local file system access via file:// URLs. This is the Python 2 version of the requests_file module +%if %{with python2} %package -n python2-%{srcname} Summary: Transport adapter for using file:// URLs with python-requests %{?python_provide:%python_provide python2-%{srcname}} @@ -40,6 +48,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 2 version of the requests_file module +%endif %if %{with python3} %package -n python3-requests-file @@ -66,28 +75,36 @@ This is the Python 3 version of the requests_file module rm -rf requests_file.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 %check +%if %{with python2} %{__python2} setup.py test +%endif %if %{with python3} %{__python3} setup.py test %endif +%if %{with python2} %files -n python2-%{srcname} %license LICENSE %doc README.rst %{python2_sitelib}/requests_file.py* %{python2_sitelib}/requests_file*.egg-info* +%endif %if %{with python3} %files -n python3-requests-file @@ -99,6 +116,9 @@ rm -rf requests_file.egg-info %endif %changelog +* Fri Mar 16 2018 Iryna Shcherbina - 1.4.3-6 +- Don't build Python 2 subpackage on EL > 7 + * Mon Feb 26 2018 Nick Bebout - 1.4.3-5 - Add python2- prefix where possible