ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
Revision: 1.61
Committed: Mon Dec 14 18:39:57 2009 UTC (15 years, 4 months ago) by diego
Branch: MAIN
CVS Tags: FRONTEND_CONF_3_30_20100724, FRONTEND_CONF_3_29_20100723, dg20100416-prodagent, dg20100326-prodagent, CRABSERVER_1_1_1_pre9_BUILD_SLC5rev3py24, FRONTEND_CONF_3_24_20100217, T0Mon_100204_2, CRABSERVER_1_1_1_pre5_BUILD_SLC5, dg20100125-prodagent, CRABSERVER_1_1_1_pre4_BUILD_SLC5, CRABSERVER_1_1_1_pre3_BUILD_SLC5_1, CRABSERVER_1_1_1_pre3_BUILD_SLC5, CRABSERVER_1_1_1_pre3_BUILD_OK, CS_1_1_1_test1_BUILD, CS_1_1_1_slc5_BUILD, ds20100115_cs_SLC5_workOK, dg20100106b-prodagent, dg20100106-prodagent, CRABSERVER_CS_SLC5_test_3_BUILD, dg20091218c-crabserver, dg20091215c-crabserver, dg20091218b-crabserver, dg20091218-crabserver, dg20091215b-crabserver
Changes since 1.60: +1 -0 lines
Log Message:
Now provides libpython2.4.so.1.0 for slc5 builds

File Contents

# User Rev Content
1 diego 1.60 ### RPM external python 2.4.2_CMS19
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 elmer 1.55 %define closingbrace )
6 diego 1.60 %define online %(case %cmsplatf in *onl_*_*%closingbrace echo true;; *%closingbrace echo flase;; esac)
7     %define downloadv %(echo %realversion | cut -d"_" -f1)
8 ratnik 1.34 Requires: expat bz2lib db4 gdbm
9 diego 1.61 Provides: libpython2.4.so.1.0
10 ratnik 1.34
11 elmer 1.55 %if "%online" != "true"
12 diego 1.60 Requires: zlib openssl
13 ratnik 1.34 %endif
14    
15 eulisse 1.8 # FIXME: readline, crypt
16 argiro 1.1 # FIXME: gmp, panel, tk/tcl, x11
17    
18 diego 1.60 Source0: http://www.python.org/ftp/%n/%downloadv/Python-%downloadv.tgz
19 elmer 1.13 Patch0: python-Include-pyport.h
20     Patch1: python-Lib-plat-mac-applesingle.py
21     Patch2: python-Lib-site.py
22     Patch3: python-Mac-OSX-Makefile
23     Patch4: python-Makefile.pre.in
24     Patch5: python-configure
25     Patch6: python-setup.py
26 argiro 1.1
27 steen 1.19
28 argiro 1.1 %prep
29 diego 1.60 %setup -n Python-%downloadv
30 elmer 1.13 #%patch0
31     #%patch1
32     #%patch2
33     #%patch3
34     #%patch4
35     #%patch5
36     #%patch6
37 eulisse 1.5 perl -p -i -e "s|#!.*/usr/local/bin/python|#!/usr/bin/env python|" Lib/cgi.py
38    
39 valya 1.48 %ifos darwin
40 argiro 1.1 sed 's|@PREFIX@|%i|g' < %_sourcedir/python-osx | patch -p1
41     %endif
42    
43     %build
44     # Python is awkward about passing other include or library directories
45     # to it. Basically there is no way to pass anything from configure to
46     # make, or down to python itself. To get python detect the extensions
47     # we want to enable, we simply have to link the contents into python's
48     # own include/lib directories. Ugh.
49     #
50     # NB: It would sort-of make sense to link more stuff from /sw on OS X,
51     # but we simply cannot link the whole world. If you need something,
52     # see above for the commented-out list of packages that could be
53     # linked specifically, or could be built by ourselves, depending on
54     # whether we like to pick up system libraries or want total control.
55 diego 1.60 mkdir -p %i/include %i/lib
56 ratnik 1.34
57 elmer 1.55 %if "%online" != "true"
58 diego 1.60 %define extradirs $ZLIB_ROOT $OPENSSL_ROOT
59 ratnik 1.34 %else
60     %define extradirs %{nil}
61     %endif
62    
63     dirs="$EXPAT_ROOT $BZ2LIB_ROOT $NCURSES_ROOT $DB4_ROOT $GDBM_ROOT %{extradirs}"
64    
65 eulisse 1.16 echo $dirs
66 argiro 1.1 for d in $dirs; do
67     for f in $d/include/*; do
68 eulisse 1.29 [ -e $f ] || continue
69 argiro 1.1 rm -f %i/include/$(basename $f)
70     ln -s $f %i/include
71     done
72     for f in $d/lib/*; do
73 eulisse 1.29 [ -e $f ] || continue
74 argiro 1.1 rm -f %i/lib/$(basename $f)
75     ln -s $f %i/lib
76     done
77     done
78    
79 eulisse 1.39 additionalConfigureOptions=""
80     case %cmsplatf in
81     osx105* )
82     additionalConfigureOptions="--disable-readline"
83     ;;
84     esac
85    
86     ./configure --prefix=%i $additionalConfigureOptions --enable-shared \
87     --without-tkinter --disable-tkinter
88    
89 ratnik 1.38 # The following is a kludge around the fact that the /usr/lib/libreadline.so
90     # symlink (for 32-bit lib) is missing on the 64bit machines
91 diego 1.60 %if "%cmsplatf" == "slc4_ia32_gcc345"
92     mkdir -p %{i}/lib
93     ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
94     %endif
95     %if "%cmsplatf" == "slc4_ia32_gcc412"
96     mkdir -p %{i}/lib
97     ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
98     %endif
99 ratnik 1.38 make %makeprocesses
100 ratnik 1.37
101 argiro 1.1 %install
102     make install
103 diego 1.60 %define pythonv %(echo %downloadv | cut -d. -f 1,2)
104 eulisse 1.8
105 diego 1.60 #if [ $(uname) = Darwin ]; then
106     # make install prefix=%i
107     # (cd Misc; /bin/rm -rf RPM)
108     # mkdir -p %i/share/doc/%n
109     # cp -R Demo Doc %i/share/doc/%n
110     # cp -R Misc Tools %i/lib/python%{pythonv}
111     # gcc -dynamiclib -all_load -single_module \
112     # -framework System -framework CoreServices -framework Foundation \
113     # %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \
114     # -undefined dynamic_lookup \
115     # -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
116     # -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
117     # -current_version %{pythonv} -compatibility_version %{pythonv} -ldl
118     # ln -s libpython%{pythonv}.dylib %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib # for boost
119     # (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig;
120     # sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig)
121     #fi
122 eulisse 1.9
123     perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
124     %{i}/bin/pydoc \
125     %{i}/bin/smtpd.py \
126 diego 1.60 %{i}/lib/python2.4/bsddb/dbshelve.py \
127     %{i}/lib/python2.4/test/test_bz2.py \
128     %{i}/lib/python2.4/test/test_largefile.py \
129     %{i}/lib/python2.4/test/test_optparse.py
130     # boost.spec rfio.spec
131     #
132     #
133 eulisse 1.17 rm `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'`
134 eulisse 1.18 rm `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'`
135 muzaffar 1.28
136 elmer 1.55 %if "%online" == "true"
137 valya 1.48 # remove tkinter that brings dependency on libtk:
138 elmer 1.58 find %{i}/lib -type f -name "_tkinter.so" -exec rm {} \;
139 elmer 1.55 %endif
140 valya 1.48
141 muzaffar 1.28 # SCRAM ToolBox toolfile
142     mkdir -p %i/etc/scram.d
143     cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
144     <doc type=BuildSystem::ToolDoc version=1.0>
145 diego 1.60 <Tool name=%n version=%downloadv>
146     <lib name=python2.4>
147 muzaffar 1.28 <Client>
148     <Environment name=PYTHON_BASE default="%i"></Environment>
149     <Environment name=LIBDIR default="$PYTHON_BASE/lib"></Environment>
150 diego 1.60 <Environment name=INCLUDE default="$PYTHON_BASE/include/python2.4"></Environment>
151     <Environment name=PYTHON_COMPILE default="$PYTHON_BASE/lib/python2.4/compileall.py"></Environment>
152 muzaffar 1.28 </Client>
153     <use name=sockets>
154 diego 1.60 <Runtime name=PYTHONHOME value="$PYTHON_BASE">
155 muzaffar 1.28 <Runtime name=PATH value="$PYTHON_BASE/bin" type=path>
156     </Tool>
157     EOF_TOOLFILE
158    
159 eulisse 1.16 %post
160     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
161 muzaffar 1.28 %{relocateConfig}etc/scram.d/%n