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.52 by elmer, Thu Sep 3 20:05:08 2009 UTC vs.
Revision 1.54 by diego, Tue Sep 22 11:32:46 2009 UTC

# Line 1 | Line 1
1 < ### RPM external python 2.4.2-CMS19
1 > ### RPM external python 2.6.2
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)
5  
6   Requires: expat bz2lib db4 gdbm
7  
8 < %if "%online" != "true"
8 > %if "%cmsplatf" != "slc4onl_ia32_gcc346"
9   Requires: zlib openssl
10   %endif
11  
# Line 51 | Line 49 | perl -p -i -e "s|#!.*/usr/local/bin/pyth
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
52 > #mkdir -p %i/include %i/lib
53 > mkdir -p %i/include %i/lib %i/bin
54  
55 < %if "%online" != "true"
55 > %if "%cmsplatf" != "slc4onl_ia32_gcc346"
56   %define extradirs $ZLIB_ROOT $OPENSSL_ROOT
57   %else
58   %define extradirs %{nil}
# Line 87 | Line 86 | esac
86  
87   # The following is a kludge around the fact that the /usr/lib/libreadline.so
88   # symlink (for 32-bit lib) is missing on the 64bit machines
89 < %if "%cmsplatf" == "slc4_ia32_gcc345"
90 <  mkdir -p %{i}/lib
91 <  ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
92 < %endif
93 < %if "%cmsplatf" == "slc4_ia32_gcc412"
94 <  mkdir -p %{i}/lib
96 <  ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
97 < %endif
89 > case %cmsplatf in
90 >  slc4_ia32* )
91 >    mkdir -p %{i}/lib
92 >    ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
93 >  ;;
94 > esac
95   make %makeprocesses
96  
97   %install
98   make install
99   %define pythonv %(echo %realversion | cut -d. -f 1,2)
100  
101 < #if [ $(uname) = Darwin ]; then
102 <  # make install prefix=%i
103 <  # (cd Misc; /bin/rm -rf RPM)
104 <  # mkdir -p %i/share/doc/%n
105 <  # cp -R Demo Doc %i/share/doc/%n
106 <  # cp -R Misc Tools %i/lib/python%{pythonv}
107 < #  gcc -dynamiclib -all_load -single_module \
108 < #    -framework System -framework CoreServices -framework Foundation \
109 < #    %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \
110 < #    -undefined dynamic_lookup \
111 < #    -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
112 < #    -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
113 < #    -current_version %{pythonv} -compatibility_version %{pythonv} -ldl
114 < #  ln -s libpython%{pythonv}.dylib %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib # for boost
115 <  # (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig;
116 <  #  sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig)
117 < #fi
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)
117 >
118 >   find %i/lib/python%{pythonv}/config -name 'libpython*' -exec mv {} %i/lib \;
119 >  ;;
120 > esac
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/2to3 \
126 +                    %{i}/bin/python2.6-config \
127                      %{i}/bin/smtpd.py \
128 <                    %{i}/lib/python2.4/bsddb/dbshelve.py \
129 <                    %{i}/lib/python2.4/test/test_bz2.py \
130 <                    %{i}/lib/python2.4/test/test_largefile.py \
131 <                    %{i}/lib/python2.4/test/test_optparse.py
129 < # boost.spec rfio.spec
130 < #
131 < #
128 >                    %{i}/lib/python2.6/bsddb/dbshelve.py \
129 >                    %{i}/lib/python2.6/test/test_bz2.py \
130 >                    %{i}/lib/python2.6/test/test_largefile.py \
131 >                    %{i}/lib/python2.6/test/test_optparse.py
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"
135   # remove tkinter that brings dependency on libtk:
136 + #
137 +
138   rm  `find %{i}/lib -type f -name "_tkinter.so"`
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.4>
145 > <lib name=python2.6>
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.4"></Environment>
150 < <Environment name=PYTHON_COMPILE default="$PYTHON_BASE/lib/python2.4/compileall.py"></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>
151   </Client>
152   <use name=sockets>
153 <Runtime name=PYTHONHOME value="$PYTHON_BASE">
153   <Runtime name=PATH value="$PYTHON_BASE/bin" type=path>
154   </Tool>
155   EOF_TOOLFILE
156  
157 + # Makes sure that executables start with /usr/bin/env perl and not with comments.
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/bin/env python\n\'\'\'|}' {} \;
160 + find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|/usr/local/bin/python|/usr/bin/env python|}' {} \;
161 + rm -f %i/share/doc/python/Demo/rpc/test
162 +
163   %post
164   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
165   %{relocateConfig}etc/scram.d/%n

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines