File python-oauth2client.spec of Package python-oauth2client.12232

# spec file for package python-oauth2client
# Copyright (c) 2018 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

%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-oauth2client
Version:        4.1.2
Release:        0
Summary:        Pythob OAuth2 Client
License:        Apache-2.0
Group:          Development/Languages/Python
Source0:        oauth2client-%{version}.tar.gz
Patch1:         oauth2client-init-django-settings.patch
Patch2:         o2c_reauth.patch
Requires:       python
Requires:       python-fasteners
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%{?is_opensuse}
BuildRequires:  %{python_module Django >= 1.8}
BuildRequires:  %{python_module Flask}
BuildRequires:  %{python_module SQLAlchemy}
BuildRequires:  %{python_module fasteners}
BuildRequires:  %{python_module httplib2 >= 0.9.1}
BuildRequires:  %{python_module keyring}
BuildRequires:  %{python_module mock}
BuildRequires:  %{python_module nose}
BuildRequires:  %{python_module pyOpenSSL}
BuildRequires:  %{python_module pyasn1-modules >= 0.0.5}
BuildRequires:  %{python_module pycrypto}
BuildRequires:  %{python_module rsa >= 3.1.4}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module six >= 1.6.1}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Conflicts:      google-api-python-client  < 1.3.0
# Don't ask, we obviously have problems working together
Conflicts:      python-google-api-python-client  < 1.3.0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch

This is a Python library for accessing resources protected by OAuth 2.0.

%if 0%{?is_opensuse}
%package django
Summary:        Django extension
Group:          Development/Libraries/Python
PreReq:         python-oauth2client = %version
Requires:       python-Django >= 1.8

%description django
OAuth 2.0 utilities for Django.

Utilities for using OAuth 2.0 in conjunction with
the Django datastore.

%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

%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.


%setup -q -n oauth2client-%{version}
# remove extensions currently not packaged
rm -rf oauth2client/contrib/*appengine*
rm -f oauth2client/contrib/__pycache__/*appengine*
%if 0%{?is_opensuse}
# No Django on SLE
rm -rf oauth2client/contrib/django*


# remove tests for extensions we do not build at the moment
rm -rf tests/contrib/appengine

%fdupes %{buildroot}%{_prefix}

%files %{python_files}
%dir %{python_sitelib}/oauth2client
%dir %{python_sitelib}/oauth2client-%{version}-py%{py_ver}.egg-info
%exclude %{python_sitelib}/oauth2client/contrib/django*
%exclude %{python_sitelib}/oauth2client/contrib/flask*
%exclude %{python_sitelib}/oauth2client/contrib/__pycache__/flask*
%exclude %{python_sitelib}/oauth2client/contrib/gce*
%exclude %{python_sitelib}/oauth2client/contrib/__pycache__/gce*

%files %{python_files flask}

%if 0%{?is_opensuse}
%files %{python_files django}

%files %{python_files gce}

%if 0
%files %{python_files test}
%dir %{python_sitelib}/tests
%dir %{python_sitelib}/tests/oauth2client