ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
Revision: 1.12
Committed: Fri May 19 13:13:15 2006 UTC (18 years, 11 months ago) by eulisse
Branch: MAIN
CVS Tags: forPR010, forPA010, af20060928, ProdAgent_pa17, phedex_2_3_series, V00-00-09, V00-00-08, V00-00-07, V00-00-06
Changes since 1.11: +1 -1 lines
Log Message:
Openssl readded as a dependency.

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.12 Requires: zlib expat openssl bz2lib db4 gdbm openssl
6 eulisse 1.8 # FIXME: readline, crypt
7 argiro 1.1 # 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.7 dirs="$ZLIB_ROOT $EXPAT_ROOT $OPENSSL_ROOT $BZ2LIB_ROOT $NCURSES_ROOT $DB4_ROOT $GDBM_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 eulisse 1.8 %define pythonv %(echo %v | cut -d. -f 1,2)
53    
54 argiro 1.1 if [ $(uname) = Darwin ]; then
55     # make install prefix=%i
56     # (cd Misc; /bin/rm -rf RPM)
57     # mkdir -p %i/share/doc/%n
58     # cp -R Demo Doc %i/share/doc/%n
59 eulisse 1.8 # cp -R Misc Tools %i/lib/python%{pythonv}
60 argiro 1.1 cc -dynamiclib -all_load -single_module \
61     -framework System -framework CoreServices -framework Foundation \
62 eulisse 1.8 %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \
63     -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
64     -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
65     -current_version %{pythonv} -compatibility_version %{pythonv} -ldl
66     ln -s libpython%{pythonv}.dylib %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib # for boost
67     # (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig;
68 argiro 1.1 # sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig)
69     fi
70 eulisse 1.9
71     perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
72     %{i}/bin/pydoc \
73     %{i}/bin/smtpd.py \
74     %{i}/lib/python2.4/bsddb/dbshelve.py \
75     %{i}/lib/python2.4/test/test_bz2.py \
76     %{i}/lib/python2.4/test/test_largefile.py \
77     %{i}/lib/python2.4/test/test_optparse.py