[python-troveclient/f22] Fix EL6 build

Haïkel Guémar hguemar at fedoraproject.org
Fri Mar 6 13:48:34 UTC 2015


commit 8b8f2ebf1a41bacf85f38d9bc7348ffda9fd1424
Author: Haikel Guemar <hguemar at fedoraproject.org>
Date:   Fri Mar 6 14:48:24 2015 +0100

    Fix EL6 build

 python-troveclient.spec | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/python-troveclient.spec b/python-troveclient.spec
index 0c5e911..8213d7a 100644
--- a/python-troveclient.spec
+++ b/python-troveclient.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-troveclient
 Version:        1.0.7
 Release:        1%{?dist}
@@ -13,7 +19,11 @@ BuildArch:      noarch
  
 BuildRequires:  python2-devel
 BuildRequires:  python-setuptools
+%if 0%{?rhel} && 0%{?rhel} <= 6
+BuildRequires:  python-sphinx10
+%else
 BuildRequires:  python-sphinx
+%endif
 BuildRequires:  python-requests
 BuildRequires:  python-pbr
 
@@ -60,26 +70,22 @@ rm -f {test-,}requirements.txt
 
 # Generate html docs
 #export PYTHONPATH="$( pwd ):$PYTHONPATH"
+%if 0%{?rhel} && 0%{?rhel} <= 6
+sphinx-1.0-build -b html doc/source html
+%else
 sphinx-build -b html doc/source html
+%endif
 
 # Remove the sphinx-build leftovers
 rm -rf html/.{doctrees,buildinfo}
 
 
 %build
-%if 0%{?rhel} == 6
-%{__python} setup.py build
-%else
 %{__python2} setup.py build
-%endif
 
 
 %install
-%if 0%{?rhel} == 6
-%{__python} setup.py install --skip-build --root %{buildroot}
-%else
 %{__python2} setup.py install --skip-build --root %{buildroot}
-%endif
 
 # currently disabling tests
 # see buildrequires
@@ -89,13 +95,8 @@ rm -rf html/.{doctrees,buildinfo}
 
 %files
 %doc html README.rst LICENSE
-%if 0%{?rhel} == 6
-%{python_sitelib}/python_troveclient-%{version}-py?.?.egg-info
-%{python_sitelib}/troveclient
-%else
 %{python2_sitelib}/python_troveclient-%{version}-py?.?.egg-info
 %{python2_sitelib}/troveclient
-%endif
 %{_bindir}/trove
 
 %changelog


More information about the scm-commits mailing list