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.56 by andreasp, Sat Nov 7 07:56:36 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 + %define closingbrace )
6 + %define online %(case %cmsplatf in *onl_*_*%closingbrace echo true;; *%closingbrace echo flase;; esac)
7  
8   Requires: expat bz2lib db4 gdbm
9  
10 < %if "%cmsplatf" != "slc4onl_ia32_gcc346"
10 > %if "%online" != "true"
11   Requires: zlib openssl
12   %endif
13  
# Line 49 | Line 51 | perl -p -i -e "s|#!.*/usr/local/bin/pyth
51   # see above for the commented-out list of packages that could be
52   # linked specifically, or could be built by ourselves, depending on
53   # whether we like to pick up system libraries or want total control.
54 < #mkdir -p %i/include %i/lib
53 < mkdir -p %i/include %i/lib %i/bin
54 > mkdir -p %i/include %i/lib
55  
56 < %if "%cmsplatf" != "slc4onl_ia32_gcc346"
56 > %if "%online" != "true"
57   %define extradirs $ZLIB_ROOT $OPENSSL_ROOT
58   %else
59   %define extradirs %{nil}
# Line 86 | Line 87 | esac
87  
88   # The following is a kludge around the fact that the /usr/lib/libreadline.so
89   # symlink (for 32-bit lib) is missing on the 64bit machines
90 < case %cmsplatf in
91 <  slc4_ia32* )
92 <    mkdir -p %{i}/lib
93 <    ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
94 <  ;;
95 < esac
90 > %if "%cmsplatf" == "slc4_ia32_gcc345"
91 >  mkdir -p %{i}/lib
92 >  ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
93 > %endif
94 > %if "%cmsplatf" == "slc4_ia32_gcc412"
95 >  mkdir -p %{i}/lib
96 >  ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
97 > %endif
98   make %makeprocesses
99  
100   %install
101   make install
102   %define pythonv %(echo %realversion | cut -d. -f 1,2)
103  
104 < case %cmsplatf in
105 <  osx*)
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 <   (cd %i/lib/python%{pythonv}/config
119 <    perl -p -i -e 's|-fno-common||g' Makefile)
120 <
118 <   find %i/lib/python%{pythonv}/config -name 'libpython*' -exec mv {} %i/lib \;
119 <  ;;
120 < esac
104 > #if [ $(uname) = Darwin ]; then
105 >  # make install prefix=%i
106 >  # (cd Misc; /bin/rm -rf RPM)
107 >  # mkdir -p %i/share/doc/%n
108 >  # cp -R Demo Doc %i/share/doc/%n
109 >  # cp -R Misc Tools %i/lib/python%{pythonv}
110 > #  gcc -dynamiclib -all_load -single_module \
111 > #    -framework System -framework CoreServices -framework Foundation \
112 > #    %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \
113 > #    -undefined dynamic_lookup \
114 > #    -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
115 > #    -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
116 > #    -current_version %{pythonv} -compatibility_version %{pythonv} -ldl
117 > #  ln -s libpython%{pythonv}.dylib %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib # for boost
118 >  # (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig;
119 >  #  sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig)
120 > #fi
121  
122   perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
123                      %{i}/bin/pydoc \
124                    %{i}/bin/python-config \
125                    %{i}/bin/python2.6-config \
124                      %{i}/bin/smtpd.py \
125 <                    %{i}/lib/python2.6/bsddb/dbshelve.py \
126 <                    %{i}/lib/python2.6/test/test_bz2.py \
127 <                    %{i}/lib/python2.6/test/test_largefile.py \
128 <                    %{i}/lib/python2.6/test/test_optparse.py
125 >                    %{i}/lib/python2.4/bsddb/dbshelve.py \
126 >                    %{i}/lib/python2.4/test/test_bz2.py \
127 >                    %{i}/lib/python2.4/test/test_largefile.py \
128 >                    %{i}/lib/python2.4/test/test_optparse.py
129 > # boost.spec rfio.spec
130 > #
131 > #
132   rm  `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'`
133   rm  `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'`
134  
135 + %if "%online" == "true"
136   # remove tkinter that brings dependency on libtk:
137 < #
138 <
137 < rm  `find %{i}/lib -type f -name "_tkinter.so"`
137 > find %{i}/lib -type f -name "_tkinter.so" -exec rm {} \;
138 > %endif
139  
140   # SCRAM ToolBox toolfile
141   mkdir -p %i/etc/scram.d
142   cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
143   <doc type=BuildSystem::ToolDoc version=1.0>
144   <Tool name=%n version=%v>
145 < <lib name=python2.6>
145 > <lib name=python2.4>
146   <Client>
147   <Environment name=PYTHON_BASE default="%i"></Environment>
148   <Environment name=LIBDIR default="$PYTHON_BASE/lib"></Environment>
149 < <Environment name=INCLUDE default="$PYTHON_BASE/include/python2.6"></Environment>
150 < <Environment name=PYTHON_COMPILE default="$PYTHON_BASE/lib/python2.6/compileall.py"></Environment>
149 > <Environment name=INCLUDE default="$PYTHON_BASE/include/python2.4"></Environment>
150 > <Environment name=PYTHON_COMPILE default="$PYTHON_BASE/lib/python2.4/compileall.py"></Environment>
151   </Client>
152   <use name=sockets>
153 + <Runtime name=PYTHONHOME value="$PYTHON_BASE">
154   <Runtime name=PATH value="$PYTHON_BASE/bin" type=path>
155   </Tool>
156   EOF_TOOLFILE
157  
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
158   %post
159   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
160   %{relocateConfig}etc/scram.d/%n

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines