ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
Revision: 1.4
Committed: Wed Apr 12 10:36:02 2006 UTC (19 years ago) by eulisse
Branch: MAIN
Changes since 1.3: +1 -1 lines
Log Message:
--enable shared added to configure options.

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