ef8395c
%if (0%{?fedora} > 0 && 0%{?fedora} < 32) || (0%{?rhel} > 0 && 0%{?rhel} <= 7)
3ea2ad2
  %bcond_without python2
3ea2ad2
  %bcond_without python3
7b15e92
%endif
7b15e92
ef8395c
%if 0%{?fedora} || 0%{?rhel} >= 8
3ea2ad2
  %bcond_with python2
3ea2ad2
  %bcond_without python3
ef8395c
%endif
b22a32b
10e790a
%if 0%{?rhel} && 0%{?rhel} <= 7
10e790a
%{!?__python2:        %global __python2 /usr/bin/python2}
10e790a
%{!?python2_sitelib:  %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
10e790a
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
b22a32b
%{!?py2_build:        %global py2_build %{__python2} setup.py build --executable="%{__python2} -s" %{?*}}
b22a32b
%{!?py2_install:      %global py2_install %{__python2} setup.py install --skip-build --root %{buildroot} %{?*}}
10e790a
%endif
10e790a
7b15e92
%global modname oauthlib
7b15e92
7b15e92
Name:               python-oauthlib
69fcb83
Version:            3.0.2
37bd631
Release:            8%{?dist}
7b15e92
Summary:            An implementation of the OAuth request-signing logic
7b15e92
7b15e92
License:            BSD
5482dc9
URL:                https://github.com/oauthlib/oauthlib
69fcb83
69fcb83
# WARNING: The upstream release URL contains a leading 'v' in the
69fcb83
# tarball name, however the URL downloads a tarball name without the
69fcb83
# leading 'v'.  The packaging guidelines
69fcb83
# (https://fedoraproject.org/wiki/Packaging:SourceURL#Troublesome_URLs)
69fcb83
# state in this case one should just use the tarball name and document
69fcb83
# the reason why the full URL was not used.
69fcb83
#Source0: https://github.com/oauthlib/oauthlib/archive/v%{modname}-%{version}.tar.gz
69fcb83
Source0:            %{modname}-%{version}.tar.gz
7b15e92
7b15e92
BuildArch:          noarch
7b15e92
24c7e9e
%description
24c7e9e
OAuthLib is a generic utility which implements the logic of OAuth without
24c7e9e
assuming a specific HTTP request object or web framework. Use it to graft
24c7e9e
OAuth client support onto your favorite HTTP library, or provider support
24c7e9e
onto your favourite web framework. If you're a maintainer of such a
24c7e9e
library, write a thin veneer on top of OAuthLib and get OAuth support for
24c7e9e
very little effort.
24c7e9e
3ea2ad2
%if %{with python2}
24c7e9e
%package -n python2-oauthlib
24c7e9e
Summary:            An implementation of the OAuth request-signing logic
24c7e9e
%{?python_provide:%python_provide python2-oauthlib}
24c7e9e
7b15e92
BuildRequires:      python2-devel
24c7e9e
BuildRequires:      python2-setuptools
7b15e92
24c7e9e
BuildRequires:      python2-nose
24c7e9e
BuildRequires:      python2-mock
9329222
BuildRequires:      python2-blinker
7b15e92
69fcb83
BuildRequires:      python2-jwt >= 1.6.0
69fcb83
BuildRequires:      python2-cryptography >= 1.4.0
b22a32b
69fcb83
Requires:           python2-jwt >= 1.6.0
69fcb83
Requires:           python2-cryptography >= 1.4.0
7b15e92
24c7e9e
%description -n python2-oauthlib
7b15e92
OAuthLib is a generic utility which implements the logic of OAuth without
7b15e92
assuming a specific HTTP request object or web framework. Use it to graft
7b15e92
OAuth client support onto your favorite HTTP library, or provider support
7b15e92
onto your favourite web framework. If you're a maintainer of such a
7b15e92
library, write a thin veneer on top of OAuthLib and get OAuth support for
7b15e92
very little effort.
5482dc9
ef8395c
%endif # with python2
7b15e92
3ea2ad2
%if %{with python3}
7b15e92
%package -n python3-oauthlib
7b15e92
Summary:            An implementation of the OAuth request-signing logic
24c7e9e
%{?python_provide:%python_provide python3-oauthlib}
24c7e9e
24c7e9e
BuildRequires:      python3-devel
24c7e9e
BuildRequires:      python3-setuptools
24c7e9e
24c7e9e
BuildRequires:      python3-nose
24c7e9e
BuildRequires:      python3-mock
24c7e9e
BuildRequires:      python3-blinker
7b15e92
69fcb83
BuildRequires:      python3-jwt >= 1.6.0
69fcb83
BuildRequires:      python3-cryptography >= 1.4.0
b22a32b
2bcdc6e
%{?python_extras_subpkg:Recommends: python3-oauthlib+signedtoken}
2bcdc6e
%{!?python_extras_subpkg:Requires:  python3-jwt >= 1.6.0}
2bcdc6e
%{!?python_extras_subpkg:Requires:  python3-cryptography >= 1.4.0}
7b15e92
7b15e92
%description -n python3-oauthlib
7b15e92
OAuthLib is a generic utility which implements the logic of OAuth without
7b15e92
assuming a specific HTTP request object or web framework. Use it to graft
7b15e92
OAuth client support onto your favorite HTTP library, or provider support
7b15e92
onto your favourite web framework. If you're a maintainer of such a
7b15e92
library, write a thin veneer on top of OAuthLib and get OAuth support for
7b15e92
very little effort.
5482dc9
2bcdc6e
%{?python_extras_subpkg:%python_extras_subpkg -n python3-oauthlib -i %{python3_sitelib}/%{modname}-%{version}-*.egg-info signedtoken}
2bcdc6e
ef8395c
%endif # with python3
7b15e92
7b15e92
%prep
8b3cc27
%setup -q -n %{modname}-%{version}
b22a32b
4e63a2d
# python-unittest2 is now provided by "python" package and python-unittest is retired
4e63a2d
#  adapt setup.py to reflect this fact downstream
4e63a2d
sed -i "s/'unittest2', //" setup.py
e192547
7b15e92
# Remove bundled egg-info in case it exists
7b15e92
rm -rf %{modname}.egg-info
703d555
7b15e92
%build
3ea2ad2
%if %{with python2}
24c7e9e
%py2_build
ef8395c
%endif # with python2
3ea2ad2
%if %{with python3}
24c7e9e
%py3_build
ef8395c
%endif # with python3
7b15e92
7b15e92
%install
3ea2ad2
%if %{with python2}
24c7e9e
%py2_install
ef8395c
%endif # with python2
3ea2ad2
%if %{with python3}
24c7e9e
%py3_install
ef8395c
%endif # with python3
7b15e92
7b15e92
%check
3ea2ad2
%if %{with python2}
7b15e92
%{__python2} setup.py test
ef8395c
%endif # with python2
3ea2ad2
%if %{with python3}
7b15e92
%{__python3} setup.py test
ef8395c
%endif # with python3
7b15e92
3ea2ad2
%if %{with python2}
24c7e9e
%files -n python2-oauthlib
24c7e9e
%doc README.rst
24c7e9e
%license LICENSE
7b15e92
%{python2_sitelib}/%{modname}/
7b15e92
%{python2_sitelib}/%{modname}-%{version}*
ef8395c
%endif # with python2
7b15e92
3ea2ad2
%if %{with python3}
7b15e92
%files -n python3-oauthlib
24c7e9e
%doc README.rst
24c7e9e
%license LICENSE
7b15e92
%{python3_sitelib}/%{modname}/
7b15e92
%{python3_sitelib}/%{modname}-%{version}-*
ef8395c
%endif # with python3
7b15e92
7b15e92
%changelog
37bd631
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-8
37bd631
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
37bd631
2bcdc6e
* Fri Jul 10 2020 Miro Hrončok <mhroncok@redhat.com> - 3.0.2-7
2bcdc6e
- Add oauthlib[signedtoken] subpackage
2bcdc6e
6b94c15
* Sat May 23 2020 Miro Hrončok <mhroncok@redhat.com> - 3.0.2-6
6b94c15
- Rebuilt for Python 3.9
6b94c15
1458d09
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-5
1458d09
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
1458d09
c83be95
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 3.0.2-4
c83be95
- Rebuilt for Python 3.8.0rc1 (#1748018)
c83be95
1546d5f
* Fri Aug 16 2019 Miro Hrončok <mhroncok@redhat.com> - 3.0.2-3
1546d5f
- Rebuilt for Python 3.8
1546d5f
38acda2
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-2
38acda2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
38acda2
69fcb83
* Mon Jul 15 2019  <jdennis@redhat.com> - 3.0.2-1
69fcb83
- Update to upstream 3.0.2
69fcb83
- Resolves: rhbz#1730033
69fcb83
7d7fbf1
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.0-2
7d7fbf1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
7d7fbf1
5482dc9
* Fri Aug  3 2018  <jdennis@redhat.com> - 2.1.0-1
5482dc9
- upgrade to latest upstream 2.1.0
5482dc9
92eb06e
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-11
92eb06e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
92eb06e
3ea2ad2
* Tue Jul 10 2018  <jdennis@redhat.com> - 2.0.1-10
3ea2ad2
- Restore use of bcond for python conditionals
3ea2ad2
ef8395c
* Tue Jul 10 2018  <jdennis@redhat.com> - 2.0.1-9
ef8395c
- Unify spec file between Fedora and RHEL
ef8395c
021325d
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 2.0.1-8
021325d
- Rebuilt for Python 3.7
021325d
9329222
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.0.1-7
9329222
- Update Python 2 dependency declarations to new packaging standards
9329222
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
9329222
d725c16
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-6
d725c16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
d725c16
abcdad1
* Fri Sep 29 2017 Troy Dawson <tdawson@redhat.com> - 0.7.19-5
abcdad1
- Cleanup spec file conditionals
abcdad1
1c44a11
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.1-4
1c44a11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
1c44a11
edc3ada
* Mon Apr 17 2017 John Dennis <jdennis@redhat.com> - 2.0.1-3
edc3ada
- fix dependency on python2-jwt, should be python-jwt
edc3ada
5482dc9
* Thu Apr 13 2017 Dennis Gilmore <dennis@ausil.us> - 2.0.1-2
5946112
- add spaces around the >= for Requires
5946112
b22a32b
* Thu Mar 16 2017 John Dennis <jdennis@redhat.com> - 2.0.1-1
b22a32b
- Upgrade to upstream 2.0.1
b22a32b
- port from jwt to jwcrypto (conditional build)
b22a32b
- bring into alignment with rhel spec file
b22a32b
74c26e2
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.3-5
74c26e2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
74c26e2
4a059c0
* Tue Dec 13 2016 Stratakis Charalampos <cstratak@redhat.com> - 1.0.3-4
4a059c0
- Rebuild for Python 3.6
4a059c0
dc613b0
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.3-3
dc613b0
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
dc613b0
24c7e9e
* Tue Jun 28 2016 Ralph Bean <rbean@redhat.com> - 1.0.3-2
24c7e9e
- Modernize python macros.
24c7e9e
8b3cc27
* Sun Apr 10 2016 Kevin Fenzi <kevin@scrye.com> - 1.0.3-1
8b3cc27
- Update to 1.0.3
8b3cc27
- Add python2 provides (fixes bug #1313235 and #1314349)
8b3cc27
3e4d5fe
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.2-5.20150520git514cad7
3e4d5fe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
3e4d5fe
f69506e
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-4.20150520git514cad7
f69506e
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
f69506e
428878d
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.2-3.20150520git514cad7
428878d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
428878d
4e63a2d
* Wed Feb 18 2015 Ralph Bean <rbean@redhat.com> - 0.7.2-2.20150520git514cad7
4e63a2d
- new version, from a git checkout
4e63a2d
- Replace our patch with a sed statement.
4e63a2d
22c7d90
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.0-6
22c7d90
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
22c7d90
a71494c
* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 0.6.0-5
a71494c
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
a71494c
703d555
* Fri Apr 11 2014 Ralph Bean <rbean@redhat.com> - 0.6.0-4
703d555
- Use forward-compat python-crypto2.6 package for el6.
703d555
10e790a
* Tue Jan 21 2014 Ralph Bean <rbean@redhat.com> - 0.6.0-3
10e790a
- Compat macros for el6.
10e790a
7b15e92
* Fri Nov 01 2013 Ralph Bean <rbean@redhat.com> - 0.6.0-2
7b15e92
- Modernized python2 rpmmacros.
7b15e92
7b15e92
* Thu Oct 31 2013 Ralph Bean <rbean@redhat.com> - 0.6.0-1
7b15e92
- Initial package for Fedora