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