ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
Revision: 1.6
Committed: Mon Apr 24 22:58:37 2006 UTC (19 years ago) by eulisse
Branch: MAIN
Changes since 1.5: +2 -2 lines
Log Message:
Now uses our version of ncurses.

File Contents

# User Rev Content
1 argiro 1.1 ### RPM external python 2.4.2
2 eulisse 1.3 ## INITENV +PATH PATH %i/bin
3     ## INITENV +PATH LD_LIBRARY_PATH %i/lib
4 argiro 1.1 # OS X patches and build fudging stolen from fink
5 eulisse 1.5 Requires: zlib expat openssl bz2lib
6 argiro 1.1 # 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 argiro 1.2 #Patch0: python-osx
11 argiro 1.1
12     %prep
13     %setup -n Python-%v
14 eulisse 1.5 perl -p -i -e "s|#!.*/usr/local/bin/python|#!/usr/bin/env python|" Lib/cgi.py
15    
16 argiro 1.1 %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 eulisse 1.6 dirs="$ZLIB_ROOT $EXPAT_ROOT $OPENSSL_ROOT $BZ2LIB_ROOT $NCURSES_ROOT"
34 argiro 1.1 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 eulisse 1.6 ./configure --prefix=%i --enable-shared --without-tkinter --disable-tkinter --without-readline
48 eulisse 1.3 make %makeprocesses
49 argiro 1.1
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