From faee668c7efbec3bed0cda05a83216bd126dd202 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 27 Aug 2015 01:06:37 +0200 Subject: [PATCH] Basic EPEL 6 support. --- python-pOCCI.spec | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/python-pOCCI.spec b/python-pOCCI.spec index 389459f..40fc865 100644 --- a/python-pOCCI.spec +++ b/python-pOCCI.spec @@ -2,10 +2,17 @@ %global commit d2a380ed1506ee483cda3b576227f649b0da109b %global shortcommit %(c=%{commit}; echo ${c:0:7}) +# compatibility macros %{!?py2_build:%global py2_build %{__python2} setup.py build --executable="%{__python2} -s"} %{!?py2_install:%global py2_install %{__python2} setup.py install -O1 --skip-build --root %{buildroot}} %{!?py3_build:%global py3_build %{__python3} setup.py build --executable="%{__python3} -s"} %{!?py3_install:%global py3_install %{__python3} setup.py install -O1 --skip-build --root %{buildroot}} +%if 0%{?rhel} && 0%{?rhel} <= 6 +%{!?__python2: %global __python2 /usr/bin/python2} +%{!?python2_version: %global python2_version %(%{__python2} -c "import sys; sys.stdout.write(sys.version[:3])")} +%{!?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 %if 0%{?rhel} %global with_python3 0 @@ -13,6 +20,12 @@ %global with_python3 1 %endif +%if 0%{?rhel} && 0%{?rhel} <= 6 +%global with_tests 0 +%else +%global with_tests 1 +%endif + Name: python-%{srcname} Version: 0.0.1 Release: 0.20150826git%{shortcommit}%{?dist} @@ -118,6 +131,7 @@ rm -f %{buildroot}%{_sysconfdir}/pOCCI.cfg %check +%if 0%{?with_tests} pushd python2 %{__python2} setup.py test popd @@ -130,7 +144,10 @@ pushd python3/build/lib/tests %{__python3} ./test_parse_uri.py popd %endif +%endif + +%{!?_licensedir:%global license %doc} %files -n python2-%{srcname} %license python2/LICENSE -- 1.8.2.3