ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
Revision: 1.22
Committed: Wed Apr 18 23:46:02 2007 UTC (18 years ago) by ratnik
Branch: MAIN
Changes since 1.21: +2 -0 lines
Log Message:
Changes for building  externals in 64/32 mode: added gcc-wrapper .

File Contents

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