2013-11-01 14:49:07 +00:00
|
|
|
%if 0%{?fedora}
|
|
|
|
%global with_python3 1
|
|
|
|
%endif
|
|
|
|
|
2014-01-21 15:14:52 +00:00
|
|
|
%if 0%{?rhel} && 0%{?rhel} <= 7
|
|
|
|
%{!?__python2: %global __python2 /usr/bin/python2}
|
|
|
|
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
|
|
|
|
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
2013-11-01 14:49:07 +00:00
|
|
|
%global modname oauthlib
|
|
|
|
|
|
|
|
Name: python-oauthlib
|
|
|
|
Version: 0.6.0
|
2014-04-12 03:17:18 +00:00
|
|
|
Release: 4%{?dist}
|
2013-11-01 14:49:07 +00:00
|
|
|
Summary: An implementation of the OAuth request-signing logic
|
|
|
|
|
|
|
|
Group: Development/Libraries
|
|
|
|
License: BSD
|
|
|
|
URL: http://pypi.python.org/pypi/oauthlib
|
|
|
|
Source0: http://pypi.python.org/packages/source/o/%{modname}/%{modname}-%{version}.tar.gz
|
|
|
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
BuildRequires: python2-devel
|
|
|
|
BuildRequires: python-setuptools
|
|
|
|
|
|
|
|
BuildRequires: python-nose
|
|
|
|
BuildRequires: python-unittest2
|
|
|
|
BuildRequires: python-mock
|
|
|
|
|
2014-04-12 03:17:18 +00:00
|
|
|
%if 0%{?rhel} && 0%{?rhel} <= 6
|
|
|
|
BuildRequires: python-crypto2.6
|
|
|
|
Requires: python-crypto2.6
|
|
|
|
%else
|
|
|
|
BuildRequires: python-crypto >= 2.6
|
2014-04-09 16:32:58 +00:00
|
|
|
Requires: python-crypto >= 2.6
|
2014-04-12 03:17:18 +00:00
|
|
|
%endif
|
2013-11-01 14:49:07 +00:00
|
|
|
|
|
|
|
%if 0%{?with_python3}
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
BuildRequires: python3-setuptools
|
|
|
|
|
|
|
|
BuildRequires: python3-nose
|
2014-04-09 16:32:58 +00:00
|
|
|
BuildRequires: python3-crypto >= 2.6
|
2013-11-01 14:49:07 +00:00
|
|
|
BuildRequires: python3-mock
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%description
|
|
|
|
OAuthLib is a generic utility which implements the logic of OAuth without
|
|
|
|
assuming a specific HTTP request object or web framework. Use it to graft
|
|
|
|
OAuth client support onto your favorite HTTP library, or provider support
|
|
|
|
onto your favourite web framework. If you're a maintainer of such a
|
|
|
|
library, write a thin veneer on top of OAuthLib and get OAuth support for
|
|
|
|
very little effort.
|
|
|
|
|
|
|
|
%if 0%{?with_python3}
|
|
|
|
%package -n python3-oauthlib
|
|
|
|
Summary: An implementation of the OAuth request-signing logic
|
|
|
|
Group: Development/Libraries
|
|
|
|
|
2014-04-09 16:32:58 +00:00
|
|
|
Requires: python3-crypto >= 2.6
|
2013-11-01 14:49:07 +00:00
|
|
|
|
|
|
|
%description -n python3-oauthlib
|
|
|
|
OAuthLib is a generic utility which implements the logic of OAuth without
|
|
|
|
assuming a specific HTTP request object or web framework. Use it to graft
|
|
|
|
OAuth client support onto your favorite HTTP library, or provider support
|
|
|
|
onto your favourite web framework. If you're a maintainer of such a
|
|
|
|
library, write a thin veneer on top of OAuthLib and get OAuth support for
|
|
|
|
very little effort.
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n %{modname}-%{version}
|
|
|
|
|
|
|
|
# Remove bundled egg-info in case it exists
|
|
|
|
rm -rf %{modname}.egg-info
|
2014-04-12 03:17:18 +00:00
|
|
|
|
|
|
|
# Make sure that setuptools knows to pick up the correct version of
|
|
|
|
# python-crypto on epel/rhel...
|
|
|
|
awk 'NR==1{print "import __main__; __main__.__requires__ = __requires__ = [\"pycrypto>=2.6\"]; import pkg_resources"}1' setup.py > setup.py.tmp
|
|
|
|
mv setup.py.tmp setup.py
|
|
|
|
|
2013-11-01 14:49:07 +00:00
|
|
|
%if 0%{?with_python3}
|
|
|
|
rm -rf %{py3dir}
|
|
|
|
cp -a . %{py3dir}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%build
|
|
|
|
%{__python2} setup.py build
|
|
|
|
%if 0%{?with_python3}
|
|
|
|
pushd %{py3dir}
|
|
|
|
%{__python3} setup.py build
|
|
|
|
popd
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%install
|
|
|
|
%if 0%{?with_python3}
|
|
|
|
pushd %{py3dir}
|
|
|
|
%{__python3} setup.py install -O1 --skip-build --root=%{buildroot}
|
|
|
|
popd
|
|
|
|
%endif
|
|
|
|
%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}
|
|
|
|
|
|
|
|
%check
|
|
|
|
%{__python2} setup.py test
|
|
|
|
%if 0%{?with_python3}
|
|
|
|
pushd %{py3dir}
|
|
|
|
%{__python3} setup.py test
|
|
|
|
popd
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%files
|
|
|
|
%doc README.rst LICENSE
|
|
|
|
%{python2_sitelib}/%{modname}/
|
|
|
|
%{python2_sitelib}/%{modname}-%{version}*
|
|
|
|
|
|
|
|
%if 0%{?with_python3}
|
|
|
|
%files -n python3-oauthlib
|
|
|
|
%doc README.rst LICENSE
|
|
|
|
%{python3_sitelib}/%{modname}/
|
|
|
|
%{python3_sitelib}/%{modname}-%{version}-*
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%changelog
|
2014-04-12 03:17:18 +00:00
|
|
|
* Fri Apr 11 2014 Ralph Bean <rbean@redhat.com> - 0.6.0-4
|
|
|
|
- Use forward-compat python-crypto2.6 package for el6.
|
|
|
|
|
2014-01-21 15:14:52 +00:00
|
|
|
* Tue Jan 21 2014 Ralph Bean <rbean@redhat.com> - 0.6.0-3
|
|
|
|
- Compat macros for el6.
|
|
|
|
|
2013-11-01 14:49:07 +00:00
|
|
|
* Fri Nov 01 2013 Ralph Bean <rbean@redhat.com> - 0.6.0-2
|
|
|
|
- Modernized python2 rpmmacros.
|
|
|
|
|
|
|
|
* Thu Oct 31 2013 Ralph Bean <rbean@redhat.com> - 0.6.0-1
|
|
|
|
- Initial package for Fedora
|