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.29 by eulisse, Wed Sep 19 21:13:25 2007 UTC vs.
Revision 1.45 by valya, Thu May 14 13:35:07 2009 UTC

# Line 1 | Line 1
1 < ### RPM external python 2.4.2-CMS8
1 > ### RPM external python 2.5.4
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 < Requires: zlib expat openssl bz2lib db4 gdbm
5 >
6 > Requires: expat bz2lib db4 gdbm
7 >
8 > %if "%cmsplatf" != "slc4onl_ia32_gcc346"
9 > Requires: zlib openssl
10 > %endif
11 > Provides: python2.5
12 >
13   # FIXME: readline, crypt
14   # FIXME: gmp, panel, tk/tcl, x11
15  
# Line 44 | Line 51 | perl -p -i -e "s|#!.*/usr/local/bin/pyth
51   # linked specifically, or could be built by ourselves, depending on
52   # whether we like to pick up system libraries or want total control.
53   mkdir -p %i/include %i/lib
54 < dirs="$ZLIB_ROOT $EXPAT_ROOT $OPENSSL_ROOT $BZ2LIB_ROOT $NCURSES_ROOT $DB4_ROOT $GDBM_ROOT"
54 >
55 > %if "%cmsplatf" != "slc4onl_ia32_gcc346"
56 > %define extradirs $ZLIB_ROOT $OPENSSL_ROOT
57 > %else
58 > %define extradirs %{nil}
59 > %endif
60 >
61 > dirs="$EXPAT_ROOT $BZ2LIB_ROOT $NCURSES_ROOT $DB4_ROOT $GDBM_ROOT %{extradirs}"
62 >
63   echo $dirs
64   for d in $dirs; do
65    for f in $d/include/*; do
# Line 59 | Line 74 | for d in $dirs; do
74    done
75   done
76  
77 < ./configure --prefix=%i --enable-shared --without-tkinter --disable-tkinter --without-readline
77 > additionalConfigureOptions=""
78 > case %cmsplatf in
79 >    osx105* )
80 >    additionalConfigureOptions="--disable-readline"
81 >    ;;
82 > esac
83 >
84 > ./configure --prefix=%i $additionalConfigureOptions --enable-shared \
85 >            --without-tkinter --disable-tkinter
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 > 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 \
# Line 91 | Line 126 | perl -p -i -e "s|^#!.*python|#!/usr/bin/
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
94 # boost.spec rfio.spec
95 #
96 #
129   rm  `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'`
130   rm  `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'`
131  
132 + # remove tkinter that brings dependency on libtk:
133 + #
134 +
135 + rm  `find %{i}/lib -type f -name "_tkinter.so"`
136 +
137   # SCRAM ToolBox toolfile
138   mkdir -p %i/etc/scram.d
139   cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
# Line 114 | Line 151 | cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
151   </Tool>
152   EOF_TOOLFILE
153  
154 + # Makes sure that executables start with /usr/bin/env perl and not with comments.
155 + find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|^"""|#/usr/bin/env python\n"""|}' {} \;
156 + find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|^\'\'\'|#/usr/bin/env python\n\'\'\'|}' {} \;
157 + find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|/usr/local/bin/python|/usr/bin/env python|}' {} \;
158 + rm -f %i/share/doc/python/Demo/rpc/test
159 +
160   %post
161   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
162   %{relocateConfig}etc/scram.d/%n

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines