1 |
< |
### RPM external python 2.4.2-CMS18 |
1 |
> |
### RPM external python 2.5.4 |
2 |
|
## INITENV +PATH PATH %i/bin |
3 |
|
## INITENV +PATH LD_LIBRARY_PATH %i/lib |
4 |
|
# OS X patches and build fudging stolen from fink |
5 |
|
|
6 |
|
Requires: expat bz2lib db4 gdbm |
7 |
|
|
8 |
< |
%if "%{?online_release:set}" != "set" |
8 |
> |
%if "%cmsplatf" != "slc4onl_ia32_gcc346" |
9 |
|
Requires: zlib openssl |
10 |
|
%endif |
11 |
|
|
51 |
|
# whether we like to pick up system libraries or want total control. |
52 |
|
mkdir -p %i/include %i/lib |
53 |
|
|
54 |
< |
%if "%{?online_release:set}" != "set" |
54 |
> |
%if "%cmsplatf" != "slc4onl_ia32_gcc346" |
55 |
|
%define extradirs $ZLIB_ROOT $OPENSSL_ROOT |
56 |
|
%else |
57 |
|
%define extradirs %{nil} |
73 |
|
done |
74 |
|
done |
75 |
|
|
76 |
< |
./configure --prefix=%i --enable-shared --without-tkinter --disable-tkinter |
76 |
> |
additionalConfigureOptions="" |
77 |
> |
case %cmsplatf in |
78 |
> |
osx105* ) |
79 |
> |
additionalConfigureOptions="--disable-readline" |
80 |
> |
;; |
81 |
> |
esac |
82 |
> |
|
83 |
> |
./configure --prefix=%i $additionalConfigureOptions --enable-shared \ |
84 |
> |
--without-tkinter --disable-tkinter |
85 |
> |
|
86 |
|
# The following is a kludge around the fact that the /usr/lib/libreadline.so |
87 |
|
# symlink (for 32-bit lib) is missing on the 64bit machines |
88 |
< |
%if "%cmsplatf" == "slc4_ia32_gcc345" |
89 |
< |
mkdir -p %{i}/lib |
90 |
< |
ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so |
91 |
< |
%endif |
92 |
< |
%if "%cmsplatf" == "slc4_ia32_gcc412" |
93 |
< |
mkdir -p %{i}/lib |
85 |
< |
ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so |
86 |
< |
%endif |
88 |
> |
case %cmsplatf in |
89 |
> |
slc4_ia32* ) |
90 |
> |
mkdir -p %{i}/lib |
91 |
> |
ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so |
92 |
> |
;; |
93 |
> |
esac |
94 |
|
make %makeprocesses |
95 |
|
|
89 |
– |
|
96 |
|
%install |
97 |
|
make install |
98 |
|
%define pythonv %(echo %realversion | cut -d. -f 1,2) |
99 |
|
|
100 |
< |
#if [ $(uname) = Darwin ]; then |
101 |
< |
# make install prefix=%i |
102 |
< |
# (cd Misc; /bin/rm -rf RPM) |
103 |
< |
# mkdir -p %i/share/doc/%n |
104 |
< |
# cp -R Demo Doc %i/share/doc/%n |
105 |
< |
# cp -R Misc Tools %i/lib/python%{pythonv} |
106 |
< |
# gcc -dynamiclib -all_load -single_module \ |
107 |
< |
# -framework System -framework CoreServices -framework Foundation \ |
108 |
< |
# %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \ |
109 |
< |
# -undefined dynamic_lookup \ |
110 |
< |
# -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \ |
111 |
< |
# -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \ |
112 |
< |
# -current_version %{pythonv} -compatibility_version %{pythonv} -ldl |
113 |
< |
# ln -s libpython%{pythonv}.dylib %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib # for boost |
114 |
< |
# (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig; |
115 |
< |
# sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig) |
116 |
< |
#fi |
100 |
> |
case %cmsplatf in |
101 |
> |
osx*) |
102 |
> |
make install prefix=%i |
103 |
> |
(cd Misc; /bin/rm -rf RPM) |
104 |
> |
mkdir -p %i/share/doc/%n |
105 |
> |
cp -R Demo Doc %i/share/doc/%n |
106 |
> |
cp -R Misc Tools %i/lib/python%{pythonv} |
107 |
> |
gcc -dynamiclib -all_load -single_module \ |
108 |
> |
-framework System -framework CoreServices -framework Foundation \ |
109 |
> |
%i/lib/python%{pythonv}/config/libpython%{pythonv}.a \ |
110 |
> |
-undefined dynamic_lookup \ |
111 |
> |
-o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \ |
112 |
> |
-install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \ |
113 |
> |
-current_version %{pythonv} -compatibility_version %{pythonv} -ldl |
114 |
> |
(cd %i/lib/python%{pythonv}/config |
115 |
> |
perl -p -i -e 's|-fno-common||g' Makefile) |
116 |
> |
|
117 |
> |
find %i/lib/python%{pythonv}/config -name 'libpython*' -exec mv {} %i/lib \; |
118 |
> |
;; |
119 |
> |
esac |
120 |
|
|
121 |
|
perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \ |
122 |
|
%{i}/bin/pydoc \ |
125 |
|
%{i}/lib/python2.4/test/test_bz2.py \ |
126 |
|
%{i}/lib/python2.4/test/test_largefile.py \ |
127 |
|
%{i}/lib/python2.4/test/test_optparse.py |
119 |
– |
# boost.spec rfio.spec |
120 |
– |
# |
121 |
– |
# |
128 |
|
rm `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'` |
129 |
|
rm `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'` |
130 |
|
|
131 |
+ |
# remove tkinter that brings dependency on libtk: |
132 |
+ |
# |
133 |
+ |
|
134 |
+ |
rm `find %{i}/lib -type f -name "_tkinter.so"` |
135 |
+ |
|
136 |
|
# SCRAM ToolBox toolfile |
137 |
|
mkdir -p %i/etc/scram.d |
138 |
|
cat << \EOF_TOOLFILE >%i/etc/scram.d/%n |
150 |
|
</Tool> |
151 |
|
EOF_TOOLFILE |
152 |
|
|
153 |
+ |
# Makes sure that executables start with /usr/bin/env perl and not with comments. |
154 |
+ |
find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|^"""|#/usr/bin/env python\n"""|}' {} \; |
155 |
+ |
find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|^\'\'\'|#/usr/bin/env python\n\'\'\'|}' {} \; |
156 |
+ |
find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|/usr/local/bin/python|/usr/bin/env python|}' {} \; |
157 |
+ |
rm -f %i/share/doc/python/Demo/rpc/test |
158 |
+ |
|
159 |
|
%post |
160 |
|
find $RPM_INSTALL_PREFIX/%pkgrel/lib -type l | xargs ls -la | sed -e "s|.*[ ]\(/.*\) -> \(.*\)| \2 \1|;s|[ ]/[^ ]*/external| $RPM_INSTALL_PREFIX/%cmsplatf/external|g" | xargs -n2 ln -sf |
161 |
|
%{relocateConfig}etc/scram.d/%n |