Revision: | 1.65 |
Committed: | Tue Apr 20 08:12:51 2010 UTC (15 years ago) by muzaffar |
Branch: | MAIN |
CVS Tags: | CMSSW_3_9_9_patch1, apFor399p1v0, CMSSW_3_9_9, apFor399v0, CMSSW_3_9_8_patch2, apFor398p2v0, CMSSW_3_9_8_patch1, apFor398p1v0, CMSSW_3_9_8, apFor398v0, smFor398a, smFor398, CMSSW_3_10_1, smFor3101, CMSSW_3_10_0_pre9G493, sm110117, fwFor3100xdaq11b4online, CMSSW_3_9_5_xdaq11b4_ONLINE, CMSSW_3_8_7_patch2, sjgFor387p2b, sjgFor387p2, CMSSW_3_11_0_pre3, smFor3110pre3a, smFor3110pre3, pe20101230-311XAB, CMSSW_3_11_0_pre2, pe20101229-for311X, fwFor311pre2, CMSSW_3_10_0, CMSSW_3_9_7, smFor3100c, apFor397v0, CMSSW_3_9_6, pe20101221a-for3100p9io, smFor3100b, apFor396v0, smFor3100a, smFor3100, pe20101217b-for3100p9io, pe20101217a-for3100p9io, CMSSW_3_8_7_patch1, CMSSW_3_11_0_pre1, fwFor311pre1, smFor3100pre9G493, CMSSW_3_10_0_pre9r52706b, pe20101215-for3100p9r52706b, CMSSW_3_10_0_pre9, smFor3100pre9a, smFor3100pre9, CMSSW_3_9_5_patch2, apFor395p2v0, CMSSW_3_10_0_pre8, smFor3100pre8, smFor310X-101207, smFor310X-101206b, smFor310X-101206ab, smFor310X-101206a, smFor310X-101206, pe20101206-for3100pre7r52706b, CMSSW_3_10_0_pre7g494c1, CMSSW_3_9_5_patch1, apFor395p1v0, smFor3100pre7G494C1a, pe20101203-root52706b, DQMGUI_5_3_2, dsr20101201fwlite387, CMSSW_3_10_0_pre7io, azFor3100pre7io-a, smFor3100pre7io-a, azFor3100pre7io-Updated, smFor3100pre7G494C1, azFor3100pre7io, smFor3100pre7io, CMSSW_3_10_0_pre7, smFor3100pre7, smFor310X-101130, CMSSW_3_8_7, smFor310X-101129, dsr20101129fwlite394, CMSSW_3_9_5_ONLINE, CMSSW_3_9_5, CMSSW_3_10_0_pre6, smFor3100pre6, apFor395v0, sjg101126b, sjg101126a, CMSSW_3_9_4, smFor310X-101123, apFor394v0, smFor39X-101123, for310X-101122a, CMSSW_3_8_6_patch2, sjgFor386p2, CMSSW_3_9_1_onlpatch4_ONLINE, CMSSW_3_9_1_onlpatch3_ONLINE, for310X-101122, sjg101122b, sjg101122a, CMSSW_3_10_0_pre5, CMSSW_3_9_3_ONLINE, azFor3100p5, CMSSW_3_9_3, apFor393v0, CMSSW_3_10_0_pre4r52706, pe20101112b-for3100p4r52706, pe20101112-for3100p4r52706, smFor310X-101111, CMSSW_3_9_2_patch5, CMSSW_3_10_0_pre4, CMSSW_3_9_2_patch4, azFor3100pre4-Updated, azFor3100pre4, smFor392p4, CMSSW_3_8_6_patch1, sjgFor386p1, CMSSW_3_9_2_patch3, apFor392p3v0, CMSSW_3_9_2_patch2, apFor392p2v0, smFor310-101106, CMSSW_3_9_2_patch1, apFor392p1v0, CMSSW_3_9_1_onlpatch2_ONLINE, CMSSW_3_9_1_onlpatch1_ONLINE, smFor310-101104, CMSSW_3_9_2, apFor392v0, sjgFor392, CMSSW_3_10_0_pre3, CMSSW_3_8_6, azFor3100p3a, smFor386a, azFor3100p3, CMSSW_3_9_1_patch1, smFor391patch1, CMSSW_3_9_1_ONLINE, smFor391onl, CMSSW_3_9_1, smFor391, apFor391v1, apFor391v0, smFor386, CMSSW_3_10_0_pre2, smFor3100pre2, CMSSW_3_8_5_patch3, apFor385p3v0, CMSSW_3_8_5_onlpatch4_ONLINE, CMSSW_3_8_5_onlpatch3_ONLINE, CMSSW_3_10_0_pre1, smFor3100pre1, CMSSW_3_8_5_patch2, sjgFor385p2, CMSSW_3_8_5_patch1, sjgFor385p1, eskFor3XYpreZ, CMSSW_3_9_0, apFor390v0, CMSSW_3_8_5_onlpatch1_ONLINE, CMSSW_3_8_5_ONLINE, fw385online, CMSSW_3_8_1_onlpatch7_ONLINE, CMSSW_3_9_0_pre7, CMSSW_3_8_4_patch4, sjfFor384p4, apFor390pre7v0, sm39Xtoolconf-101007, CMSSW_3_8_5, sjgFor385, sm39Xtoolconf-101005, DQMGUI_5_3_1, CMSSW_3_9_0_pre6, CMSSW_3_8_1_onlpatch6_ONLINE, apFor390pre6v0, smFor390pre6toolconf-101001, CMSSW_3_8_4_patch3, sjgFor384patch3v3, sjgFor384patch3v2, sjgFor384patch3, smFor390pre6toolconf-100929, smFor390pre6toolconf, smFor385toolconf, sm100928a, CMSSW_3_9_0_pre5, apFor390pre5v0, CMSSW_3_8_4_patch2, bhFor384p2, CMSSW_3_8_4_patch1, bhFor384p1, CMSSW_3_9_0_pre4, CMSSW_3_8_4, bhFor384, CMSSW_3_8_1_onlpatch5_ONLINE, apFor390pre4v0, CMSSW_3_8_3, pe20100912-for39X, bhFor383, apFor383v1, apFor383v0, CMSSW_3_8_1_onlpatch4_ONLINE, CMSSW_3_8_2_patch1, bhFor382p1, CMSSW_3_8_1_onlpatch3_ONLINE, fc20100901b, fc20100901a, CMSSW_3_9_0_pre3, sm100901a, CMSSW_3_8_1_onlpatch2_ONLINE, CMSSW_3_8_1_onlpatch1_ONLINE, CMSSW_3_8_1_patch4, bhFor381patch4, sm390p3toolconf, CMSSW_3_8_2, bhFor382, sm39XPoolLess, sm100823a, CMSSW_3_8_1_patch3, smFor381patch3, pe20100819a-for390p2r52704, pe20100817a-for390p2r52704, dsr20100816fwlite381, dsr20100816fwlite371, CMSSW_3_9_0_pre2, CMSSW_3_8_1_ONLINE, for390pre2, dsr20100812fwlite371, CMSSW_3_8_1_patch2, bhFor381p2, for390p2tools1, for390pre2tools, CMSSW_3_8_1_patch1, bhFor381patch1, fw381online, CMSSW_3_7_1, CMSSW_3_8_1, bhFor381, fw371, CMSSW_3_8_0_patch2, bhFor380patch2, fw380online, fw380online_3, fw380online_2, CMSSW_3_9_0_pre1, fw380online_0, apFor390pre1v0, pe20100727a-for39X, CMSSW_3_8_0_patch1, bhFor380patch1, ge20100722-rpm-osx-64-bit, CMSSW_3_8_0, bhFor380, forPHEDEX-web-20100720-1, CMSSW_3_8_0_pre8, bhFor380pre8, CMSSW_3_8_0_pre7, bhFor380pre7, CMSSW_3_7_0_patch4, CMSSW_3_8_0_pre6, smFor370patch4, CMSSW_3_7_0_patch3, bhFor380pre6, CMSSW_3_8_0_pre5ssl, pe20100624b-for38Xssl, pe20100624a-for38Xssl, CMSSW_3_8_0_pre5, smFor370patch3, pe20100623a-for38Xssl, apFor380pre5v0, ge20100621-bootstrap-rpm-4-8-macosx, CMSSW_3_8_0_pre4catfix, bhFor380pre4catfix, bhFor380pre4_cat_fix, CMSSW_3_8_0_pre4, bhFor380pre4, CMSSW_3_8_0_pre3, bhFor380pre3, pe20100612a-gcc45-from380p2, ge20100611-apt-rpm-4-8-gcc-4-5-0, MotT0_1_0_15, CMSSW_3_8_0_pre2, MotT0_1_0_14, CMSSW_3_7_0_patch2, smFor370p2, bhFor380_pre2, MotT0_1_0_13, pe20100606a-for38X, MotT0_1_0_12, MotT0_1_0_11, MotT0_1_0_10, CMSSW_3_7_0_patch1, MotT0_1_0_9, MotT0_1_0_8, smFor370patch1, MotT0_1_0_6, MotT0_1_0_5, CMSSW_3_8_0_pre1, MotT0_1_0_4, MotT0_1_0_3, apFor380pre1v0, CMSSW_3_7_0, smFor370, CMSSW_3_7_0_pre5g493ref04, ge20100521b-new-rpm, ge20100521-new-rpm, pe20100521-for37X-newG4, pe20100519a-for37X, ge20100519-new-apt, CMSSW_3_7_0_pre5, smFor370pre5, CMSSW_3_7_0_pre4, sm370pre4, sm100511a, pe20100511b-for37X, pe20100511a-for37X, sm100511, pe20100510b-for37X, pe20100510a-for37X, ge20100427-rpm-on-linux, ge20100422-rpm-4-8-0, pe20100420a-for37X |
Changes since 1.64: | +13 -14 lines |
Log Message: | migrated scram toolfiles to xml |
# | Content |
---|---|
1 | ### RPM external python 2.6.4 |
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 false;; esac) |
7 | |
8 | Requires: expat bz2lib db4 gdbm |
9 | |
10 | %if "%online" != "true" |
11 | Requires: zlib openssl sqlite |
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 | |
19 | %prep |
20 | %setup -n Python-%realversion |
21 | perl -p -i -e "s|#!.*/usr/local/bin/python|#!/usr/bin/env python|" Lib/cgi.py |
22 | |
23 | %ifos darwin |
24 | sed 's|@PREFIX@|%i|g' < %_sourcedir/python-osx | patch -p1 |
25 | %endif |
26 | |
27 | %build |
28 | # Python is awkward about passing other include or library directories |
29 | # to it. Basically there is no way to pass anything from configure to |
30 | # make, or down to python itself. To get python detect the extensions |
31 | # we want to enable, we simply have to link the contents into python's |
32 | # own include/lib directories. Ugh. |
33 | # |
34 | # NB: It would sort-of make sense to link more stuff from /sw on OS X, |
35 | # but we simply cannot link the whole world. If you need something, |
36 | # see above for the commented-out list of packages that could be |
37 | # linked specifically, or could be built by ourselves, depending on |
38 | # whether we like to pick up system libraries or want total control. |
39 | #mkdir -p %i/include %i/lib |
40 | mkdir -p %i/include %i/lib %i/bin |
41 | |
42 | %if "%online" != "true" |
43 | %define extradirs $ZLIB_ROOT $OPENSSL_ROOT $SQLITE_ROOT |
44 | %else |
45 | %define extradirs %{nil} |
46 | %endif |
47 | |
48 | dirs="$EXPAT_ROOT $BZ2LIB_ROOT $NCURSES_ROOT $DB4_ROOT $GDBM_ROOT %{extradirs}" |
49 | |
50 | echo $dirs |
51 | for d in $dirs; do |
52 | for f in $d/include/*; do |
53 | [ -e $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 | [ -e $f ] || continue |
59 | rm -f %i/lib/$(basename $f) |
60 | ln -s $f %i/lib |
61 | done |
62 | done |
63 | |
64 | additionalConfigureOptions="" |
65 | case %cmsplatf in |
66 | osx105* ) |
67 | additionalConfigureOptions="--disable-readline" |
68 | ;; |
69 | esac |
70 | |
71 | ./configure --prefix=%i $additionalConfigureOptions --enable-shared \ |
72 | --without-tkinter --disable-tkinter |
73 | |
74 | # The following is a kludge around the fact that the /usr/lib/libreadline.so |
75 | # symlink (for 32-bit lib) is missing on the 64bit machines |
76 | case %cmsplatf in |
77 | slc4_ia32* ) |
78 | mkdir -p %{i}/lib |
79 | ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so |
80 | ;; |
81 | esac |
82 | make %makeprocesses |
83 | |
84 | %install |
85 | make install |
86 | %define pythonv %(echo %realversion | cut -d. -f 1,2) |
87 | |
88 | case %cmsplatf in |
89 | osx*) |
90 | make install prefix=%i |
91 | (cd Misc; /bin/rm -rf RPM) |
92 | mkdir -p %i/share/doc/%n |
93 | cp -R Demo Doc %i/share/doc/%n |
94 | cp -R Misc Tools %i/lib/python%{pythonv} |
95 | gcc -dynamiclib -all_load -single_module \ |
96 | -framework System -framework CoreServices -framework Foundation \ |
97 | %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \ |
98 | -undefined dynamic_lookup \ |
99 | -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \ |
100 | -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \ |
101 | -current_version %{pythonv} -compatibility_version %{pythonv} -ldl |
102 | (cd %i/lib/python%{pythonv}/config |
103 | perl -p -i -e 's|-fno-common||g' Makefile) |
104 | |
105 | find %i/lib/python%{pythonv}/config -name 'libpython*' -exec mv -f {} %i/lib \; |
106 | ;; |
107 | esac |
108 | |
109 | perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \ |
110 | %{i}/bin/pydoc \ |
111 | %{i}/bin/python-config \ |
112 | %{i}/bin/2to3 \ |
113 | %{i}/bin/python2.6-config \ |
114 | %{i}/bin/smtpd.py \ |
115 | %{i}/lib/python2.6/bsddb/dbshelve.py \ |
116 | %{i}/lib/python2.6/test/test_bz2.py \ |
117 | %{i}/lib/python2.6/test/test_largefile.py \ |
118 | %{i}/lib/python2.6/test/test_optparse.py |
119 | rm `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'` |
120 | rm `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'` |
121 | |
122 | # remove tkinter that brings dependency on libtk: |
123 | find %{i}/lib -type f -name "_tkinter.so" -exec rm {} \; |
124 | |
125 | # SCRAM ToolBox toolfile |
126 | mkdir -p %i/etc/scram.d |
127 | cat << \EOF_TOOLFILE >%i/etc/scram.d/%n.xml |
128 | <tool name="%n" version="%v"> |
129 | <lib name="python2.6"/> |
130 | <client> |
131 | <environment name="PYTHON_BASE" default="%i"/> |
132 | <environment name="LIBDIR" default="$PYTHON_BASE/lib"/> |
133 | <environment name="INCLUDE" default="$PYTHON_BASE/include/python2.6"/> |
134 | <environment name="PYTHON_COMPILE" default="$PYTHON_BASE/lib/python2.6/compileall.py"/> |
135 | </client> |
136 | <runtime name="PATH" value="$PYTHON_BASE/bin" type="path"/> |
137 | <use name="sockets"/> |
138 | </tool> |
139 | EOF_TOOLFILE |
140 | |
141 | # Makes sure that executables start with /usr/bin/env perl and not with comments. |
142 | find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|^"""|#/usr/bin/env python\n"""|}' {} \; |
143 | find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|^\'\'\'|#/usr/bin/env python\n\'\'\'|}' {} \; |
144 | find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|/usr/local/bin/python|/usr/bin/env python|}' {} \; |
145 | rm -f %i/share/doc/python/Demo/rpc/test |
146 | |
147 | # Setups dependencies environment |
148 | rm -rf %i/etc/profile.d |
149 | mkdir -p %i/etc/profile.d |
150 | for x in %pkgreqs; do |
151 | case $x in /* ) continue ;; esac |
152 | p=%{instroot}/%{cmsplatf}/$(echo $x | sed 's/\([^+]*\)+\(.*\)+\([A-Z0-9].*\)/\1 \2 \3/' | tr ' ' '/') |
153 | echo ". $p/etc/profile.d/init.sh" >> %i/etc/profile.d/dependencies-setup.sh |
154 | echo "source $p/etc/profile.d/init.csh" >> %i/etc/profile.d/dependencies-setup.csh |
155 | done |
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.xml |
160 | %{relocateConfig}lib/python2.6/config/Makefile |
161 | |
162 | # Relocation for dependencies |
163 | %{relocateConfig}etc/profile.d/dependencies-setup.sh |
164 | %{relocateConfig}etc/profile.d/dependencies-setup.csh |
165 |