ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
Revision: 1.31
Committed: Fri Sep 21 21:02:30 2007 UTC (17 years, 7 months ago) by elmer
Branch: MAIN
CVS Tags: nr080626_for1612flt, CMSSW_1_6_12, apFor1612v0, apFor1612p3v0, CMSSW_1_6_12_pre2, apFor1612p2v1, apFor1612p2v0, CMSSW_1_6_12_pre1, apFor1612p1v1, apFor1612p1v0, CMSSW_1_6_11, apFor1611v0, apFor1611p1v1, apFor1611p1v0, CMSSW_1_6_10, apFor1610v0, CMSSW_1_6_10_pre2, CMSSW_1_6_10_pre1, apFor1610p2v0, apFor1610p1v2, CMSSW_1_6_8_FWLITE-root51800, apFor1610p1v1, CMSSW_1_6_9, apFor169v1, CMSSW_1_6_9_pre2, nr080124fwl168a, apFor169p2v2, apFor169p2v1, apFor169p2v0, ap20080116d, ap20080116c, ap20080116b, ap20080116a, ap20080115d, ap20080115c, ap20080115b, ap20080115a, ap20080114b, ap20080114a, CMSSW_1_6_9_pre1, apFor169p1, apFor169p1v5, apFor169p1v4, apFor169p1v3, apFor169p1v2, apFor169p1v1, apFor169p1v0, apFor169v0, CMSSW_1_6_8, CMSSW_1_6_8_pre2_FWLITE-root51706, apFor168, CMSSW_1_6_8_pre2, apFor168p2, CMSSW_1_6_8_pre1, apFor168p1, CMSSW_1_6_7_FWLITE, nr071026_fwlite167, nr071025_fwlite167, CMSSW_1_6_7, pe20071019a-for167, CMSSW_1_6_6, pe20071013a-for166p2, pe20071011a-for166, pe20071009a-for166p1, CMSSW_1_6_5, pe20071006a-for165, CMSSW_1_6_5_pre2, pe20071005a-for165p2, CMSSW_1_6_5_pre1, pe20070930b-for165p1, pe20070930a-for165p1, CMSSW_1_6_4, pe20070929a-for164, CMSSW_1_6_3, pe20070928a-for16Xdpm, pe20070926a-for163, CMSSW_1_6_2, pe20070925a-for162, CMSSW_1_6_2_pre1, pe20070922a-for162p1, pe20070922g-for161p2, pe20070922f-for161p2, pe20070922e-for161p2, pe20070922d-for161p2, pe20070922c-for161p2, pe20070922b-for161p2, pe20070922a-for161p2
Changes since 1.30: +1 -1 lines
Log Message:
Update to -CMS3q (for 161p2)

File Contents

# Content
1 ### RPM external python 2.4.2-CMS3q
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 bz2lib db4 gdbm
6 # FIXME: readline, crypt
7 # FIXME: gmp, panel, tk/tcl, x11
8
9 Source0: http://www.python.org/ftp/%n/%realversion/Python-%realversion.tgz
10 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
18
19 %prep
20 %setup -n Python-%realversion
21 #%patch0
22 #%patch1
23 #%patch2
24 #%patch3
25 #%patch4
26 #%patch5
27 #%patch6
28 perl -p -i -e "s|#!.*/usr/local/bin/python|#!/usr/bin/env python|" Lib/cgi.py
29
30 %ifos darwin
31 sed 's|@PREFIX@|%i|g' < %_sourcedir/python-osx | patch -p1
32 %endif
33
34 %build
35 # Python is awkward about passing other include or library directories
36 # to it. Basically there is no way to pass anything from configure to
37 # make, or down to python itself. To get python detect the extensions
38 # we want to enable, we simply have to link the contents into python's
39 # own include/lib directories. Ugh.
40 #
41 # NB: It would sort-of make sense to link more stuff from /sw on OS X,
42 # but we simply cannot link the whole world. If you need something,
43 # see above for the commented-out list of packages that could be
44 # linked specifically, or could be built by ourselves, depending on
45 # whether we like to pick up system libraries or want total control.
46 mkdir -p %i/include %i/lib
47 dirs="$ZLIB_ROOT $EXPAT_ROOT $OPENSSL_ROOT $BZ2LIB_ROOT $NCURSES_ROOT $DB4_ROOT $GDBM_ROOT"
48 echo $dirs
49 for d in $dirs; do
50 for f in $d/include/*; do
51 [ -e $f ] || continue
52 rm -f %i/include/$(basename $f)
53 ln -s $f %i/include
54 done
55 for f in $d/lib/*; do
56 [ -e $f ] || continue
57 rm -f %i/lib/$(basename $f)
58 ln -s $f %i/lib
59 done
60 done
61
62 ./configure --prefix=%i --enable-shared --without-tkinter --disable-tkinter --without-readline
63 make %makeprocesses
64
65 %install
66 make install
67 %define pythonv %(echo %realversion | cut -d. -f 1,2)
68
69 #if [ $(uname) = Darwin ]; then
70 # make install prefix=%i
71 # (cd Misc; /bin/rm -rf RPM)
72 # mkdir -p %i/share/doc/%n
73 # cp -R Demo Doc %i/share/doc/%n
74 # cp -R Misc Tools %i/lib/python%{pythonv}
75 # gcc -dynamiclib -all_load -single_module \
76 # -framework System -framework CoreServices -framework Foundation \
77 # %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \
78 # -undefined dynamic_lookup \
79 # -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
80 # -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
81 # -current_version %{pythonv} -compatibility_version %{pythonv} -ldl
82 # ln -s libpython%{pythonv}.dylib %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib # for boost
83 # (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig;
84 # sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig)
85 #fi
86
87 perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
88 %{i}/bin/pydoc \
89 %{i}/bin/smtpd.py \
90 %{i}/lib/python2.4/bsddb/dbshelve.py \
91 %{i}/lib/python2.4/test/test_bz2.py \
92 %{i}/lib/python2.4/test/test_largefile.py \
93 %{i}/lib/python2.4/test/test_optparse.py
94 # boost.spec rfio.spec
95 #
96 #
97 rm `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'`
98 rm `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'`
99
100 # SCRAM ToolBox toolfile
101 mkdir -p %i/etc/scram.d
102 cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
103 <doc type=BuildSystem::ToolDoc version=1.0>
104 <Tool name=%n version=%v>
105 <lib name=python2.4>
106 <Client>
107 <Environment name=PYTHON_BASE default="%i"></Environment>
108 <Environment name=LIBDIR default="$PYTHON_BASE/lib"></Environment>
109 <Environment name=INCLUDE default="$PYTHON_BASE/include/python2.4"></Environment>
110 <Environment name=PYTHON_COMPILE default="$PYTHON_BASE/lib/python2.4/compileall.py"></Environment>
111 </Client>
112 <use name=sockets>
113 <Runtime name=PATH value="$PYTHON_BASE/bin" type=path>
114 </Tool>
115 EOF_TOOLFILE
116
117 %post
118 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
119 %{relocateConfig}etc/scram.d/%n