%global realname oauth2client # Share doc between python- and python3- %global _docdir_fmt %{name} %if 0%{?fedora} %bcond_without python3 %else %bcond_with python3 %endif Name: python-%{realname} Version: 1.5.0 Release: 1%{?dist} Summary: Python client library for OAuth 2.0 Group: Development/Languages License: ASL 2.0 URL: https://github.com/google/oauth2client Source0: https://github.com/google/%{realname}/archive/v%{version}.tar.gz#/%{realname}-%{version}.tar.gz Patch0: remove-python-shebang-from-module.patch Patch1: docs-build-fix.patch BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools # Needed for docs build BuildRequires: pyOpenSSL BuildRequires: python-django BuildRequires: python-flask BuildRequires: python-gflags BuildRequires: python-httplib2 BuildRequires: python-keyring BuildRequires: python-pyasn1 BuildRequires: python-pyasn1-modules BuildRequires: python-rsa BuildRequires: python-six BuildRequires: python-sphinxcontrib-napoleon BuildRequires: python-sphinx_rtd_theme %if %{with python3} BuildRequires: python3-setuptools BuildRequires: python3-devel %endif Requires: pyOpenSSL Requires: python-gflags Requires: python-httplib2 Requires: python-keyring Requires: python-pyasn1 Requires: python-pyasn1-modules Requires: python-rsa Requires: python-six %description This is a python client module for accessing resources protected by OAuth 2.0 %if %{with python3} %package -n python3-%{realname} Summary: Python client library for OAuth 2.0 Requires: python3-pyOpenSSL Requires: python3-gflags Requires: python3-httplib2 Requires: python3-keyring Requires: python3-pyasn1 Requires: python3-pyasn1-modules Requires: python3-rsa Requires: python3-six %description -n python3-%{realname} This is a python client module for accessing resources protected by OAuth 2.0 %endif %package doc Summary: Documentation for python oauth2client %description doc The python-oauth2client-doc package provides the documentation for the package. Documentation is shipped in html format. %prep %setup -q -n %{realname}-%{version} %patch0 -p1 %patch1 -p1 # We do not have the package for google.appengine support # This is removed because it breaks the docs build otherwise rm -f docs/source/oauth2client.appengine.rst oauth2client/appengine.py %if %{with python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python2} setup.py build export PYTHONPATH=`pwd` pushd docs # Not running with smp_flags as sometimes sphinx fails when run # with parallel make make html popd unset PYTHONPATH rm -vrf docs/_build/html/_sources rm -vrf docs/_build/html/_static/fonts rm -fv docs/_build/html/{.buildinfo,objects.inv} %if %{with python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %{__python2} setup.py install -O1 --skip-build --root %{buildroot} %if %{with python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} popd %endif %files %license LICENSE %doc CHANGELOG.md CONTRIBUTING.md README.md %{python2_sitelib}/%{realname} %{python2_sitelib}/%{realname}-%{version}-*.egg-info %files doc %doc docs/_build/html %if %{with python3} %files -n python3-%{realname} %license LICENSE %doc CHANGELOG.md CONTRIBUTING.md README.md %{python3_sitelib}/%{realname} %{python3_sitelib}/%{realname}*.egg-info %endif %changelog * Fri Sep 04 2015 Michele Baldessari - 1.5.0-1 - New upstream (BZ#1259966) * Sun Jul 12 2015 Michele Baldessari - 1.4.12-1 - New upstream (BZ#1241304) * Mon Jun 22 2015 Michele Baldessari - 1.4.11-2 - Use -O1 for python3 as well - Use python2 macros - Remove the extra fonts from the -doc package * Thu Jun 04 2015 Michele Baldessari - 1.4.11-1 - Initial packaging