python-requests-oauthlib/python-requests-oauthlib.spec

143 lines
3.9 KiB
RPMSpec

%if 0%{?el6}%{?el7}
# python3 and python version related macros
# required to build python3- subpackage
# are not available in el6 and el7
%global with_python3 0
%global __python2 %{__python}
%global python2_sitelib %{python_sitelib}
%else
%bcond_without python3
%endif
%global distname requests-oauthlib
%global modname requests_oauthlib
Name: python-requests-oauthlib
Version: 0.5.0
Release: 3%{?dist}
Summary: OAuthlib authentication support for Requests.
Group: Development/Libraries
License: ISC
URL: http://pypi.python.org/pypi/requests-oauthlib
Source0: http://pypi.python.org/packages/source/r/%{distname}/%{distname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-mock
BuildRequires: python-oauthlib
BuildRequires: python-requests
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-oauthlib
BuildRequires: python3-requests
%endif
Requires: python-oauthlib
Requires: python-requests
%description
This project provides first-class OAuth library support for python-request.
%if 0%{?with_python3}
%package -n python3-%{distname}
Summary: OAuthlib authentication support for Requests.
Group: Development/Libraries
Requires: python3-oauthlib
Requires: python3-requests
%description -n python3-%{distname}
This project provides first-class OAuth library support for python-request.
%endif
%prep
%setup -q -n %{distname}-%{version}
sed -i 's/requests>=2.0.0/requests/' setup.py
# Remove bundled egg-info in case it exists
rm -rf %{distname}.egg-info
%if 0%{?with_python3}
cp -a . %{py3dir}
%endif
%build
%{__python2} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%install
%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
popd
%endif
# Upstream doesn't actually ship the tests with the tarball.
# https://github.com/requests/requests-oauthlib/pull/91
#%%check
#%%{__python2} setup.py test
%files
%doc README.rst LICENSE HISTORY.rst requirements.txt AUTHORS.rst
%{python2_sitelib}/%{modname}/
%{python2_sitelib}/%{modname}-%{version}*
%if 0%{?with_python3}
%files -n python3-%{distname}
%doc README.rst LICENSE HISTORY.rst requirements.txt AUTHORS.rst
%{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{modname}-%{version}*
%endif
%changelog
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Thu May 21 2015 Ralph Bean <rbean@redhat.com> - 0.5.0-1
- new version
* Fri Jan 23 2015 Ralph Bean <rbean@redhat.com> - 0.4.0-7
- Alter egg requirements for epel.
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.4.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 0.4.0-5
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
* Mon Mar 3 2014 Jakub Dorňák <jdornak@redhat.com> - 0.4.0-4
- python3 and python version related macros required to build
python3- subpackage are not available in el6 and el7
* Fri Nov 29 2013 Jakub Dorňák <jdornak@redhat.com> - 0.4.0-3
- added python3 subpackage
* Fri Nov 01 2013 Ralph Bean <rbean@redhat.com> - 0.4.0-2
- Modernized the python2 rpm macros as per review feedback.
* Thu Oct 31 2013 Ralph Bean <rbean@redhat.com> - 0.4.0-1
- Initial package for Fedora