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 http://bugs.opensuse.org/
#


%{?!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
Url:            https://github.com/google/oauth2client
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}
%endif
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

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

%python_subpackages

%prep
%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}
%patch1
%else
# No Django on SLE
rm -rf oauth2client/contrib/django*
%endif
%patch2

%build
%python_build

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

%fdupes %{buildroot}%{_prefix}

%files %{python_files}
%defattr(-,root,root,-)
%doc README.md
%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*
%{python_sitelib}/oauth2client/*
%{python_sitelib}/oauth2client-%{version}-py%{py_ver}.egg-info/*

%files %{python_files flask}
%defattr(-,root,root,-)
%{python_sitelib}/oauth2client/contrib/flask*
%ifpython3
%{python_sitelib}/oauth2client/contrib/__pycache__/flask*
%endif

%if 0%{?is_opensuse}
%files %{python_files django}
%defattr(-,root,root,-)
%{python_sitelib}/oauth2client/contrib/django*
%endif

%files %{python_files gce}
%defattr(-,root,root,-)
%{python_sitelib}/oauth2client/contrib/gce*
%ifpython3
%{python_sitelib}/oauth2client/contrib/__pycache__/gce*
%endif

%if 0
%files %{python_files test}
%defattr(-,root,root,-)
%dir %{python_sitelib}/tests
%dir %{python_sitelib}/tests/oauth2client
%{python_sitelib}/tests/oauth2client/*
%endif

%changelog