[python-openstackclient/f22] Fix build on EL6
Haïkel Guémar
hguemar at fedoraproject.org
Fri Mar 6 14:30:58 UTC 2015
commit 4658fcee1b356123b45dc6d5d938022142771086
Author: Haikel Guemar <hguemar at fedoraproject.org>
Date: Sun Feb 22 16:54:50 2015 +0100
Fix build on EL6
python-openstackclient.spec | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/python-openstackclient.spec b/python-openstackclient.spec
index f233aed..a1c4260 100644
--- a/python-openstackclient.spec
+++ b/python-openstackclient.spec
@@ -1,3 +1,9 @@
+%if 0%{?rhel} && 0%{?rhel} <= 6
+%{!?__python2: %global __python2 /usr/bin/python2}
+%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
+%endif
+
Name: python-openstackclient
Version: 1.0.1
Release: 1%{?dist}
@@ -43,7 +49,11 @@ actual REST API client actions.
Summary: Documentation for OpenStack Nova API Client
Group: Documentation
+%if 0%{?rhel} == 6
+BuildRequires: python-sphinx10
+%else
BuildRequires: python-sphinx
+%endif
Requires: %{name} = %{version}-%{release}
@@ -77,6 +87,11 @@ rm -rf requirements.txt test-requirements.txt
rm -rf python_openstackclient.egg-info
sed -i 's/oslosphinx/oslo.sphinx/' doc/source/conf.py
+# the apidoc sphinx extension is not available in EL6
+%if 0%{?rhel} == 6
+sed -i "/'ext.apidoc'/ s/^/#/" doc/source/conf.py
+%endif
+
%build
%{__python2} setup.py build
@@ -88,8 +103,13 @@ sed -i 's/oslosphinx/oslo.sphinx/' doc/source/conf.py
rm -fr %{buildroot}%{python_sitelib}/openstackclient/tests
export PYTHONPATH="$( pwd ):$PYTHONPATH"
+%if 0%{?rhel} == 6
+sphinx-1.0-build -b html doc/source html
+sphinx-1.0-build -b man doc/source man
+%else
sphinx-build -b html doc/source html
sphinx-build -b man doc/source man
+%endif
install -p -D -m 644 man/openstack.1 %{buildroot}%{_mandir}/man1/openstack.1
@@ -99,8 +119,8 @@ rm -fr html/.doctrees html/.buildinfo
%files
%doc LICENSE README.rst
%{_bindir}/openstack
-%{python_sitelib}/openstackclient
-%{python_sitelib}/*.egg-info
+%{python2_sitelib}/openstackclient
+%{python2_sitelib}/*.egg-info
%{_mandir}/man1/openstack.1*
%files doc
More information about the scm-commits
mailing list