Preliminary compat for EPEL7.

Still blocked on missing python-jsonpickle there.
This commit is contained in:
Ralph Bean 2017-03-30 09:47:58 -04:00
parent f145eb8e8b
commit c226e8d6a9

View File

@ -12,7 +12,7 @@
Name: python-%{srcname}
Version: 4.0.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: %{sum}
Group: Development/Languages
@ -23,36 +23,48 @@ Patch0: docs-build-fix.patch
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python2-setuptools
# Needed for docs build
BuildRequires: pyOpenSSL
BuildRequires: python-crypto
BuildRequires: python-django
BuildRequires: python-jsonpickle
BuildRequires: python2-fasteners
BuildRequires: python-flask
BuildRequires: python2-gflags
BuildRequires: python-httplib2 >= 0.9.1
BuildRequires: python-httplib2
BuildRequires: python-keyring
BuildRequires: python-mock
BuildRequires: python-nose
BuildRequires: python2-pyasn1 >= 0.1.7
BuildRequires: python2-pyasn1-modules >= 0.0.5
BuildRequires: python-rsa >= 3.1.4
BuildRequires: python2-six >= 1.6.1
BuildRequires: python-sqlalchemy
BuildRequires: python-sphinx > 1.3
BuildRequires: python-sphinx_rtd_theme
BuildRequires: python-tox
BuildRequires: python-unittest2
BuildRequires: python-webtest
BuildRequires: pytest
%if 0%{?rhel} && 0%{?rhel} <= 7
BuildRequires: python-setuptools
BuildRequires: python-fasteners
BuildRequires: python-six >= 1.6.1
%else
BuildRequires: python2-setuptools
BuildRequires: python2-fasteners
BuildRequires: python2-six >= 1.6.1
%endif
%if 0%{?fedora}
# RHEL 7 has too old a version of python-sphinx
BuildRequires: python-sphinx > 1.3
BuildRequires: python-sphinx_rtd_theme
%endif
%if %{with python3}
BuildRequires: python3-setuptools
BuildRequires: python3-devel
BuildRequires: python2-fasteners
BuildRequires: python3-fasteners
BuildRequires: python3-mock
BuildRequires: python3-pyasn1 >= 0.1.7
BuildRequires: python3-pyasn1-modules >= 0.0.5
@ -69,13 +81,20 @@ Summary: %{sum}
Requires: pyOpenSSL
Requires: python2-gflags
Requires: python2-fasteners
Requires: python-httplib2 >= 0.9.1
Requires: python-httplib2
Requires: python-keyring
Requires: python2-pyasn1 >= 0.1.7
Requires: python2-pyasn1-modules >= 0.0.5
Requires: python-rsa >= 3.1.4
%if 0%{?rhel} && 0%{?rhel} <= 7
Requires: python-fasteners
Requires: python-six >= 1.6.1
%else
Requires: python2-fasteners
Requires: python2-six >= 1.6.1
%endif
%description -n python2-%{srcname}
This is a python client module for accessing resources protected by OAuth 2.0
@ -111,6 +130,11 @@ for the package. Documentation is shipped in html format.
%setup -q -n %{srcname}-%{version}
%patch0 -p1 -b .doc
# Remove the version constraint on httplib2. From reading upstream's git log,
# it seems the only reason they require a new version is to force python3
# support. That doesn't affect us on EPEL7, so we can loosen the constraint.
sed -i 's/httplib2>=0.9.1/httplib2/' setup.py
# 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.contrib.appengine.rst oauth2client/appengine.py
@ -122,6 +146,8 @@ cp -a . %{py3dir}
%build
%py2_build
%if 0%{?fedora}
export PYTHONPATH=`pwd`
pushd docs
# Not running with smp_flags as sometimes sphinx fails when run
@ -132,6 +158,7 @@ unset PYTHONPATH
rm -vr docs/_build/html/_sources
rm -vr docs/_build/html/_static/fonts
rm -v docs/_build/html/{.buildinfo,objects.inv}
%endif
%if %{with python3}
pushd %{py3dir}
@ -167,8 +194,10 @@ rm -r $(find %{_buildrootdir} -type d -name 'tests')
%{python2_sitelib}/%{srcname}
%{python2_sitelib}/%{srcname}-%{version}-*.egg-info
%if 0%{?fedora}
%files doc
%doc docs/_build/html
%endif
%if %{with python3}
%files -n python3-%{srcname}
@ -179,6 +208,9 @@ rm -r $(find %{_buildrootdir} -type d -name 'tests')
%endif
%changelog
* Thu Mar 30 2017 Ralph Bean <rbean@redhat.com> - 4.0.0-2
- Compat for EPEL7.
* Wed Mar 29 2017 Ralph Bean <rbean@redhat.com> - 4.0.0-1
- new version