From add92bda5c4362456c7e1fa00ef85f34c0bb1178 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Mon, 18 Mar 2013 09:47:16 +0700 Subject: [PATCH] Conditionally declare and clean buildroot to support el5 - Fix declaration of Python macro, and make it apply only to el5 (cherry picked from commit 3ed61f71133aa6ea22e68d8c4a73390a90b9998b) --- python-psutil.spec | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/python-psutil.spec b/python-psutil.spec index dcf4271..8063320 100644 --- a/python-psutil.spec +++ b/python-psutil.spec @@ -1,7 +1,9 @@ %if 0%{?fedora} > 12 || 0%{?rhel} > 6 %global with_python3 1 -%else -%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")} +%endif + +%if 0%{?el5} +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))")} %endif %global short_name psutil @@ -27,6 +29,10 @@ BuildRequires: python2-devel BuildRequires: python3-devel %endif +%if 0%{?el5} +BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +%endif + %description psutil is a module providing an interface for retrieving information on all running processes and system utilization (CPU, memory, disks, network, users) in @@ -76,6 +82,10 @@ popd %install +%if 0%{?el5} +rm -rf $RPM_BUILD_ROOT +%endif + %{__python} setup.py install \ --skip-build \ --root $RPM_BUILD_ROOT @@ -98,7 +108,9 @@ chmod 0755 $RPM_BUILD_ROOT%{python3_sitearch}/*.so %files %doc CREDITS HISTORY LICENSE README %{python_sitearch}/%{short_name}/ +%if ! 0%{?el5} %{python_sitearch}/*.egg-info +%endif %{python_sitearch}/*.so