File python-oauth2client.spec of Package python-oauth2client
#
# spec file for package python-oauth2client
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-oauth2client
Version: 1.5.1
Release: 0
Summary: Pythob OAuth2 CLient
License: Apache-2.0
Group: Development/Languages/Python
Url: https://github.com/google/oauth2client
Source0: oauth2client-%{version}.tar.gz
Patch1: hidePythonDeps.patch
Requires: python
Requires: python-httplib2 >= 0.9.1
Requires: python-keyring
Requires: python-pyasn1 >= 0.1.7
Requires: python-pyasn1-modules >= 0.0.5
Requires: python-pycrypto
Requires: python-rsa >= 3.1.4
Requires: python-six >= 1.6.1
%if 0%{?suse_version} && 0%{?suse_version} > 1110
BuildRequires: python-Django
%endif
BuildRequires: python-flask
BuildRequires: python-httplib2 >= 0.9.1
BuildRequires: python-keyring
BuildRequires: python-mock
BuildRequires: python-nose
BuildRequires: python-pyOpenSSL
BuildRequires: python-pyasn1-modules >= 0.0.5
BuildRequires: python-pycrypto
BuildRequires: python-rsa >= 3.1.4
BuildRequires: python-setuptools
BuildRequires: python-six >= 1.6.1
BuildRequires: python-unittest2
Conflicts: google-api-python-client < 1.3.0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%description
This is a Python library for accessing resources protected by OAuth 2.0.
%if 0%{?suse_version} && 0%{?suse_version} > 1110
%package django
Summary: Django extension
Group: Development/Libraries/Python
PreReq: python-oauth2client = %version
Requires: python-Django
%description django
OAuth 2.0 utilities for Django.
Utilities for using OAuth 2.0 in conjunction with
the Django datastore.
%endif
%package flask
Summary: Flask extension
Group: Development/Libraries/Python
PreReq: python-oauth2client = %version
Requires: python-flask
%description flask
Provides a Flask extension that makes using OAuth2 web server flow easier.
The extension includes views that handle the entire auth flow and a
``@required`` decorator to automatically ensure that user credentials are
available.
%package gce
Summary: GCE extension
Group: Development/Libraries/Python
PreReq: python-oauth2client = %version
%description gce
Utilities for Google Compute Engine
Utilities for making it easier to use OAuth 2.0 on Google Compute Engine.
%package test
Summary: Tests for python-oauth2client
Group: Development/Libraries/Python
PreReq: python-oauth2client = %version
%if 0%{?suse_version} && 0%{?suse_version} > 1110
PreReq: python-oauth2client-django = %version
%endif
PreReq: python-oauth2client-flask = %version
PreReq: python-oauth2client-gce = %version
Requires: python-coverage
Requires: python-httplib2 >= 0.9.1
Requires: python-mock
Requires: python-nose
Requires: python-pyasn1 >= 0.1.7
Requires: python-pyasn1-modules >= 0.0.5
Requires: python-rsa >= 3.1.4
Requires: python-six >= 1.6.1
Requires: python-unittest2
%description test
Package provides the unit tests for python-oauth2client
%prep
%setup -q -n oauth2client-%{version}
# remove extensions currently not packaged
rm oauth2client/*appengine*
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
rm oauth2client/*django*
%endif
%patch1
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
mkdir -p %{buildroot}%{python_sitelib}/tests/oauth2client
# remove tests for extensions we do not build at the moment
rm tests/*appengine*
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
rm tests/*django*
%endif
cp -r tests/* %{buildroot}%{python_sitelib}/tests/oauth2client
%check
nosetests
%files
%defattr(-,root,root,-)
%doc CHANGELOG.md CONTRIBUTING.md LICENSE README.md
%dir %{python_sitelib}/oauth2client
%dir %{python_sitelib}/oauth2client-%{version}-py%{py_ver}.egg-info
%if 0%{?suse_version} && 0%{?suse_version} > 1110
%exclude %{python_sitelib}/oauth2client/django*
%endif
%exclude %{python_sitelib}/oauth2client/flask*
%exclude %{python_sitelib}/oauth2client/gce*
%{python_sitelib}/oauth2client/*
%{python_sitelib}/oauth2client-%{version}-py%{py_ver}.egg-info/*
%files flask
%defattr(-,root,root,-)
%{python_sitelib}/oauth2client/flask*
%if 0%{?suse_version} && 0%{?suse_version} > 1110
%files django
%defattr(-,root,root,-)
%{python_sitelib}/oauth2client/django*
%endif
%files gce
%defattr(-,root,root,-)
%{python_sitelib}/oauth2client/gce*
%files test
%defattr(-,root,root,-)
%dir %{python_sitelib}/tests
%dir %{python_sitelib}/tests/oauth2client
%{python_sitelib}/tests/oauth2client/*
%changelog