Package for EPEL7

This commit is contained in:
Eli Young 2018-02-07 12:06:05 -08:00
parent 0263dd3d66
commit 5e78a00ff7

View File

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