ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
Revision: 1.22
Committed: Wed Apr 18 23:46:02 2007 UTC (18 years ago) by ratnik
Branch: MAIN
Changes since 1.21: +2 -0 lines
Log Message:
Changes for building  externals in 64/32 mode: added gcc-wrapper .

File Contents

# Content
1 ### RPM external python 2.4.3
2 Requires: gcc-wrapper
3 ## INITENV +PATH PATH %i/bin
4 ## INITENV +PATH LD_LIBRARY_PATH %i/lib
5 # OS X patches and build fudging stolen from fink
6 Requires: zlib expat openssl bz2lib db4 gdbm openssl
7 # FIXME: readline, crypt
8 # FIXME: gmp, panel, tk/tcl, x11
9
10 Source0: http://www.python.org/ftp/%n/%v/Python-%v.tgz
11 Patch0: python-Include-pyport.h
12 Patch1: python-Lib-plat-mac-applesingle.py
13 Patch2: python-Lib-site.py
14 Patch3: python-Mac-OSX-Makefile
15 Patch4: python-Makefile.pre.in
16 Patch5: python-configure
17 Patch6: python-setup.py
18
19
20 %prep
21 %setup -n Python-%v
22 #%patch0
23 #%patch1
24 #%patch2
25 #%patch3
26 #%patch4
27 #%patch5
28 #%patch6
29 perl -p -i -e "s|#!.*/usr/local/bin/python|#!/usr/bin/env python|" Lib/cgi.py
30
31 %ifos darwin
32 sed 's|@PREFIX@|%i|g' < %_sourcedir/python-osx | patch -p1
33 %endif
34
35 %build
36 ## IMPORT gcc-wrapper
37 # Python is awkward about passing other include or library directories
38 # to it. Basically there is no way to pass anything from configure to
39 # make, or down to python itself. To get python detect the extensions
40 # we want to enable, we simply have to link the contents into python's
41 # own include/lib directories. Ugh.
42 #
43 # NB: It would sort-of make sense to link more stuff from /sw on OS X,
44 # but we simply cannot link the whole world. If you need something,
45 # see above for the commented-out list of packages that could be
46 # linked specifically, or could be built by ourselves, depending on
47 # whether we like to pick up system libraries or want total control.
48 mkdir -p %i/include %i/lib
49 dirs="$ZLIB_ROOT $EXPAT_ROOT $OPENSSL_ROOT $BZ2LIB_ROOT $NCURSES_ROOT $DB4_ROOT $GDBM_ROOT"
50 echo $dirs
51 for d in $dirs; do
52 for f in $d/include/*; do
53 [ -f $f ] || continue
54 rm -f %i/include/$(basename $f)
55 ln -s $f %i/include
56 done
57 for f in $d/lib/*; do
58 [ -f $f ] || continue
59 rm -f %i/lib/$(basename $f)
60 ln -s $f %i/lib
61 done
62 done
63
64 ./configure --prefix=%i --enable-shared --without-tkinter --disable-tkinter --without-readline
65 make %makeprocesses
66
67 %install
68 make install
69 %define pythonv %(echo %v | cut -d. -f 1,2)
70
71 #if [ $(uname) = Darwin ]; then
72 # make install prefix=%i
73 # (cd Misc; /bin/rm -rf RPM)
74 # mkdir -p %i/share/doc/%n
75 # cp -R Demo Doc %i/share/doc/%n
76 # cp -R Misc Tools %i/lib/python%{pythonv}
77 # gcc -dynamiclib -all_load -single_module \
78 # -framework System -framework CoreServices -framework Foundation \
79 # %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \
80 # -undefined dynamic_lookup \
81 # -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
82 # -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
83 # -current_version %{pythonv} -compatibility_version %{pythonv} -ldl
84 # ln -s libpython%{pythonv}.dylib %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib # for boost
85 # (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig;
86 # sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig)
87 #fi
88
89 perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
90 %{i}/bin/pydoc \
91 %{i}/bin/smtpd.py \
92 %{i}/lib/python2.4/bsddb/dbshelve.py \
93 %{i}/lib/python2.4/test/test_bz2.py \
94 %{i}/lib/python2.4/test/test_largefile.py \
95 %{i}/lib/python2.4/test/test_optparse.py
96 # boost.spec rfio.spec
97 #
98 #
99 rm `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'`
100 rm `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'`
101 %post
102 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