Conditionalize the python2 and python3 builds
This commit is contained in:
parent
d0527b733b
commit
bf1bf084eb
@ -1,8 +1,22 @@
|
|||||||
%global srcname requests-ftp
|
%global srcname requests-ftp
|
||||||
|
|
||||||
|
# Disable python3 by default on RHEL < 7
|
||||||
|
%if 0%{?rhel} && 0%{?rhel} <= 7
|
||||||
|
%bcond_with python3
|
||||||
|
%else
|
||||||
|
%bcond_without python3
|
||||||
|
%endif
|
||||||
|
|
||||||
|
# Diable python2 by default on RHEL > 7 or Fedora > 28
|
||||||
|
%if 0%{?rhel} > 7 || 0%{?fedora} > 28
|
||||||
|
%bcond_with python2
|
||||||
|
%else
|
||||||
|
%bcond_without python2
|
||||||
|
%endif
|
||||||
|
|
||||||
Name: python-%{srcname}
|
Name: python-%{srcname}
|
||||||
Version: 0.3.1
|
Version: 0.3.1
|
||||||
Release: 9%{?dist}
|
Release: 10%{?dist}
|
||||||
Summary: FTP transport adapter for python-requests
|
Summary: FTP transport adapter for python-requests
|
||||||
|
|
||||||
License: ASL 2.0
|
License: ASL 2.0
|
||||||
@ -15,6 +29,7 @@ BuildArch: noarch
|
|||||||
Requests-FTP is an implementation of a very stupid FTP transport adapter for
|
Requests-FTP is an implementation of a very stupid FTP transport adapter for
|
||||||
use with the awesome Requests Python library.
|
use with the awesome Requests Python library.
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
%package -n python2-%{srcname}
|
%package -n python2-%{srcname}
|
||||||
Summary: FTP transport adapter for python-requests
|
Summary: FTP transport adapter for python-requests
|
||||||
%{?python_provide:%python_provide python2-%{srcname}}
|
%{?python_provide:%python_provide python2-%{srcname}}
|
||||||
@ -29,7 +44,9 @@ Requests-FTP is an implementation of a very stupid FTP transport adapter for
|
|||||||
use with the awesome Requests Python library.
|
use with the awesome Requests Python library.
|
||||||
|
|
||||||
This is the Python 2 version of the transport adapter module.
|
This is the Python 2 version of the transport adapter module.
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with python3}
|
||||||
%package -n python3-%{srcname}
|
%package -n python3-%{srcname}
|
||||||
Summary: FTP transport adapter for python3-requests
|
Summary: FTP transport adapter for python3-requests
|
||||||
%{?python_provide:%python_provide python3-%{srcname}}
|
%{?python_provide:%python_provide python3-%{srcname}}
|
||||||
@ -44,32 +61,50 @@ Requests-FTP is an implementation of a very stupid FTP transport adapter for
|
|||||||
use with the awesome Requests Python library.
|
use with the awesome Requests Python library.
|
||||||
|
|
||||||
This is the Python 3 version of the transport adapter module.
|
This is the Python 3 version of the transport adapter module.
|
||||||
|
%endif
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{srcname}-%{version}
|
%autosetup -n %{srcname}-%{version}
|
||||||
rm -rf requests_ftp.egg-info
|
rm -rf requests_ftp.egg-info
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
%if %{with python2}
|
||||||
%py2_build
|
%py2_build
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with python3}
|
||||||
%py3_build
|
%py3_build
|
||||||
|
%endif
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
%if %{with python2}
|
||||||
%py2_install
|
%py2_install
|
||||||
%py3_install
|
%endif
|
||||||
|
|
||||||
|
%if %{with python3}
|
||||||
|
%py3_install
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
%files -n python2-%{srcname}
|
%files -n python2-%{srcname}
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{python2_sitelib}/requests_ftp/
|
%{python2_sitelib}/requests_ftp/
|
||||||
%{python2_sitelib}/requests_ftp*.egg-info*
|
%{python2_sitelib}/requests_ftp*.egg-info*
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{with python3}
|
||||||
%files -n python3-%{srcname}
|
%files -n python3-%{srcname}
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{python3_sitelib}/requests_ftp/
|
%{python3_sitelib}/requests_ftp/
|
||||||
%{python3_sitelib}/requests_ftp*.egg-info*
|
%{python3_sitelib}/requests_ftp*.egg-info*
|
||||||
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Apr 24 2018 David Shea <dshea@redhat.com> - 0.3.1-10
|
||||||
|
- Conditionalize the python2 and python3 builds
|
||||||
|
|
||||||
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-9
|
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-9
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user