ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
(Generate patch)

Comparing COMP/CMSDIST/python.spec (file contents):
Revision 1.5 by eulisse, Mon Apr 24 22:22:12 2006 UTC vs.
Revision 1.42 by ratnik, Fri Jun 6 23:25:42 2008 UTC

# Line 1 | Line 1
1 < ### RPM external python 2.4.2
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 < Requires: zlib expat openssl bz2lib
6 < # FIXME: readline, ncurses, crypt, various [ng]dbm, db-*, db[1-3],
5 >
6 > Requires: expat bz2lib db4 gdbm
7 >
8 > %if "%cmsplatf" != "slc4onl_ia32_gcc346"
9 > Requires: zlib openssl
10 > %endif
11 >
12 > # FIXME: readline, crypt
13   # FIXME: gmp, panel, tk/tcl, x11
14  
15 < Source0: http://www.python.org/ftp/%n/%v/Python-%v.tgz
16 < #Patch0: python-osx
15 > Source0: http://www.python.org/ftp/%n/%realversion/Python-%realversion.tgz
16 > Patch0: python-Include-pyport.h
17 > Patch1: python-Lib-plat-mac-applesingle.py
18 > Patch2: python-Lib-site.py
19 > Patch3: python-Mac-OSX-Makefile
20 > Patch4: python-Makefile.pre.in
21 > Patch5: python-configure
22 > Patch6: python-setup.py
23 >
24  
25   %prep
26 < %setup -n Python-%v
26 > %setup -n Python-%realversion
27 > #%patch0
28 > #%patch1
29 > #%patch2
30 > #%patch3
31 > #%patch4
32 > #%patch5
33 > #%patch6
34   perl -p -i -e "s|#!.*/usr/local/bin/python|#!/usr/bin/env python|" Lib/cgi.py
35  
36   %ifos darwin
# Line 30 | Line 50 | perl -p -i -e "s|#!.*/usr/local/bin/pyth
50   # linked specifically, or could be built by ourselves, depending on
51   # whether we like to pick up system libraries or want total control.
52   mkdir -p %i/include %i/lib
53 < dirs="$ZLIB_ROOT $EXPAT_ROOT $OPENSSL_ROOT $BZ2LIB_ROOT"
53 >
54 > %if "%cmsplatf" != "slc4onl_ia32_gcc346"
55 > %define extradirs $ZLIB_ROOT $OPENSSL_ROOT
56 > %else
57 > %define extradirs %{nil}
58 > %endif
59 >
60 > dirs="$EXPAT_ROOT $BZ2LIB_ROOT $NCURSES_ROOT $DB4_ROOT $GDBM_ROOT %{extradirs}"
61 >
62 > echo $dirs
63   for d in $dirs; do
64    for f in $d/include/*; do
65 <    [ -f $f ] || continue
65 >    [ -e $f ] || continue
66      rm -f %i/include/$(basename $f)
67      ln -s $f %i/include
68    done
69    for f in $d/lib/*; do
70 <    [ -f $f ] || continue
70 >    [ -e $f ] || continue
71      rm -f %i/lib/$(basename $f)
72      ln -s $f %i/lib
73    done
74   done
75  
76 < ./configure --prefix=%i --enable-shared --without-tk --disable-tk --without-readline
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
94 >  ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
95 > %endif
96   make %makeprocesses
97  
98   %install
99   make install
100 < if [ $(uname) = Darwin ]; then
100 > %define pythonv %(echo %realversion | cut -d. -f 1,2)
101 >
102 > #if [ $(uname) = Darwin ]; then
103    # make install prefix=%i
104    # (cd Misc; /bin/rm -rf RPM)
105    # mkdir -p %i/share/doc/%n
106    # cp -R Demo Doc %i/share/doc/%n
107 <  # cp -R Misc Tools %i/lib/python2.3
108 <  cc -dynamiclib -all_load -single_module \
109 <    -framework System -framework CoreServices -framework Foundation \
110 <    %i/lib/python2.3/config/libpython2.3.a \
111 <    -o %i/lib/python2.3/config/libpython2.3.dylib \
112 <    -install_name %i/lib/python2.3/config/libpython2.3.dylib \
113 <    -current_version 2.3 -compatibility_version 2.3 -ldl
114 <  ln -s libpython2.3.dylib %i/lib/python2.3/config/libpython23.dylib # for boost
115 <  # (cd %i/lib/python2.3/config; mv Makefile Makefile.orig;
107 >  # cp -R Misc Tools %i/lib/python%{pythonv}
108 > #  gcc -dynamiclib -all_load -single_module \
109 > #    -framework System -framework CoreServices -framework Foundation \
110 > #    %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \
111 > #    -undefined dynamic_lookup \
112 > #    -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
113 > #    -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
114 > #    -current_version %{pythonv} -compatibility_version %{pythonv} -ldl
115 > #  ln -s libpython%{pythonv}.dylib %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib # for boost
116 >  # (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig;
117    #  sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig)
118 < fi
118 > #fi
119 >
120 > perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
121 >                    %{i}/bin/pydoc \
122 >                    %{i}/bin/smtpd.py \
123 >                    %{i}/lib/python2.4/bsddb/dbshelve.py \
124 >                    %{i}/lib/python2.4/test/test_bz2.py \
125 >                    %{i}/lib/python2.4/test/test_largefile.py \
126 >                    %{i}/lib/python2.4/test/test_optparse.py
127 > # boost.spec rfio.spec
128 > #
129 > #
130 > rm  `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'`
131 > rm  `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'`
132 >
133 > # remove tkinter that brings dependency on libtk:
134 > #
135 >
136 > rm  `find %{i}/lib -type f -name "_tkinter.so"`
137 >
138 > # SCRAM ToolBox toolfile
139 > mkdir -p %i/etc/scram.d
140 > cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
141 > <doc type=BuildSystem::ToolDoc version=1.0>
142 > <Tool name=%n version=%v>
143 > <lib name=python2.4>
144 > <Client>
145 > <Environment name=PYTHON_BASE default="%i"></Environment>
146 > <Environment name=LIBDIR default="$PYTHON_BASE/lib"></Environment>
147 > <Environment name=INCLUDE default="$PYTHON_BASE/include/python2.4"></Environment>
148 > <Environment name=PYTHON_COMPILE default="$PYTHON_BASE/lib/python2.4/compileall.py"></Environment>
149 > </Client>
150 > <use name=sockets>
151 > <Runtime name=PATH value="$PYTHON_BASE/bin" type=path>
152 > </Tool>
153 > EOF_TOOLFILE
154 >
155 > %post
156 > 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
157 > %{relocateConfig}etc/scram.d/%n

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines