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 |
+ |
%define closingbrace ) |
6 |
+ |
%define online %(case %cmsplatf in *onl_*_*%closingbrace echo true;; *%closingbrace echo flase;; esac) |
7 |
|
|
8 |
|
Requires: expat bz2lib db4 gdbm |
9 |
|
|
10 |
< |
%if "%{?online_release:set}" != "set" |
10 |
> |
%if "%online" != "true" |
11 |
|
Requires: zlib openssl |
12 |
|
%endif |
13 |
|
|
35 |
|
#%patch6 |
36 |
|
perl -p -i -e "s|#!.*/usr/local/bin/python|#!/usr/bin/env python|" Lib/cgi.py |
37 |
|
|
38 |
< |
%if %cmsplatf == "osx105_ia32_gcc345" |
38 |
> |
%ifos darwin |
39 |
|
sed 's|@PREFIX@|%i|g' < %_sourcedir/python-osx | patch -p1 |
40 |
|
%endif |
41 |
|
|
53 |
|
# whether we like to pick up system libraries or want total control. |
54 |
|
mkdir -p %i/include %i/lib |
55 |
|
|
56 |
< |
%if "%{?online_release:set}" != "set" |
56 |
> |
%if "%online" != "true" |
57 |
|
%define extradirs $ZLIB_ROOT $OPENSSL_ROOT |
58 |
|
%else |
59 |
|
%define extradirs %{nil} |
60 |
|
%endif |
61 |
|
|
60 |
– |
%if %cmsplatf == "osx105_ia32_gcc345" |
61 |
– |
%define extradirs $ZLIB_ROOT $OPENSSL_ROOT |
62 |
– |
%endif |
63 |
– |
|
62 |
|
dirs="$EXPAT_ROOT $BZ2LIB_ROOT $NCURSES_ROOT $DB4_ROOT $GDBM_ROOT %{extradirs}" |
63 |
|
|
64 |
|
echo $dirs |
101 |
|
make install |
102 |
|
%define pythonv %(echo %realversion | cut -d. -f 1,2) |
103 |
|
|
104 |
< |
# if [ $(uname) = Darwin ]; then |
105 |
< |
# # make install prefix=%i |
106 |
< |
# # (cd Misc; /bin/rm -rf RPM) |
107 |
< |
# # mkdir -p %i/share/doc/%n |
108 |
< |
# # cp -R Demo Doc %i/share/doc/%n |
109 |
< |
# # cp -R Misc Tools %i/lib/python%{pythonv} |
110 |
< |
gcc -dynamiclib -all_load -single_module \ |
111 |
< |
-framework System -framework CoreServices -framework Foundation \ |
112 |
< |
%i/lib/python%{pythonv}/config/libpython%{pythonv}.a \ |
113 |
< |
-undefined dynamic_lookup \ |
114 |
< |
-o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \ |
115 |
< |
-install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \ |
116 |
< |
-current_version %{pythonv} -compatibility_version %{pythonv} -ldl |
117 |
< |
(cd %i/lib/; ln -s python%{pythonv}/config/libpython%{pythonv}.dylib libpython%{pythonv}.dylib ) |
118 |
< |
# (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig; |
119 |
< |
# # sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig) |
120 |
< |
# fi |
104 |
> |
#if [ $(uname) = Darwin ]; then |
105 |
> |
# make install prefix=%i |
106 |
> |
# (cd Misc; /bin/rm -rf RPM) |
107 |
> |
# mkdir -p %i/share/doc/%n |
108 |
> |
# cp -R Demo Doc %i/share/doc/%n |
109 |
> |
# cp -R Misc Tools %i/lib/python%{pythonv} |
110 |
> |
# gcc -dynamiclib -all_load -single_module \ |
111 |
> |
# -framework System -framework CoreServices -framework Foundation \ |
112 |
> |
# %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \ |
113 |
> |
# -undefined dynamic_lookup \ |
114 |
> |
# -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \ |
115 |
> |
# -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \ |
116 |
> |
# -current_version %{pythonv} -compatibility_version %{pythonv} -ldl |
117 |
> |
# ln -s libpython%{pythonv}.dylib %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib # for boost |
118 |
> |
# (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig; |
119 |
> |
# sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig) |
120 |
> |
#fi |
121 |
|
|
122 |
|
perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \ |
123 |
|
%{i}/bin/pydoc \ |
132 |
|
rm `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'` |
133 |
|
rm `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'` |
134 |
|
|
135 |
+ |
%if "%online" == "true" |
136 |
+ |
# remove tkinter that brings dependency on libtk: |
137 |
+ |
rm `find %{i}/lib -type f -name "_tkinter.so"` |
138 |
+ |
%endif |
139 |
+ |
|
140 |
|
# SCRAM ToolBox toolfile |
141 |
|
mkdir -p %i/etc/scram.d |
142 |
|
cat << \EOF_TOOLFILE >%i/etc/scram.d/%n |
150 |
|
<Environment name=PYTHON_COMPILE default="$PYTHON_BASE/lib/python2.4/compileall.py"></Environment> |
151 |
|
</Client> |
152 |
|
<use name=sockets> |
153 |
+ |
<Runtime name=PYTHONHOME value="$PYTHON_BASE"> |
154 |
|
<Runtime name=PATH value="$PYTHON_BASE/bin" type=path> |
155 |
|
</Tool> |
156 |
|
EOF_TOOLFILE |