ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
Revision: 1.33
Committed: Tue Oct 9 04:46:40 2007 UTC (17 years, 6 months ago) by dlange
Branch: MAIN
CVS Tags: CMSSW_1_7_7, dl080227for176, CMSSW_1_7_5, CMSSW_1_7_5_g491, dl080111, ge20080109-webconddb, ge20080109-sitedb, CMSSW_1_7_4, CMSSW_1_7_3_g490p1, dl071212t2, dl071212, CMSSW_1_7_3, CMSSW_1_7_2, CMSSW_1_7_1, nr071120_fwlite170_1, CMSSW_1_7_0, CMSSW_1_7_0_pre13, dl071114, ap20071113, CMSSW_1_7_0_pre12, CMSSW_1_7_0_pre11, pe20071102b-ports, pe20071102a-ports, CMSSW_1_7_0_pre10, CMSSW_1_7_0_pre9, CMSSW_1_7_0_pre8, CMSSW_1_7_0_pre7, dl071028, dl071024, nr071023_fwlite170p6, pe20071023-170p6-amd64, pe20071021-170p6-zlib, dl071021t2, dl071021, pe20071021a-ports, dl071020, CMSSW_1_7_0_pre6, pe20071015-xrootd, pe20071014-ports, dl071014, dl071010t2, dl071010, dl071009t2, dl071009
Changes since 1.32: +1 -1 lines
Log Message:
round of pre6 changes

File Contents

# Content
1 ### RPM external python 2.4.2-CMS10
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
63
64 # Link 32-bit readline library missing in the system area on 64-bit
65 # machines:
66
67 mkdir -p %{i}/lib
68 ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
69
70 make %makeprocesses
71
72 %install
73 make install
74 %define pythonv %(echo %realversion | cut -d. -f 1,2)
75
76 #if [ $(uname) = Darwin ]; then
77 # make install prefix=%i
78 # (cd Misc; /bin/rm -rf RPM)
79 # mkdir -p %i/share/doc/%n
80 # cp -R Demo Doc %i/share/doc/%n
81 # cp -R Misc Tools %i/lib/python%{pythonv}
82 # gcc -dynamiclib -all_load -single_module \
83 # -framework System -framework CoreServices -framework Foundation \
84 # %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \
85 # -undefined dynamic_lookup \
86 # -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
87 # -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
88 # -current_version %{pythonv} -compatibility_version %{pythonv} -ldl
89 # ln -s libpython%{pythonv}.dylib %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib # for boost
90 # (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig;
91 # sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig)
92 #fi
93
94 perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
95 %{i}/bin/pydoc \
96 %{i}/bin/smtpd.py \
97 %{i}/lib/python2.4/bsddb/dbshelve.py \
98 %{i}/lib/python2.4/test/test_bz2.py \
99 %{i}/lib/python2.4/test/test_largefile.py \
100 %{i}/lib/python2.4/test/test_optparse.py
101 # boost.spec rfio.spec
102 #
103 #
104 rm `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'`
105 rm `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'`
106
107 # SCRAM ToolBox toolfile
108 mkdir -p %i/etc/scram.d
109 cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
110 <doc type=BuildSystem::ToolDoc version=1.0>
111 <Tool name=%n version=%v>
112 <lib name=python2.4>
113 <Client>
114 <Environment name=PYTHON_BASE default="%i"></Environment>
115 <Environment name=LIBDIR default="$PYTHON_BASE/lib"></Environment>
116 <Environment name=INCLUDE default="$PYTHON_BASE/include/python2.4"></Environment>
117 <Environment name=PYTHON_COMPILE default="$PYTHON_BASE/lib/python2.4/compileall.py"></Environment>
118 </Client>
119 <use name=sockets>
120 <Runtime name=PATH value="$PYTHON_BASE/bin" type=path>
121 </Tool>
122 EOF_TOOLFILE
123
124 %post
125 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
126 %{relocateConfig}etc/scram.d/%n