5ccbd94
%if (0%{?fedora} > 0 && 0%{?fedora} < 32) || (0%{?rhel} > 0 && 0%{?rhel} <= 7)
5ccbd94
  %bcond_without python2
5ccbd94
  %bcond_without python3
5ccbd94
%endif
5ccbd94
5ccbd94
%if 0%{?fedora} || 0%{?rhel} >= 8
5ccbd94
  %bcond_with python2
5ccbd94
  %bcond_without python3
5ccbd94
%endif
5ccbd94
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
9f3f99a
    %{!?__python2: %global __python2 %{__python}}
9f3f99a
    %{!?python2_sitelib: %global python2_sitelib %{python_sitelib}}
9f3f99a
    %{!?py2_build: %global py2_build %{__python2} setup.py build --executable="%{__python2} -s" %{?*}}
9f3f99a
    %{!?py2_install: %global py2_install %{__python2} setup.py install --skip-build --root %{buildroot} %{?*}}
4578d96
%endif
Jakub Dorňák 3eb89ae
df0dbc8
%global distname requests-oauthlib
df0dbc8
%global modname requests_oauthlib
df0dbc8
df0dbc8
Name:               python-requests-oauthlib
c919fcf
Version:            0.8.0
4ff4810
Release:            7%{?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
c919fcf
Source0:            https://github.com/requests/requests-oauthlib/archive/v%{version}.tar.gz
df0dbc8
df0dbc8
BuildArch:          noarch
df0dbc8
4cb6b82
%description
4cb6b82
This project provides first-class OAuth library support for python-request.
df0dbc8
5ccbd94
%if %{with python2}
4cb6b82
%package -n python2-%{distname}
9f3f99a
%if 0%{?python_provide:1}
9f3f99a
%python_provide python2-%{distname}
9f3f99a
%else
9f3f99a
Provides: python-%{distname} = %{?epoch:%{epoch}:}%{version}-%{release}
9f3f99a
%endif
9f3f99a
4cb6b82
Summary:            OAuthlib authentication support for Requests.
4cb6b82
Group:              Development/Libraries
df0dbc8
4cb6b82
BuildRequires:      python2-devel
4cb6b82
BuildRequires:      python2-setuptools
Jakub Dorňák 3eb89ae
c919fcf
BuildRequires:      python2-oauthlib >= 0.6.2
c919fcf
BuildRequires:      python2-requests >= 2.0.0
Jakub Dorňák 3eb89ae
4cb6b82
BuildRequires:      python2-mock
Jakub Dorňák 3eb89ae
4cb6b82
Requires:           python2-oauthlib
9f3f99a
Requires:           python2-requests >= 2.0.0
df0dbc8
4cb6b82
%description -n python2-%{distname}
df0dbc8
This project provides first-class OAuth library support for python-request.
5ccbd94
%endif # with python2
df0dbc8
5ccbd94
%if %{with python3}
Jakub Dorňák 3eb89ae
%package -n python3-%{distname}
9f3f99a
%{?python_provide:%python_provide python3-%{distname}}
Jakub Dorňák 3eb89ae
Summary:            OAuthlib authentication support for Requests.
Jakub Dorňák 3eb89ae
Group:              Development/Libraries
4cb6b82
4cb6b82
BuildRequires:      python3-devel
4cb6b82
BuildRequires:      python3-setuptools
4cb6b82
c919fcf
BuildRequires:      python3-oauthlib >= 0.6.2
c919fcf
BuildRequires:      python3-requests >= 2.0.0
4cb6b82
4cb6b82
BuildRequires:      python3-mock
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
c919fcf
%autosetup -n %{distname}-%{version}
15f2263
df0dbc8
# Remove bundled egg-info in case it exists
df0dbc8
rm -rf %{distname}.egg-info
df0dbc8
Jakub Dorňák 3eb89ae
df0dbc8
%build
5ccbd94
%if %{with python2}
4cb6b82
%py2_build
5ccbd94
%endif # with python2
5ccbd94
%if %{with python3}
4cb6b82
%py3_build
Jakub Dorňák 3eb89ae
%endif
Jakub Dorňák 3eb89ae
df0dbc8
%install
5ccbd94
%if %{with python2}
4cb6b82
%py2_install
5ccbd94
%endif # with python2
5ccbd94
%if %{with python3}
4cb6b82
%py3_install
Jakub Dorňák 3eb89ae
%endif
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
5ccbd94
%if %{with python2}
4cb6b82
%files -n python2-%{distname}
4cb6b82
%doc README.rst HISTORY.rst requirements.txt AUTHORS.rst
4cb6b82
%license LICENSE
df0dbc8
%{python2_sitelib}/%{modname}/
df0dbc8
%{python2_sitelib}/%{modname}-%{version}*
5ccbd94
%endif # with python2
df0dbc8
5ccbd94
%if %{with python3}
Jakub Dorňák 3eb89ae
%files -n python3-%{distname}
4cb6b82
%doc README.rst HISTORY.rst requirements.txt AUTHORS.rst
4cb6b82
%license LICENSE
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
4ff4810
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-7
4ff4810
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
4ff4810
5ccbd94
* Tue Jul 10 2018  <jdennis@redhat.com> - 0.8.0-6
5ccbd94
- Unify Fedora/RHEL py2/py3 logic
5ccbd94
18fc733
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.8.0-5
18fc733
- Rebuilt for Python 3.7
18fc733
d42dd4f
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-4
d42dd4f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
d42dd4f
c3e1c58
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-3
c3e1c58
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
c3e1c58
9f3f99a
* Wed Apr 12 2017 John Dennis <jdennis@redhat.com> - 0.8.0-2
9f3f99a
- bring spec file for fedora & rhel closer together
9f3f99a
c919fcf
* Sat Feb 25 2017 Kevin Fenzi <kevin@scrye.com> - 0.8.0-1
c919fcf
- Update to 0.8.0.
c919fcf
- Make sure to specify package versions required. Fixes bug #1320683
c919fcf
7c7421d
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-8
7c7421d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
7c7421d
678f387
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.5.0-7
678f387
- Rebuild for Python 3.6
678f387
a5b74b9
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.0-6
a5b74b9
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
a5b74b9
4cb6b82
* Tue Jun 28 2016 Ralph Bean <rbean@redhat.com> - 0.5.0-5
4cb6b82
- Add an explicit python2 subpackage for #1313242.
4cb6b82
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