ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
Revision: 1.51
Committed: Fri Jun 19 12:59:52 2009 UTC (15 years, 10 months ago) by muzaffar
Branch: MAIN
CVS Tags: CMSSW_3_3_6_patch6, sm100215, CMSSW_3_3_6_patch5, apFor336p5v1, CMSSW_3_3_6_patch4, apFor336p5v0, for336patch4, CMSSW_3_3_3_TSG, sm100115-333tsg, CMSSW_3_3_6_patch3, apFor336p3v0, CMSSW_3_3_6_patch1, eskFor336ptch1, CMSSW_3_3_6, apFor336v0, CMSSW_3_3_5_patch4, apFor335p4v0, CMSSW_3_3_5_patch3, apFor335p3v0, CMSSW_3_3_5_patch2, CMSSW_3_3_3_onlpatch5_ONLINE, apFor335p2v0, CMSSW_3_3_5_patch1, apFor335pat1v2, apFor335pat1v1, apFor335pat1v0, lsFor335patch1, lsFOR335patch1v0, CMSSW_3_3_5, CMSSW_3_3_3_onlpatch4_ONLINE, apFor335v0, pe20091126a-for33X-slc4-gcc345, CMSSW_3_3_3_onlpatch2_ONLINE, CMSSW_3_3_3_onlpatch3_ONLINE, CMSSW_3_3_4, apFor334v0, CMSSW_3_3_3_DQM, apFor333dqmv0, CMSSW_3_3_3_patch1, lmFor333pat1v0, CMSSW_3_3_3_ONLINE, fw20091114b, fw20091114a, ap20091114a, fw20091114, ap20091114, CMSSW_3_3_3, pe20091113a-for33X-slc4-gcc345, apFor333v1, pe20091110c-for33X-slc4-gcc345, pe20091110b-for33X-slc4-gcc345, pe20091110a-for33X-slc4-gcc345, CMSSW_3_3_2_onlpatch2_ONLINE, CMSSW_3_3_2_ONLINE, CMSSW_3_3_2_onlpatch1_ONLINE, CMSSW_3_3_0_onlpatch2_ONLINE, CMSSW_3_2_7_onlpatch6_ONLINE, for330op2, for327op6, CMSSW_3_3_0_onlpatch1_ONLINE, CMSSW_3_2_7_onlpatch5_ONLINE, CMSSW_3_2_7_onlpatch4_ONLINE, sm327op4, CMSSW_3_3_0_ONLINE, sm091013a, sm091012c, sm091012b, sm091012a, CMSSW_3_2_7_onlpatch3_ONLINE, sm091007a, CMSSW_3_2_7_onlpatch2_ONLINE, sm090928a, CMSSW_3_2_7_onlpatch1_ONLINE, CMSSW_3_2_7_ONLINE, sm090923a, sm090922a, PerfSuiteDB_20090901, CMSSW_3_2_1_onlpatch6_ONLINE, sm090829a, forHEARTBEATr04, CMSSW_3_2_1_onlpatch5_ONLINE, RPMVERIFY_0_2, sm090826a, CMSSW_3_2_1_onlpatch4_ONLINE, sm090818a, CMSSW_3_2_4_ONLINE, sm090813e, sm090813d, sm090813c, sm090813b, sm090813a, CMSSW_3_2_1_onlpatch3_ONLINE, sm090810a, CMSSW_3_2_1_onlpatch2_ONLINE, sm090806a, CMSSW_3_2_1_onlpatch1_ONLINE, apFor321onlp1v1, apFor321onlp1v0, CMSSW_3_2_1_ONLINE, sm090721b, sm090721a, sm090720b, sm090720a, apFor320onlv1, CMSSW_3_1_1_onlpatch3_ONLINE, sm090716a, CMSSW_3_1_1_onlpatch2_ONLINE, sm090715c, sm090715b, sm090715a, CMSSW_3_ONLINE_BOOTSTRAP, sm090709a, CMSSW_3_1_1_onlpatch1_ONLINE, sm090708g, CMSSW_3_1_1_ONLINE, sm090708f, sm090708e, sm090708d, popcon_monitoring-V01-00-00, sm090708c, sm090708b, CMSSW_3_1_0_ONLINE2, sm090708a, CMSSW_3_1_0_onlpatch1_ONLINE, sm090703a, CMSSW_3_1_0_ONLINE, sm090701b, sm090701a, CMSSW_3_1_0_pre10_ONLINE, sm090621b, sm090621a, sm090620b, sm090620a, sm090619e, sm090619d, sm090619c
Changes since 1.50: +43 -49 lines
Log Message:
clean of online specific arch string using the CMSSW_3_1_0_pre10-432 as a base

File Contents

# Content
1 ### RPM external python 2.4.2-CMS19
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 %define closingbrace )
6 %define online %(case %cmsplatf in *onl_*_*%closingbrace echo true;; *%closingbrace echo flase;; esac)
7
8 Requires: expat bz2lib db4 gdbm
9
10 %if "%online" != "true"
11 Requires: zlib openssl
12 %endif
13
14 # FIXME: readline, crypt
15 # FIXME: gmp, panel, tk/tcl, x11
16
17 Source0: http://www.python.org/ftp/%n/%realversion/Python-%realversion.tgz
18 Patch0: python-Include-pyport.h
19 Patch1: python-Lib-plat-mac-applesingle.py
20 Patch2: python-Lib-site.py
21 Patch3: python-Mac-OSX-Makefile
22 Patch4: python-Makefile.pre.in
23 Patch5: python-configure
24 Patch6: python-setup.py
25
26
27 %prep
28 %setup -n Python-%realversion
29 #%patch0
30 #%patch1
31 #%patch2
32 #%patch3
33 #%patch4
34 #%patch5
35 #%patch6
36 perl -p -i -e "s|#!.*/usr/local/bin/python|#!/usr/bin/env python|" Lib/cgi.py
37
38 %ifos darwin
39 sed 's|@PREFIX@|%i|g' < %_sourcedir/python-osx | patch -p1
40 %endif
41
42 %build
43 # Python is awkward about passing other include or library directories
44 # to it. Basically there is no way to pass anything from configure to
45 # make, or down to python itself. To get python detect the extensions
46 # we want to enable, we simply have to link the contents into python's
47 # own include/lib directories. Ugh.
48 #
49 # NB: It would sort-of make sense to link more stuff from /sw on OS X,
50 # but we simply cannot link the whole world. If you need something,
51 # see above for the commented-out list of packages that could be
52 # linked specifically, or could be built by ourselves, depending on
53 # whether we like to pick up system libraries or want total control.
54 mkdir -p %i/include %i/lib
55
56 %if "%online" != "true"
57 %define extradirs $ZLIB_ROOT $OPENSSL_ROOT
58 %else
59 %define extradirs %{nil}
60 %endif
61
62 dirs="$EXPAT_ROOT $BZ2LIB_ROOT $NCURSES_ROOT $DB4_ROOT $GDBM_ROOT %{extradirs}"
63
64 echo $dirs
65 for d in $dirs; do
66 for f in $d/include/*; do
67 [ -e $f ] || continue
68 rm -f %i/include/$(basename $f)
69 ln -s $f %i/include
70 done
71 for f in $d/lib/*; do
72 [ -e $f ] || continue
73 rm -f %i/lib/$(basename $f)
74 ln -s $f %i/lib
75 done
76 done
77
78 additionalConfigureOptions=""
79 case %cmsplatf in
80 osx105* )
81 additionalConfigureOptions="--disable-readline"
82 ;;
83 esac
84
85 ./configure --prefix=%i $additionalConfigureOptions --enable-shared \
86 --without-tkinter --disable-tkinter
87
88 # The following is a kludge around the fact that the /usr/lib/libreadline.so
89 # symlink (for 32-bit lib) is missing on the 64bit machines
90 %if "%cmsplatf" == "slc4_ia32_gcc345"
91 mkdir -p %{i}/lib
92 ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
93 %endif
94 %if "%cmsplatf" == "slc4_ia32_gcc412"
95 mkdir -p %{i}/lib
96 ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
97 %endif
98 make %makeprocesses
99
100 %install
101 make install
102 %define pythonv %(echo %realversion | cut -d. -f 1,2)
103
104 #if [ $(uname) = Darwin ]; then
105 # make install prefix=%i
106 # (cd Misc; /bin/rm -rf RPM)
107 # mkdir -p %i/share/doc/%n
108 # cp -R Demo Doc %i/share/doc/%n
109 # cp -R Misc Tools %i/lib/python%{pythonv}
110 # gcc -dynamiclib -all_load -single_module \
111 # -framework System -framework CoreServices -framework Foundation \
112 # %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \
113 # -undefined dynamic_lookup \
114 # -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
115 # -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
116 # -current_version %{pythonv} -compatibility_version %{pythonv} -ldl
117 # ln -s libpython%{pythonv}.dylib %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib # for boost
118 # (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig;
119 # sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig)
120 #fi
121
122 perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
123 %{i}/bin/pydoc \
124 %{i}/bin/smtpd.py \
125 %{i}/lib/python2.4/bsddb/dbshelve.py \
126 %{i}/lib/python2.4/test/test_bz2.py \
127 %{i}/lib/python2.4/test/test_largefile.py \
128 %{i}/lib/python2.4/test/test_optparse.py
129 # boost.spec rfio.spec
130 #
131 #
132 rm `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'`
133 rm `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'`
134
135 %if "%online" == "true"
136 # remove tkinter that brings dependency on libtk:
137 rm `find %{i}/lib -type f -name "_tkinter.so"`
138 %endif
139
140 # SCRAM ToolBox toolfile
141 mkdir -p %i/etc/scram.d
142 cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
143 <doc type=BuildSystem::ToolDoc version=1.0>
144 <Tool name=%n version=%v>
145 <lib name=python2.4>
146 <Client>
147 <Environment name=PYTHON_BASE default="%i"></Environment>
148 <Environment name=LIBDIR default="$PYTHON_BASE/lib"></Environment>
149 <Environment name=INCLUDE default="$PYTHON_BASE/include/python2.4"></Environment>
150 <Environment name=PYTHON_COMPILE default="$PYTHON_BASE/lib/python2.4/compileall.py"></Environment>
151 </Client>
152 <use name=sockets>
153 <Runtime name=PATH value="$PYTHON_BASE/bin" type=path>
154 </Tool>
155 EOF_TOOLFILE
156
157 %post
158 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
159 %{relocateConfig}etc/scram.d/%n