1 |
< |
### RPM external python 2.6.8 |
1 |
> |
### RPM external python 2.7.3 |
2 |
|
## INITENV +PATH PATH %i/bin |
3 |
|
## INITENV +PATH LD_LIBRARY_PATH %i/lib |
4 |
|
## INITENV SETV PYTHON_LIB_SITE_PACKAGES lib/python%{python_major_version}/site-packages |
17 |
|
# FIXME: gmp, panel, tk/tcl, x11 |
18 |
|
|
19 |
|
Source0: http://www.python.org/ftp/%n/%realversion/Python-%realversion.tgz |
20 |
< |
Patch0: python-dont-detect-dbm |
20 |
> |
Patch0: python-2.7.3-dont-detect-dbm |
21 |
|
Patch1: python-fix-macosx-relocation |
22 |
|
|
23 |
|
%prep |
27 |
|
perl -p -i -e "s|#!.*/usr/local/bin/python|#!/usr/bin/env python|" $f |
28 |
|
else :; fi |
29 |
|
done |
30 |
< |
%patch0 -p0 |
30 |
> |
%patch0 -p1 |
31 |
|
%patch1 -p0 |
32 |
|
|
33 |
|
%build |
78 |
|
./configure --prefix=%i $additionalConfigureOptions --enable-shared \ |
79 |
|
--without-tkinter --disable-tkinter |
80 |
|
|
81 |
+ |
# Modify pyconfig.h to match macros from GLIBC features.h on Linux machines. |
82 |
+ |
# _POSIX_C_SOURCE and _XOPEN_SOURCE macros are not identical anymore |
83 |
+ |
# starting GLIBC 2.10.1. Python.h is not included before standard headers |
84 |
+ |
# in CMSSW and pyconfig.h is not smart enough to detect already defined |
85 |
+ |
# macros on Linux. The following problem does not exists on BSD machines as |
86 |
+ |
# cdefs.h does not define these macros. |
87 |
+ |
case %cmsplatf in |
88 |
+ |
slc6*) |
89 |
+ |
rm -f cms_configtest.cpp |
90 |
+ |
cat <<CMS_EOF > cms_configtest.cpp |
91 |
+ |
#include <features.h> |
92 |
+ |
|
93 |
+ |
int main() { |
94 |
+ |
return 0; |
95 |
+ |
} |
96 |
+ |
CMS_EOF |
97 |
+ |
|
98 |
+ |
FEATURES=$(g++ -dM -E -DGNU_GCC=1 -D_GNU_SOURCE=1 -D_DARWIN_SOURCE=1 cms_configtest.cpp \ |
99 |
+ |
| grep -E '_POSIX_C_SOURCE |_XOPEN_SOURCE ') |
100 |
+ |
rm -f cms_configtest.cpp a.out |
101 |
+ |
|
102 |
+ |
POSIX_C_SOURCE=$(echo "${FEATURES}" | grep _POSIX_C_SOURCE | cut -d ' ' -f 3) |
103 |
+ |
XOPEN_SOURCE=$(echo "${FEATURES}" | grep _XOPEN_SOURCE | cut -d ' ' -f 3) |
104 |
+ |
|
105 |
+ |
sed -ibak "s/\(#define _POSIX_C_SOURCE \)\(.*\)/\1${POSIX_C_SOURCE}/g" pyconfig.h |
106 |
+ |
sed -ibak "s/\(#define _XOPEN_SOURCE \)\(.*\)/\1${XOPEN_SOURCE}/g" pyconfig.h |
107 |
+ |
;; |
108 |
+ |
esac |
109 |
+ |
|
110 |
+ |
# The following is a kludge around the fact that the /usr/lib/libreadline.so |
111 |
+ |
# symlink (for 32-bit lib) is missing on the 64bit machines |
112 |
+ |
case %cmsplatf in |
113 |
+ |
slc4_ia32* ) |
114 |
+ |
mkdir -p %{i}/lib |
115 |
+ |
ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so |
116 |
+ |
;; |
117 |
+ |
esac |
118 |
+ |
|
119 |
|
make %makeprocesses |
120 |
|
|
121 |
|
%install |
150 |
|
%{i}/bin/pydoc \ |
151 |
|
%{i}/bin/python-config \ |
152 |
|
%{i}/bin/2to3 \ |
153 |
< |
%{i}/bin/python2.6-config \ |
154 |
< |
%{i}/bin/smtpd.py \ |
117 |
< |
%{i}/lib/python2.6/bsddb/dbshelve.py \ |
118 |
< |
%{i}/lib/python2.6/test/test_bz2.py \ |
119 |
< |
%{i}/lib/python2.6/test/test_largefile.py \ |
120 |
< |
%{i}/lib/python2.6/test/test_optparse.py |
153 |
> |
%{i}/bin/python2.7-config \ |
154 |
> |
%{i}/bin/smtpd.py |
155 |
|
|
156 |
|
find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*' -exec rm {} \; |
157 |
|
find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*' -exec rm {} \; |