ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
Revision: 1.15
Committed: Thu Jul 6 13:08:38 2006 UTC (18 years, 9 months ago) by eulisse
Branch: MAIN
CVS Tags: nr_baran081_t1, for080_testfixes1, for080_testfixes, for081, for080_amd64, for080, for080p4, for080pre3
Changes since 1.14: +2 -0 lines
Log Message:
Bumping revision to make sure they get built with the new install.sh.

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