ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
Revision: 1.37
Committed: Mon Nov 5 20:09:34 2007 UTC (17 years, 5 months ago) by ratnik
Branch: MAIN
CVS Tags: CMSSW_1_7_5_ONLINE1, CMSSW_1_7_5_ONLINE, nr080115onl175, nr071121onl170_xdaq5, CMSSW_1_7_0_ONLINE, nr071116onlpre13, CMSSW_1_7_0_pre10_ONLINE, nr071105a
Changes since 1.36: +9 -13 lines
Log Message:
Merge in checnges for online release with modification between pre5 and pre10 (readline fix), for onine build based on CMSSW_1_7_0_pre10

File Contents

# User Rev Content
1 ratnik 1.37 ### RPM external python 2.4.2-CMS10
2 eulisse 1.3 ## INITENV +PATH PATH %i/bin
3     ## INITENV +PATH LD_LIBRARY_PATH %i/lib
4 argiro 1.1 # OS X patches and build fudging stolen from fink
5 ratnik 1.34
6     Requires: expat bz2lib db4 gdbm
7    
8     %if "%{?online_release:set}" != "set"
9     Requires: zlib openssl
10     %endif
11    
12 eulisse 1.8 # FIXME: readline, crypt
13 argiro 1.1 # FIXME: gmp, panel, tk/tcl, x11
14    
15 elmer 1.24 Source0: http://www.python.org/ftp/%n/%realversion/Python-%realversion.tgz
16 elmer 1.13 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 argiro 1.1
24 steen 1.19
25 argiro 1.1 %prep
26 elmer 1.24 %setup -n Python-%realversion
27 elmer 1.13 #%patch0
28     #%patch1
29     #%patch2
30     #%patch3
31     #%patch4
32     #%patch5
33     #%patch6
34 eulisse 1.5 perl -p -i -e "s|#!.*/usr/local/bin/python|#!/usr/bin/env python|" Lib/cgi.py
35    
36 argiro 1.1 %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 ratnik 1.34
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 eulisse 1.16 echo $dirs
63 argiro 1.1 for d in $dirs; do
64     for f in $d/include/*; do
65 eulisse 1.29 [ -e $f ] || continue
66 argiro 1.1 rm -f %i/include/$(basename $f)
67     ln -s $f %i/include
68     done
69     for f in $d/lib/*; do
70 eulisse 1.29 [ -e $f ] || continue
71 argiro 1.1 rm -f %i/lib/$(basename $f)
72     ln -s $f %i/lib
73     done
74     done
75    
76 ratnik 1.37 ./configure --prefix=%i --enable-shared --without-tkinter --disable-tkinter
77    
78     # Link 32-bit readline library missing in the system area on 64-bit
79     # machines:
80    
81     mkdir -p %{i}/lib
82     ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
83    
84 eulisse 1.3 make %makeprocesses
85 argiro 1.1
86     %install
87     make install
88 elmer 1.24 %define pythonv %(echo %realversion | cut -d. -f 1,2)
89 eulisse 1.8
90 elmer 1.13 #if [ $(uname) = Darwin ]; then
91 argiro 1.1 # make install prefix=%i
92     # (cd Misc; /bin/rm -rf RPM)
93     # mkdir -p %i/share/doc/%n
94     # cp -R Demo Doc %i/share/doc/%n
95 eulisse 1.8 # cp -R Misc Tools %i/lib/python%{pythonv}
96 elmer 1.13 # gcc -dynamiclib -all_load -single_module \
97     # -framework System -framework CoreServices -framework Foundation \
98     # %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \
99     # -undefined dynamic_lookup \
100     # -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
101     # -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
102     # -current_version %{pythonv} -compatibility_version %{pythonv} -ldl
103     # ln -s libpython%{pythonv}.dylib %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib # for boost
104 eulisse 1.8 # (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig;
105 argiro 1.1 # sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig)
106 elmer 1.13 #fi
107 eulisse 1.9
108     perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
109     %{i}/bin/pydoc \
110     %{i}/bin/smtpd.py \
111     %{i}/lib/python2.4/bsddb/dbshelve.py \
112     %{i}/lib/python2.4/test/test_bz2.py \
113     %{i}/lib/python2.4/test/test_largefile.py \
114     %{i}/lib/python2.4/test/test_optparse.py
115 eulisse 1.14 # boost.spec rfio.spec
116 eulisse 1.15 #
117     #
118 eulisse 1.17 rm `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'`
119 eulisse 1.18 rm `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'`
120 muzaffar 1.28
121     # SCRAM ToolBox toolfile
122     mkdir -p %i/etc/scram.d
123     cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
124     <doc type=BuildSystem::ToolDoc version=1.0>
125     <Tool name=%n version=%v>
126     <lib name=python2.4>
127     <Client>
128     <Environment name=PYTHON_BASE default="%i"></Environment>
129     <Environment name=LIBDIR default="$PYTHON_BASE/lib"></Environment>
130     <Environment name=INCLUDE default="$PYTHON_BASE/include/python2.4"></Environment>
131     <Environment name=PYTHON_COMPILE default="$PYTHON_BASE/lib/python2.4/compileall.py"></Environment>
132     </Client>
133     <use name=sockets>
134     <Runtime name=PATH value="$PYTHON_BASE/bin" type=path>
135     </Tool>
136     EOF_TOOLFILE
137    
138 eulisse 1.16 %post
139     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
140 muzaffar 1.28 %{relocateConfig}etc/scram.d/%n