ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
Revision: 1.36
Committed: Sat Nov 3 00:57:16 2007 UTC (17 years, 5 months ago) by elmer
Branch: MAIN
CVS Tags: CMSSW_1_8_4, pe20080405-for184, CMSSW_1_8_3, pe20080326-for183, pe20080325-for183, CMSSW_1_8_2, pe20080324-for182, nr080320a, CMSSW_1_8_1, nr080314_181onl1, pe20080314-for181, CMSSW_1_8_0_ONLINE1, nr080310_180onl1, nr080307onl180onl1, CMSSW_1_8_0, pe20080304a-for180, pe20080303a-for18X, CMSSW_1_8_0_pre10, pe20080226-for180p10, pe20080220a-for18X, CMSSW_1_8_0_pre9, nr080215g491p01dbg, CMSSW_2_0_0_pre1, CMSSW_1_8_0_pre8, dl080202, pe20080126-for180p8, CMSSW_1_8_0_pre7, pe20080122a-for180p7, dl080120, pe20080120a-for180p7, pe20080117b-for180p7, pe20080117-for180p7, dl080115, CMSSW_1_8_0_pre6, NR080108_geant491-dbg-global, sm20080101a-newscram, pe20071226c-for180p6, pe20071226b-for180p6, pe20071226a-for180p6, pe20071220b-for180p6, pe20071220-for180p6, CMSSW_1_8_0_pre5, pe20071216-for180p5, CMSSW_1_8_0_pre4-vg330, ge20071212-perfreport, pe20071207-for180p4g491c3, NR071206_geant491cand3-global, pe20071206-for180test1, CMSSW_1_8_0_pre4-412, CMSSW_1_8_0_pre4, pe20071205b-for180p4-412, pe20071205b-for180p4, pe20071205-for180p4, CMSSW_1_8_0_pre3a-412, pe20071202-for180p3a-gcc412, CMSSW_1_8_0_pre3a, pe20071201b-for180p3a, pe20071201-for180p3a, pe20071130-for180p3, pe20071129-for180p3, ge20071127a-leopard, ge20071127-leopard, pe20071127a-ports-412, ge20071126-new-bootstrap, CMSSW_1_8_0_pre2, CMSSW_1_8_0_pre0-amd64, CMSSW_1_8_0_pre0, pe20071123e-ports-412, pe20071123d-ports-412, pe20071123c-ports-422, pe20071123c-ports-412, pe20071123c-ports, pe20071123b-ports-422, pe20071123b-ports-412, pe20071123b-ports, pe20071123a-ports-422, pe20071123a-ports-412, pe20071123a-ports, ge20071122-new-bootstrap, pe20071121a-ports-422, pe20071121a-ports-412, pe20071121a-ports, pe20071112c-ports-422, pe20071112c-ports-412, pe20071112c-ports, pe20071112b-ports-412, pe20071112b-ports, pe20071112a-ports, pe20071105c-ports, pe20071105b-ports, pe20071105a-ports, pe20071103e-ports, pe20071103d-ports, pe20071103c-ports, pe20071103b-ports, pe20071103a-ports
Changes since 1.35: +13 -2 lines
Log Message:
Update to -CMS18
Put back the readline workaround, which was lost in the online_release
  updates

File Contents

# Content
1 ### RPM external python 2.4.2-CMS18
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 "%{?online_release:set}" != "set"
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 "%{?online_release:set}" != "set"
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 ./configure --prefix=%i --enable-shared --without-tkinter --disable-tkinter
77 # The following is a kludge around the fact that the /usr/lib/libreadline.so
78 # symlink (for 32-bit lib) is missing on the 64bit machines
79 %if "%cmsplatf" == "slc4_ia32_gcc345"
80 mkdir -p %{i}/lib
81 ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
82 %endif
83 %if "%cmsplatf" == "slc4_ia32_gcc412"
84 mkdir -p %{i}/lib
85 ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
86 %endif
87 make %makeprocesses
88
89
90 %install
91 make install
92 %define pythonv %(echo %realversion | cut -d. -f 1,2)
93
94 #if [ $(uname) = Darwin ]; then
95 # make install prefix=%i
96 # (cd Misc; /bin/rm -rf RPM)
97 # mkdir -p %i/share/doc/%n
98 # cp -R Demo Doc %i/share/doc/%n
99 # cp -R Misc Tools %i/lib/python%{pythonv}
100 # gcc -dynamiclib -all_load -single_module \
101 # -framework System -framework CoreServices -framework Foundation \
102 # %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \
103 # -undefined dynamic_lookup \
104 # -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
105 # -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
106 # -current_version %{pythonv} -compatibility_version %{pythonv} -ldl
107 # ln -s libpython%{pythonv}.dylib %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib # for boost
108 # (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig;
109 # sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig)
110 #fi
111
112 perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
113 %{i}/bin/pydoc \
114 %{i}/bin/smtpd.py \
115 %{i}/lib/python2.4/bsddb/dbshelve.py \
116 %{i}/lib/python2.4/test/test_bz2.py \
117 %{i}/lib/python2.4/test/test_largefile.py \
118 %{i}/lib/python2.4/test/test_optparse.py
119 # boost.spec rfio.spec
120 #
121 #
122 rm `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'`
123 rm `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'`
124
125 # SCRAM ToolBox toolfile
126 mkdir -p %i/etc/scram.d
127 cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
128 <doc type=BuildSystem::ToolDoc version=1.0>
129 <Tool name=%n version=%v>
130 <lib name=python2.4>
131 <Client>
132 <Environment name=PYTHON_BASE default="%i"></Environment>
133 <Environment name=LIBDIR default="$PYTHON_BASE/lib"></Environment>
134 <Environment name=INCLUDE default="$PYTHON_BASE/include/python2.4"></Environment>
135 <Environment name=PYTHON_COMPILE default="$PYTHON_BASE/lib/python2.4/compileall.py"></Environment>
136 </Client>
137 <use name=sockets>
138 <Runtime name=PATH value="$PYTHON_BASE/bin" type=path>
139 </Tool>
140 EOF_TOOLFILE
141
142 %post
143 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
144 %{relocateConfig}etc/scram.d/%n