1 |
< |
### RPM external python 2.5.4 |
1 |
> |
### RPM external python 2.4.2-CMS19 |
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 "%cmsplatf" != "slc4onl_ia32_gcc346" |
8 |
> |
%if "%{?online_release:set}" != "set" |
9 |
|
Requires: zlib openssl |
10 |
|
%endif |
11 |
– |
Provides: python2.5 |
11 |
|
|
12 |
|
# FIXME: readline, crypt |
13 |
|
# FIXME: gmp, panel, tk/tcl, x11 |
33 |
|
#%patch6 |
34 |
|
perl -p -i -e "s|#!.*/usr/local/bin/python|#!/usr/bin/env python|" Lib/cgi.py |
35 |
|
|
36 |
< |
%ifos darwin |
36 |
> |
%if %cmsplatf == "osx105_ia32_gcc345" |
37 |
|
sed 's|@PREFIX@|%i|g' < %_sourcedir/python-osx | patch -p1 |
38 |
|
%endif |
39 |
|
|
51 |
|
# whether we like to pick up system libraries or want total control. |
52 |
|
mkdir -p %i/include %i/lib |
53 |
|
|
54 |
< |
%if "%cmsplatf" != "slc4onl_ia32_gcc346" |
54 |
> |
%if "%{?online_release:set}" != "set" |
55 |
|
%define extradirs $ZLIB_ROOT $OPENSSL_ROOT |
56 |
|
%else |
57 |
|
%define extradirs %{nil} |
58 |
|
%endif |
59 |
|
|
60 |
+ |
%if %cmsplatf == "osx105_ia32_gcc345" |
61 |
+ |
%define extradirs $ZLIB_ROOT $OPENSSL_ROOT |
62 |
+ |
%endif |
63 |
+ |
|
64 |
|
dirs="$EXPAT_ROOT $BZ2LIB_ROOT $NCURSES_ROOT $DB4_ROOT $GDBM_ROOT %{extradirs}" |
65 |
|
|
66 |
|
echo $dirs |
89 |
|
|
90 |
|
# The following is a kludge around the fact that the /usr/lib/libreadline.so |
91 |
|
# symlink (for 32-bit lib) is missing on the 64bit machines |
92 |
< |
case %cmsplatf in |
93 |
< |
slc4_ia32* ) |
94 |
< |
mkdir -p %{i}/lib |
95 |
< |
ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so |
96 |
< |
;; |
97 |
< |
esac |
92 |
> |
%if "%cmsplatf" == "slc4_ia32_gcc345" |
93 |
> |
mkdir -p %{i}/lib |
94 |
> |
ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so |
95 |
> |
%endif |
96 |
> |
%if "%cmsplatf" == "slc4_ia32_gcc412" |
97 |
> |
mkdir -p %{i}/lib |
98 |
> |
ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so |
99 |
> |
%endif |
100 |
|
make %makeprocesses |
101 |
|
|
102 |
|
%install |
103 |
|
make install |
104 |
|
%define pythonv %(echo %realversion | cut -d. -f 1,2) |
105 |
|
|
106 |
< |
case %cmsplatf in |
107 |
< |
osx*) |
108 |
< |
make install prefix=%i |
109 |
< |
(cd Misc; /bin/rm -rf RPM) |
110 |
< |
mkdir -p %i/share/doc/%n |
111 |
< |
cp -R Demo Doc %i/share/doc/%n |
112 |
< |
cp -R Misc Tools %i/lib/python%{pythonv} |
108 |
< |
gcc -dynamiclib -all_load -single_module \ |
106 |
> |
# if [ $(uname) = Darwin ]; then |
107 |
> |
# # make install prefix=%i |
108 |
> |
# # (cd Misc; /bin/rm -rf RPM) |
109 |
> |
# # mkdir -p %i/share/doc/%n |
110 |
> |
# # cp -R Demo Doc %i/share/doc/%n |
111 |
> |
# # cp -R Misc Tools %i/lib/python%{pythonv} |
112 |
> |
gcc -dynamiclib -all_load -single_module \ |
113 |
|
-framework System -framework CoreServices -framework Foundation \ |
114 |
|
%i/lib/python%{pythonv}/config/libpython%{pythonv}.a \ |
115 |
|
-undefined dynamic_lookup \ |
116 |
|
-o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \ |
117 |
|
-install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \ |
118 |
|
-current_version %{pythonv} -compatibility_version %{pythonv} -ldl |
119 |
< |
(cd %i/lib/python%{pythonv}/config |
120 |
< |
perl -p -i -e 's|-fno-common||g' Makefile) |
121 |
< |
|
122 |
< |
find %i/lib/python%{pythonv}/config -name 'libpython*' -exec mv {} %i/lib \; |
119 |
< |
;; |
120 |
< |
esac |
119 |
> |
(cd %i/lib/; ln -s python%{pythonv}/config/libpython%{pythonv}.dylib libpython%{pythonv}.dylib ) |
120 |
> |
# (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig; |
121 |
> |
# # sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig) |
122 |
> |
# fi |
123 |
|
|
124 |
|
perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \ |
125 |
|
%{i}/bin/pydoc \ |
128 |
|
%{i}/lib/python2.4/test/test_bz2.py \ |
129 |
|
%{i}/lib/python2.4/test/test_largefile.py \ |
130 |
|
%{i}/lib/python2.4/test/test_optparse.py |
131 |
+ |
# boost.spec rfio.spec |
132 |
+ |
# |
133 |
+ |
# |
134 |
|
rm `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'` |
135 |
|
rm `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'` |
136 |
|
|
132 |
– |
# remove tkinter that brings dependency on libtk: |
133 |
– |
# |
134 |
– |
|
135 |
– |
rm `find %{i}/lib -type f -name "_tkinter.so"` |
136 |
– |
|
137 |
|
# SCRAM ToolBox toolfile |
138 |
|
mkdir -p %i/etc/scram.d |
139 |
|
cat << \EOF_TOOLFILE >%i/etc/scram.d/%n |
151 |
|
</Tool> |
152 |
|
EOF_TOOLFILE |
153 |
|
|
154 |
– |
# Makes sure that executables start with /usr/bin/env perl and not with comments. |
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/bin/env python\n\'\'\'|}' {} \; |
157 |
– |
find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|/usr/local/bin/python|/usr/bin/env python|}' {} \; |
158 |
– |
rm -f %i/share/doc/python/Demo/rpc/test |
159 |
– |
|
154 |
|
%post |
155 |
|
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 |
156 |
|
%{relocateConfig}etc/scram.d/%n |