17 |
|
|
18 |
|
Source0: http://www.python.org/ftp/%n/%realversion/Python-%realversion.tgz |
19 |
|
Patch0: python-2.6.4-dont-detect-dbm |
20 |
+ |
Patch1: python-2.6.4-fix-macosx-relocation |
21 |
|
|
22 |
|
%prep |
23 |
|
%setup -n Python-%realversion |
33 |
|
;; |
34 |
|
esac |
35 |
|
%patch0 -p1 |
36 |
+ |
%patch1 -p1 |
37 |
|
|
38 |
|
%build |
39 |
|
# Python is awkward about passing other include or library directories |
86 |
|
./configure --prefix=%i $additionalConfigureOptions --enable-shared \ |
87 |
|
--without-tkinter --disable-tkinter |
88 |
|
|
89 |
+ |
# Modify pyconfig.h to match macros from GLIBC features.h on Linux machines. |
90 |
+ |
# _POSIX_C_SOURCE and _XOPEN_SOURCE macros are not identical anymore |
91 |
+ |
# starting GLIBC 2.10.1. Python.h is not included before standard headers |
92 |
+ |
# in CMSSW and pyconfig.h is not smart enough to detect already defined |
93 |
+ |
# macros on Linux. The following problem does not exists on BSD machines as |
94 |
+ |
# cdefs.h does not define these macros. |
95 |
+ |
case %cmsplatf in |
96 |
+ |
slc6*) |
97 |
+ |
rm -f cms_configtest.cpp |
98 |
+ |
cat <<CMS_EOF > cms_configtest.cpp |
99 |
+ |
#include <features.h> |
100 |
+ |
|
101 |
+ |
int main() { |
102 |
+ |
return 0; |
103 |
+ |
} |
104 |
+ |
CMS_EOF |
105 |
+ |
|
106 |
+ |
FEATURES=$(g++ -dM -E -DGNU_GCC=1 -D_GNU_SOURCE=1 -D_DARWIN_SOURCE=1 cms_configtest.cpp \ |
107 |
+ |
| grep -E '_POSIX_C_SOURCE |_XOPEN_SOURCE ') |
108 |
+ |
rm -f cms_configtest.cpp a.out |
109 |
+ |
|
110 |
+ |
POSIX_C_SOURCE=$(echo "${FEATURES}" | grep _POSIX_C_SOURCE | cut -d ' ' -f 3) |
111 |
+ |
XOPEN_SOURCE=$(echo "${FEATURES}" | grep _XOPEN_SOURCE | cut -d ' ' -f 3) |
112 |
+ |
|
113 |
+ |
sed -ibak "s/\(#define _POSIX_C_SOURCE \)\(.*\)/\1${POSIX_C_SOURCE}/g" pyconfig.h |
114 |
+ |
sed -ibak "s/\(#define _XOPEN_SOURCE \)\(.*\)/\1${XOPEN_SOURCE}/g" pyconfig.h |
115 |
+ |
;; |
116 |
+ |
esac |
117 |
+ |
|
118 |
|
# The following is a kludge around the fact that the /usr/lib/libreadline.so |
119 |
|
# symlink (for 32-bit lib) is missing on the 64bit machines |
120 |
|
case %cmsplatf in |
177 |
|
# remove tkinter that brings dependency on libtk: |
178 |
|
find %{i}/lib -type f -name "_tkinter.so" -exec rm {} \; |
179 |
|
|
180 |
< |
# Remove documentation and examples. |
181 |
< |
rm -rf %i/share |
151 |
< |
|
152 |
< |
# No need for test files |
153 |
< |
rm -rf %{i}/lib/python%{pythonv}/test |
180 |
> |
# Remove documentation, examples and test files. |
181 |
> |
%define drop_files %i/share %{i}/lib/python%{pythonv}/test |
182 |
|
|
183 |
|
# Remove .pyo files |
184 |
|
find %i -name '*.pyo' -exec rm {} \; |