[packaging] force python2.6 on rhel5 (closes #113099)

authorJulien Cristau <julien.cristau@logilab.fr>
changeset706a039f0398
branchdefault
phasepublic
hiddenno
parent revision#fe997d3a294c [packaging] steal spec file from fedora (closes #113099)
child revision#98efae3c4072 [packaging] Update download and project urls (closes #113099)
files modified by this revision
python-logilab-common.spec
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1354791665 -3600
# Thu Dec 06 12:01:05 2012 +0100
# Node ID 706a039f0398e1450c5b8af6372e56300be072cd
# Parent fe997d3a294c2e803e8dca8b90924c120909fcc9
[packaging] force python2.6 on rhel5 (closes #113099)

diff --git a/python-logilab-common.spec b/python-logilab-common.spec
@@ -1,10 +1,19 @@
1 +# for el5, force use of python2.6
2 +%if 0%{?el5}
3 +%define python python26
4 +%define __python /usr/bin/python2.6
5 +%{!?python_scriptarch: %define python_scriptarch %(%{__python} -c "from distutils.sysconfig import get_python_lib; from os.path import join; print join(get_python_lib(1, 1), 'scripts')")}
6 +%else
7 +%define python python
8 +%define __python /usr/bin/python
9 +%endif
10  %{!?_python_sitelib: %define _python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
11 
12 -Name:           python-logilab-common
13 +Name:           %{python}-logilab-common
14  Version:        0.58.2
15 -Release:        1%{?dist}
16 +Release:        logilab.1%{?dist}
17  Summary:        Common libraries for Logilab projects
18 
19  Group:          Development/Libraries
20  License:        GPLv2+
21  URL:            http://www.logilab.org/projects/common
@@ -25,15 +34,19 @@
22  %setup -q -n logilab-common-%{version}
23 
24 
25  %build
26  %{__python} setup.py build
27 +%if 0%{?el5}
28 +# change the python version in shebangs
29 +find . -name '*.py' -type f -print0 |  xargs -0 sed -i '1,3s;^#!.*python.*$;#! /usr/bin/python2.6;'
30 +%endif
31 
32 
33  %install
34  rm -rf $RPM_BUILD_ROOT
35 -%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
36 +NO_SETUPTOOLS=1 %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT %{?python_scriptarch: --install-scripts=%{python_scriptarch}}
37  rm -rf $RPM_BUILD_ROOT%{_python_sitelib}/logilab/common/test
38 
39  %check
40  %{__python} setup.py test
41 
@@ -47,10 +60,13 @@
42  %{_python_sitelib}/logilab*
43  %{_bindir}/*
44 
45 
46  %changelog
47 +* Fri Nov 16 2012 Julien Cristau <julien.cristau@logilab.fr> 0.58.2-logilab.1
48 +- Force python26 on el5
49 +
50  * Fri Aug 03 2012 Brian C. Lane <bcl@redhat.com> 0.58.2-1
51  - Upstream 0.58.2
52 
53  * Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.57.1-3
54  - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild