From 8cc852ffe19d393f4b529cf8bad5b70a68014a66 Mon Sep 17 00:00:00 2001 From: Sergey Kulanov Date: Mon, 3 Aug 2015 23:55:12 +0300 Subject: [PATCH] Update python-fuelclient rpm SPEC Make python-fuelclient rpm spec closer to Packaging:Guidelines [1,2] 1. http://fedoraproject.org/wiki/Packaging:Python 2. https://fedoraproject.org/wiki/Packaging:Python_Eggs Change-Id: Ib9195ecb01b7243b026001af423b4c9fdc4dde12 Closes-bug: #1451809 --- specs/python-fuelclient.spec | 38 +++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/specs/python-fuelclient.spec b/specs/python-fuelclient.spec index e3c6ea5..c82277c 100644 --- a/specs/python-fuelclient.spec +++ b/specs/python-fuelclient.spec @@ -1,19 +1,26 @@ +%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 + %define name python-fuelclient %{!?version: %define version 8.0.0} %{!?release: %define release 1} -Summary: Console utility for working with fuel rest api -Name: %{name} -Version: %{version} -Release: %{release} -Source0: %{name}-%{version}.tar.gz -License: Apache -Group: Development/Libraries -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot -Prefix: %{_prefix} -BuildArch: noarch -BuildRequires: python-setuptools +Summary: Console utility for working with fuel rest api +Name: %{name} +Version: %{version} +Release: %{release} +Source0: %{name}-%{version}.tar.gz +License: Apache +Group: Development/Libraries +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot +Prefix: %{_prefix} +BuildArch: noarch + +BuildRequires: python-setuptools BuildRequires: python-pbr > 0.7 BuildRequires: python-pbr < 1.0 @@ -54,13 +61,16 @@ Summary: Console utility for working with fuel rest api %setup -cq -n %{name}-%{version} %build -cd %{_builddir}/%{name}-%{version} && python setup.py build +cd %{_builddir}/%{name}-%{version} && %{__python2} setup.py build %install -cd %{_builddir}/%{name}-%{version} && python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=%{_builddir}/%{name}-%{version}/INSTALLED_FILES +rm -rf $RPM_BUILD_ROOT +cd %{_builddir}/%{name}-%{version} && %{__python2} setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT %clean rm -rf $RPM_BUILD_ROOT -%files -f %{_builddir}/%{name}-%{version}/INSTALLED_FILES +%files %defattr(-,root,root) +%{python2_sitelib}/* +%{_bindir}/*