ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
Revision: 1.7
Committed: Tue Apr 25 16:04:59 2006 UTC (19 years ago) by eulisse
Branch: MAIN
CVS Tags: V00-00-00
Changes since 1.6: +2 -2 lines
Log Message:
uses our own gdbm db4.

File Contents

# Content
1 ### RPM external python 2.4.2
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 ncurses gdbm db4
6 # FIXME: readline, ncurses, crypt, various [ng]dbm, db-*, db[1-3],
7 # FIXME: gmp, panel, tk/tcl, x11
8
9 Source0: http://www.python.org/ftp/%n/%v/Python-%v.tgz
10 #Patch0: python-osx
11
12 %prep
13 %setup -n Python-%v
14 perl -p -i -e "s|#!.*/usr/local/bin/python|#!/usr/bin/env python|" Lib/cgi.py
15
16 %ifos darwin
17 sed 's|@PREFIX@|%i|g' < %_sourcedir/python-osx | patch -p1
18 %endif
19
20 %build
21 # Python is awkward about passing other include or library directories
22 # to it. Basically there is no way to pass anything from configure to
23 # make, or down to python itself. To get python detect the extensions
24 # we want to enable, we simply have to link the contents into python's
25 # own include/lib directories. Ugh.
26 #
27 # NB: It would sort-of make sense to link more stuff from /sw on OS X,
28 # but we simply cannot link the whole world. If you need something,
29 # see above for the commented-out list of packages that could be
30 # linked specifically, or could be built by ourselves, depending on
31 # whether we like to pick up system libraries or want total control.
32 mkdir -p %i/include %i/lib
33 dirs="$ZLIB_ROOT $EXPAT_ROOT $OPENSSL_ROOT $BZ2LIB_ROOT $NCURSES_ROOT $DB4_ROOT $GDBM_ROOT"
34 for d in $dirs; do
35 for f in $d/include/*; do
36 [ -f $f ] || continue
37 rm -f %i/include/$(basename $f)
38 ln -s $f %i/include
39 done
40 for f in $d/lib/*; do
41 [ -f $f ] || continue
42 rm -f %i/lib/$(basename $f)
43 ln -s $f %i/lib
44 done
45 done
46
47 ./configure --prefix=%i --enable-shared --without-tkinter --disable-tkinter --without-readline
48 make %makeprocesses
49
50 %install
51 make install
52 if [ $(uname) = Darwin ]; then
53 # make install prefix=%i
54 # (cd Misc; /bin/rm -rf RPM)
55 # mkdir -p %i/share/doc/%n
56 # cp -R Demo Doc %i/share/doc/%n
57 # cp -R Misc Tools %i/lib/python2.3
58 cc -dynamiclib -all_load -single_module \
59 -framework System -framework CoreServices -framework Foundation \
60 %i/lib/python2.3/config/libpython2.3.a \
61 -o %i/lib/python2.3/config/libpython2.3.dylib \
62 -install_name %i/lib/python2.3/config/libpython2.3.dylib \
63 -current_version 2.3 -compatibility_version 2.3 -ldl
64 ln -s libpython2.3.dylib %i/lib/python2.3/config/libpython23.dylib # for boost
65 # (cd %i/lib/python2.3/config; mv Makefile Makefile.orig;
66 # sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig)
67 fi