Revision: | 1.42 |
Committed: | Fri Jun 6 23:25:42 2008 UTC (16 years, 10 months ago) by ratnik |
Branch: | MAIN |
CVS Tags: | MotT0_1_0_2, MotT0_1_0_1, MotT0_1_0_0, MotT0_100531_1, MotT0_100528_1, T0Mon_100518_1, T0Mon_100503_1, T0Mon_100316_1, T0Mon_100308_2, T0Mon_100308_1, T0Mon_100216_1, T0Mon_100210_1, T0Mon_100204_4, T0Mon_100204_3, T0Mon_100204_1, T0Mon_100127_1, DBS-APP_20100122_slc4, DBS-APP_20100121_slc4, DBS-WEB_20100120_slc4, DBS-APP_20100120_slc4, DBS-APP_20100118_slc4, DBS-WEB_20100118_slc4, DBS-APP_20100114_slc4, DBS-WEB_20100113_slc4, FILEMOVER_20091118, DBS-APPS_20090929, PRODAGENT_0_12_17_pre2, T0Mon_091111_1, DBS-WEB_20091021, PRODAGENT_0_12_17_pre1, PRODAGENT_0_12_16_patch2, PRODAGENT_0_12_16_patch1, forPHEDEX329, forPHEDEX328, sjg091014a, DBS-WEB_20091012, forPHEDEX327, PRODAGENT_0_12_16, sm090924a, DBS-WEB_20090921, forPHEDEX326, forPHEDEX325, forPHEDEX324, forPHEDEX323, forPHEDEX322, FILEMOVER_20090910, DBS-WEB_20090817, FILEMOVER_20090828, DBS-APPS_20090706, T0Mon_090828_1, forPHEDEX321, T0Mon_090822_1, forPHEDEX321pre3, WEBTOOLS_APPS_20090817, forPHEDEX321pre2, forPHEDEX321pre1, sm090807a, DBS-APPS_20090804, DBS-APPS_20090730, forPHEDEX320, T0Mon_090715_1, forPHEDEX320pre7, forPHEDEX320pre6, PRODAGENT_0_12_15_patch1, sm090703b, forPHEDEX320pre5, DBS-WEB_20090618, DBS-APPS_20090619, PRODAGENT_0_12_15, T0Mon_090612_1, DBS-APPS_20090608, T0Mon_090611_1, T0Mon_090610_1, forPHEDEX320pre4, DBS-APPS_20090604_1, DBS-APPS_20090604, DBS-APPS_20090603, forPHEDEX320pre3, T0Mon_090601_1, DBS-APPS_20090528, T0Mon_090527_2, T0Mon_090527_1, T0Mon_090522_1, T0Mon_090519_2, T0Mon_090519_1, DBS_APPS_20090518, T0Mon_090517_1, T0Mon_090516_1, T0Mon_090515_4, T0Mon_090515_3, T0Mon_090515_2, T0Mon_090515_1, DAS_20090514, DBS-WEB_20090512, forPHEDEX320pre1, T0Mon_090510_1, DBS-WEB_20090507, PRODAGENT_0_12_14-dbs206p5-090507, PRODAGENT_0_12_15_pre2-090507, PRODAGENT_0_12_15_pre2, sm090506c, PRODAGENT_0_12_14-dbs206p5, sm090506b, sm090506a, DBS_APPS_20090504, DBS_APPS_20090501, DBS-APPS_20090429_2, DBS-WEB_20090429, DBS-APPS_20090429, DBS-WEB_20090428, DBS-WEB_20090422, DBS-WEB_20090420, DBS-APPS_20090417, DBS-APPS_20090415, PRODAGENT_0_12_13_patch5_DBS206a, PRODAGENT_0_12_14, DBS-APPS_20090410, PRODAGENT_0_12_13_patch5_DBS206, DAS_20090408, sm090408a, DBS-APPS_20090406, T0Mon_090406_1, DAS_20090330, DBS-APPS_20090326, T0Mon_090326_1, T0Mon_090325_1, DAS_20090319_1, CMSSW_2_2_6_HLT_ONLINE1, nr090319_for226hltonl1, DBS-APPS_20090318, CMSSW_2_2_6_HLT_ONLINE, T0Mon_090318_1, DBS-APPS_20090316, T0Mon_090315_1, COUCHDB_20090313, CMSSW_2_2_6_onlpatch1_ONLINE, CMSSW_2_2_6_ONLINE, DBS-APPS_20090310, WEBTOOLS-APPS_20090310_1, WEBTOOLS-APPS_20090310, WEBTOOLS-APPS_20090309, nr090307for226_onlpatch1, DBS-APPS_20090306, nr090306onl226_tkonlsw_too_new, DBS-APPS_20090304_1, DBS-APPS_20090304, pe20090304b-30Xports-432, pe20090304a-30Xports-432, DBS-APPS_20090303_1, DBS-APPS_20090303, T0Mon_090303_1, DBS-APPS_20090302, pe20090226b-30Xports-432, pe20090226a-30Xports-432, PRODAGENT_0_12_13_patch1_V2_20090220, PRODAGENT_0_12_13_patch2_V1_20090224, pe20090224b-30Xports-432, pe20090224a-30Xports-432, DBS-APPS_20090220_1, DBS-APPS_20090220, T0M_0_0_5, PRODAGENT_0_12_13_patch1_V1_20090220, PRODAGENT_0_12_13_V1_20090220, MEMCACHED_20090219_1, MEMCACHED_20090219, PRODAGENT_0_12_12_V1_20090219, pe20090218a-30Xports-432, WEBTOOLS-APPS_20090217_1, WEBTOOLS-APPS_20090217, WEBTOOLS-APPS_20090216, pe20090216b-30Xports-432, pe20090216a-30Xports-432, WEBTOOLS-APPS_20090212, WEBTOOLS-APPS_20090209_64bit, zx20090209, WEBTOOLS-APPS_20090206, T0M_0_0_4, T0M_0_0_3, PRODAGENT_0_12_12_PRE1_INT1_TEST1_20090204, WEBTOOLS-APPS_20090203_1, WEBTOOLS-APPS_20090203, T0M_0_0_2, zx20090201, WEBTOOLS-APPS_20090130, WEBTOOLS-APPS_20090129, PRODAGENT_0_12_10_pre3, pe20090127c-30Xports-432, pe20090127b-30Xports-432, PRODAGENT_0_12_10_pre2_20090127_V2, pe20090127a-30Xports-432, pe20090125a-30Xports-432, PRODAGENT_0_12_10_20090122, PRODAGENT_0_12_10_pre1_MISC, sw_20090115a, sw_20090115, pe20090114c-ports, pe20090114b-ports, pe20090114a-ports, pe20081213c-30Xports-432, pe20081213c-30Xports, pe20081213b-30Xports, pe20081213a-30Xports, testofc, T0Mon_081107_1, T0Mon_081105_1, PRODAGENT_0_12_2, CMSSW_2_1_9_ONLINE, T0Mon_080926_1, T0Mon_080920_2, T0Mon_080920_1, T0Mon_080916_2, T0Mon_080905_1, T0Mon_080905_01, T0Mon_080902_2, T0Mon_080902_1, T0Mon_080824_1, T0Mon_080823_1, CMSSW_2_1_4_ONLINE1, buildset_V2_8, CMSSW_2_1_1_ONLINE1, CMSSW_2_1_0_ONLINE1, nr080806_for210onl, CMSSW_2_0_10_ONLINE1, nr080714_forCRAB, nr080624_for21x, nr080623_for21x, CMSSW_2_0_8_ONLINE1-cms2 |
Changes since 1.41: | +5 -0 lines |
Log Message: | Work around unwanted dependency on tk |
# | 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 | |
6 | Requires: expat bz2lib db4 gdbm |
7 | |
8 | %if "%cmsplatf" != "slc4onl_ia32_gcc346" |
9 | Requires: zlib openssl |
10 | %endif |
11 | |
12 | # FIXME: readline, crypt |
13 | # FIXME: gmp, panel, tk/tcl, x11 |
14 | |
15 | Source0: http://www.python.org/ftp/%n/%realversion/Python-%realversion.tgz |
16 | Patch0: python-Include-pyport.h |
17 | Patch1: python-Lib-plat-mac-applesingle.py |
18 | Patch2: python-Lib-site.py |
19 | Patch3: python-Mac-OSX-Makefile |
20 | Patch4: python-Makefile.pre.in |
21 | Patch5: python-configure |
22 | Patch6: python-setup.py |
23 | |
24 | |
25 | %prep |
26 | %setup -n Python-%realversion |
27 | #%patch0 |
28 | #%patch1 |
29 | #%patch2 |
30 | #%patch3 |
31 | #%patch4 |
32 | #%patch5 |
33 | #%patch6 |
34 | perl -p -i -e "s|#!.*/usr/local/bin/python|#!/usr/bin/env python|" Lib/cgi.py |
35 | |
36 | %ifos darwin |
37 | sed 's|@PREFIX@|%i|g' < %_sourcedir/python-osx | patch -p1 |
38 | %endif |
39 | |
40 | %build |
41 | # Python is awkward about passing other include or library directories |
42 | # to it. Basically there is no way to pass anything from configure to |
43 | # make, or down to python itself. To get python detect the extensions |
44 | # we want to enable, we simply have to link the contents into python's |
45 | # own include/lib directories. Ugh. |
46 | # |
47 | # NB: It would sort-of make sense to link more stuff from /sw on OS X, |
48 | # but we simply cannot link the whole world. If you need something, |
49 | # see above for the commented-out list of packages that could be |
50 | # linked specifically, or could be built by ourselves, depending on |
51 | # whether we like to pick up system libraries or want total control. |
52 | mkdir -p %i/include %i/lib |
53 | |
54 | %if "%cmsplatf" != "slc4onl_ia32_gcc346" |
55 | %define extradirs $ZLIB_ROOT $OPENSSL_ROOT |
56 | %else |
57 | %define extradirs %{nil} |
58 | %endif |
59 | |
60 | dirs="$EXPAT_ROOT $BZ2LIB_ROOT $NCURSES_ROOT $DB4_ROOT $GDBM_ROOT %{extradirs}" |
61 | |
62 | echo $dirs |
63 | for d in $dirs; do |
64 | for f in $d/include/*; do |
65 | [ -e $f ] || continue |
66 | rm -f %i/include/$(basename $f) |
67 | ln -s $f %i/include |
68 | done |
69 | for f in $d/lib/*; do |
70 | [ -e $f ] || continue |
71 | rm -f %i/lib/$(basename $f) |
72 | ln -s $f %i/lib |
73 | done |
74 | done |
75 | |
76 | additionalConfigureOptions="" |
77 | case %cmsplatf in |
78 | osx105* ) |
79 | additionalConfigureOptions="--disable-readline" |
80 | ;; |
81 | esac |
82 | |
83 | ./configure --prefix=%i $additionalConfigureOptions --enable-shared \ |
84 | --without-tkinter --disable-tkinter |
85 | |
86 | # The following is a kludge around the fact that the /usr/lib/libreadline.so |
87 | # symlink (for 32-bit lib) is missing on the 64bit machines |
88 | %if "%cmsplatf" == "slc4_ia32_gcc345" |
89 | mkdir -p %{i}/lib |
90 | ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so |
91 | %endif |
92 | %if "%cmsplatf" == "slc4_ia32_gcc412" |
93 | mkdir -p %{i}/lib |
94 | ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so |
95 | %endif |
96 | make %makeprocesses |
97 | |
98 | %install |
99 | make install |
100 | %define pythonv %(echo %realversion | cut -d. -f 1,2) |
101 | |
102 | #if [ $(uname) = Darwin ]; then |
103 | # make install prefix=%i |
104 | # (cd Misc; /bin/rm -rf RPM) |
105 | # mkdir -p %i/share/doc/%n |
106 | # cp -R Demo Doc %i/share/doc/%n |
107 | # cp -R Misc Tools %i/lib/python%{pythonv} |
108 | # gcc -dynamiclib -all_load -single_module \ |
109 | # -framework System -framework CoreServices -framework Foundation \ |
110 | # %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \ |
111 | # -undefined dynamic_lookup \ |
112 | # -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \ |
113 | # -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \ |
114 | # -current_version %{pythonv} -compatibility_version %{pythonv} -ldl |
115 | # ln -s libpython%{pythonv}.dylib %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib # for boost |
116 | # (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig; |
117 | # sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig) |
118 | #fi |
119 | |
120 | perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \ |
121 | %{i}/bin/pydoc \ |
122 | %{i}/bin/smtpd.py \ |
123 | %{i}/lib/python2.4/bsddb/dbshelve.py \ |
124 | %{i}/lib/python2.4/test/test_bz2.py \ |
125 | %{i}/lib/python2.4/test/test_largefile.py \ |
126 | %{i}/lib/python2.4/test/test_optparse.py |
127 | # boost.spec rfio.spec |
128 | # |
129 | # |
130 | rm `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'` |
131 | rm `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'` |
132 | |
133 | # remove tkinter that brings dependency on libtk: |
134 | # |
135 | |
136 | rm `find %{i}/lib -type f -name "_tkinter.so"` |
137 | |
138 | # SCRAM ToolBox toolfile |
139 | mkdir -p %i/etc/scram.d |
140 | cat << \EOF_TOOLFILE >%i/etc/scram.d/%n |
141 | <doc type=BuildSystem::ToolDoc version=1.0> |
142 | <Tool name=%n version=%v> |
143 | <lib name=python2.4> |
144 | <Client> |
145 | <Environment name=PYTHON_BASE default="%i"></Environment> |
146 | <Environment name=LIBDIR default="$PYTHON_BASE/lib"></Environment> |
147 | <Environment name=INCLUDE default="$PYTHON_BASE/include/python2.4"></Environment> |
148 | <Environment name=PYTHON_COMPILE default="$PYTHON_BASE/lib/python2.4/compileall.py"></Environment> |
149 | </Client> |
150 | <use name=sockets> |
151 | <Runtime name=PATH value="$PYTHON_BASE/bin" type=path> |
152 | </Tool> |
153 | EOF_TOOLFILE |
154 | |
155 | %post |
156 | 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 |
157 | %{relocateConfig}etc/scram.d/%n |