Blob Blame History Raw
%if 0%{?fedora}
%global with_python3 1
%endif

%global modname sanction

Name:               python-sanction
Version:            0.3.1
Release:            10%{?dist}
Summary:            A simple, lightweight OAuth2 client
Group:              Development/Libraries
License:            MIT
URL:                http://pypi.python.org/pypi/sanction
Source0:            http://pypi.python.org/packages/source/s/%{modname}/%{modname}-%{version}.tar.gz

BuildArch:          noarch

BuildRequires:      python2-devel
BuildRequires:      python-nose

%if 0%{?with_python3}
BuildRequires:      python3-devel
BuildRequires:      python3-nose
%endif


%description
python-sanction is a lightweight, dead simple client implementation of
the OAuth2 protocol.

- Variations on OAuth2 client implementation range from a few hundred LOC
  to thousands. In a Pythonic world, there's absolutely no need for this when
  simply dealing with the client side of the spec. Currently, sanction sits
  at a whopping 65 LOC, one class. This makes the library tremendously easy
  to grok.

- Most providers have varying levels of diversion from the official spec.
  The goal with this library is to either handle these diversions natively,
  or expose a method to allow client code to deal with it efficiently and
  effectively.

- Three of the four OAuth2 flows should be supported by this library.
  Currently, only authorization code and client credential flows have been
  tested due to lack of other (known) implementations.

sanction has been tested with the following OAuth2 providers:

* Facebook (include the test API)
* Google
* Foursquare
* bitly
* GitHub
* StackExchange
* Instagram
* DeviantArt

%if 0%{?with_python3}
%package -n python3-sanction
Summary:            A simple, lightweight OAuth2 client
Group:              Development/Libraries

%description -n python3-sanction
python-sanction is a lightweight, dead simple client implementation of
the OAuth2 protocol.

- Variations on OAuth2 client implementation range from a few hundred LOC
  to thousands. In a Pythonic world, there's absolutely no need for this when
  simply dealing with the client side of the spec. Currently, sanction sits
  at a whopping 65 LOC, one class. This makes the library tremendously easy
  to grok.

- Most providers have varying levels of diversion from the official spec.
  The goal with this library is to either handle these diversions natively,
  or expose a method to allow client code to deal with it efficiently and
  effectively.

- Three of the four OAuth2 flows should be supported by this library.
  Currently, only authorization code and client credential flows have been
  tested due to lack of other (known) implementations.

sanction has been tested with the following OAuth2 providers:

* Facebook (include the test API)
* Google
* Foursquare
* bitly
* GitHub
* StackExchange
* Instagram
* DeviantArt
%endif


%prep
%setup -q -n %{modname}-%{version}

# Remove bundled egg-info in case it exists
rm -rf %{modname}.egg-info

%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif

%build
%{__python} 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

%{__python} setup.py install -O1 --skip-build --root=%{buildroot}

%check
%if 0%{?with_python3}
pushd %{py3dir}
PYTHONPATH=$(pwd) nosetests-%{python3_version}
popd
%endif

PYTHONPATH=$(pwd) nosetests

%files
%doc README.rst LICENSE.txt
%{python_sitelib}/%{modname}/
%{python_sitelib}/%{modname}-%{version}*

%if 0%{?with_python3}
%files -n python3-sanction
%doc README.rst LICENSE.txt
%{python3_sitelib}/%{modname}/
%{python3_sitelib}/%{modname}-%{version}*
%endif

%changelog
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 0.3.1-8
- Rebuild for Python 3.6

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1-7
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1-5
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 0.3.1-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Mon Oct 07 2013 Ralph Bean <rbean@redhat.com> - 0.3.1-1
- Latest upstream.
- Added python3 subpackage.

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.1.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Mon Feb 04 2013 Ralph Bean <rbean@redhat.com> - 0.1.4-1
- Initial packaging for Fedora