ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CMSDIST/python.spec
(Generate patch)

Comparing COMP/CMSDIST/python.spec (file contents):
Revision 1.49 by valya, Sun Jun 7 23:41:37 2009 UTC vs.
Revision 1.61 by diego, Mon Dec 14 18:39:57 2009 UTC

# Line 1 | Line 1
1 < ### RPM external python 2.6.2
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 <
5 > %define closingbrace )
6 > %define online %(case %cmsplatf in *onl_*_*%closingbrace echo true;; *%closingbrace echo flase;; esac)
7 > %define downloadv %(echo %realversion | cut -d"_" -f1)
8   Requires: expat bz2lib db4 gdbm
9 + Provides: libpython2.4.so.1.0
10  
11 < %if "%cmsplatf" != "slc4onl_ia32_gcc346"
11 > %if "%online" != "true"
12   Requires: zlib openssl
13   %endif
14  
15   # FIXME: readline, crypt
16   # FIXME: gmp, panel, tk/tcl, x11
17  
18 < Source0: http://www.python.org/ftp/%n/%realversion/Python-%realversion.tgz
18 > Source0: http://www.python.org/ftp/%n/%downloadv/Python-%downloadv.tgz
19   Patch0: python-Include-pyport.h
20   Patch1: python-Lib-plat-mac-applesingle.py
21   Patch2: python-Lib-site.py
# Line 23 | Line 26 | Patch6: python-setup.py
26  
27  
28   %prep
29 < %setup -n Python-%realversion
29 > %setup -n Python-%downloadv
30   #%patch0
31   #%patch1
32   #%patch2
# Line 49 | Line 52 | perl -p -i -e "s|#!.*/usr/local/bin/pyth
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 < #mkdir -p %i/include %i/lib
53 < mkdir -p %i/include %i/lib %i/bin
55 > mkdir -p %i/include %i/lib
56  
57 < %if "%cmsplatf" != "slc4onl_ia32_gcc346"
57 > %if "%online" != "true"
58   %define extradirs $ZLIB_ROOT $OPENSSL_ROOT
59   %else
60   %define extradirs %{nil}
# Line 86 | Line 88 | esac
88  
89   # 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 < case %cmsplatf in
92 <  slc4_ia32* )
93 <    mkdir -p %{i}/lib
94 <    ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
95 <  ;;
96 < esac
91 > %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   make %makeprocesses
100  
101   %install
102   make install
103 < %define pythonv %(echo %realversion | cut -d. -f 1,2)
100 <
101 < case %cmsplatf in
102 <  osx*)
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 <   (cd %i/lib/python%{pythonv}/config
116 <    perl -p -i -e 's|-fno-common||g' Makefile)
103 > %define pythonv %(echo %downloadv | cut -d. -f 1,2)
104  
105 <   find %i/lib/python%{pythonv}/config -name 'libpython*' -exec mv {} %i/lib \;
106 <  ;;
107 < esac
105 > #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  
123   perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
124                      %{i}/bin/pydoc \
124                    %{i}/bin/python-config \
125                    %{i}/bin/python2.6-config \
125                      %{i}/bin/smtpd.py \
126 <                    %{i}/lib/python2.6/bsddb/dbshelve.py \
127 <                    %{i}/lib/python2.6/test/test_bz2.py \
128 <                    %{i}/lib/python2.6/test/test_largefile.py \
129 <                    %{i}/lib/python2.6/test/test_optparse.py
126 >                    %{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   rm  `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'`
134   rm  `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'`
135  
136 + %if "%online" == "true"
137   # remove tkinter that brings dependency on libtk:
138 < #
139 <
137 < rm  `find %{i}/lib -type f -name "_tkinter.so"`
138 > find %{i}/lib -type f -name "_tkinter.so" -exec rm {} \;
139 > %endif
140  
141   # 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 < <Tool name=%n version=%v>
146 < <lib name=python2.6>
145 > <Tool name=%n version=%downloadv>
146 > <lib name=python2.4>
147   <Client>
148   <Environment name=PYTHON_BASE default="%i"></Environment>
149   <Environment name=LIBDIR default="$PYTHON_BASE/lib"></Environment>
150 < <Environment name=INCLUDE default="$PYTHON_BASE/include/python2.6"></Environment>
151 < <Environment name=PYTHON_COMPILE default="$PYTHON_BASE/lib/python2.6/compileall.py"></Environment>
150 > <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   </Client>
153   <use name=sockets>
154 + <Runtime name=PYTHONHOME value="$PYTHON_BASE">
155   <Runtime name=PATH value="$PYTHON_BASE/bin" type=path>
156   </Tool>
157   EOF_TOOLFILE
158  
156 # Makes sure that executables start with /usr/bin/env perl and not with comments.
157 find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|^"""|#/usr/bin/env python\n"""|}' {} \;
158 find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|^\'\'\'|#/usr/bin/env python\n\'\'\'|}' {} \;
159 find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|/usr/local/bin/python|/usr/bin/env python|}' {} \;
160 rm -f %i/share/doc/python/Demo/rpc/test
161
159   %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   %{relocateConfig}etc/scram.d/%n

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines