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.37 by ratnik, Mon Nov 5 20:09:34 2007 UTC vs.
Revision 1.55 by elmer, Tue Nov 3 15:04:08 2009 UTC

# Line 1 | Line 1
1 < ### RPM external python 2.4.2-CMS10
1 > ### RPM external python 2.6.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 + %define closingbrace )
6 + %define online %(case %cmsplatf in *onl_*_*%closingbrace echo true;; *%closingbrace echo false;; esac)
7  
8   Requires: expat bz2lib db4 gdbm
9  
10 < %if "%{?online_release:set}" != "set"
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
54 > #mkdir -p %i/include %i/lib
55 > mkdir -p %i/include %i/lib %i/bin
56  
57 < %if "%{?online_release:set}" != "set"
57 > %if "%online" != "true"
58   %define extradirs $ZLIB_ROOT $OPENSSL_ROOT
59   %else
60   %define extradirs %{nil}
# Line 73 | Line 76 | for d in $dirs; do
76    done
77   done
78  
79 < ./configure --prefix=%i --enable-shared --without-tkinter --disable-tkinter
80 <
81 < # Link 32-bit readline library missing in the system area on 64-bit
82 < # machines:
83 <
84 < mkdir -p %{i}/lib
85 < ln -s /usr/lib/libreadline.so.4.3 %{i}/lib/libreadline.so
86 <
79 > 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 > # 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
97   make %makeprocesses
98  
99   %install
100   make install
101   %define pythonv %(echo %realversion | cut -d. -f 1,2)
102  
103 < #if [ $(uname) = Darwin ]; then
104 <  # make install prefix=%i
105 <  # (cd Misc; /bin/rm -rf RPM)
106 <  # mkdir -p %i/share/doc/%n
107 <  # cp -R Demo Doc %i/share/doc/%n
108 <  # cp -R Misc Tools %i/lib/python%{pythonv}
109 < #  gcc -dynamiclib -all_load -single_module \
110 < #    -framework System -framework CoreServices -framework Foundation \
111 < #    %i/lib/python%{pythonv}/config/libpython%{pythonv}.a \
112 < #    -undefined dynamic_lookup \
113 < #    -o %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
114 < #    -install_name %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib \
115 < #    -current_version %{pythonv} -compatibility_version %{pythonv} -ldl
116 < #  ln -s libpython%{pythonv}.dylib %i/lib/python%{pythonv}/config/libpython%{pythonv}.dylib # for boost
117 <  # (cd %i/lib/python%{pythonv}/config; mv Makefile Makefile.orig;
118 <  #  sed 's|-fno-common||g' < Makefile.orig > Makefile; /bin/rm -f Makefile.orig)
119 < #fi
103 > case %cmsplatf in
104 >  osx*)
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 >   (cd %i/lib/python%{pythonv}/config
118 >    perl -p -i -e 's|-fno-common||g' Makefile)
119 >
120 >   find %i/lib/python%{pythonv}/config -name 'libpython*' -exec mv {} %i/lib \;
121 >  ;;
122 > esac
123  
124   perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
125                      %{i}/bin/pydoc \
126 +                    %{i}/bin/python-config \
127 +                    %{i}/bin/2to3 \
128 +                    %{i}/bin/python2.6-config \
129                      %{i}/bin/smtpd.py \
130 <                    %{i}/lib/python2.4/bsddb/dbshelve.py \
131 <                    %{i}/lib/python2.4/test/test_bz2.py \
132 <                    %{i}/lib/python2.4/test/test_largefile.py \
133 <                    %{i}/lib/python2.4/test/test_optparse.py
115 < # boost.spec rfio.spec
116 < #
117 < #
130 >                    %{i}/lib/python2.6/bsddb/dbshelve.py \
131 >                    %{i}/lib/python2.6/test/test_bz2.py \
132 >                    %{i}/lib/python2.6/test/test_largefile.py \
133 >                    %{i}/lib/python2.6/test/test_optparse.py
134   rm  `find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*'`
135   rm  `find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*'`
136  
137 + %if "%online" == "true"
138 + # remove tkinter that brings dependency on libtk:
139 + rm  `find %{i}/lib -type f -name "_tkinter.so"`
140 + %endif
141 +
142   # SCRAM ToolBox toolfile
143   mkdir -p %i/etc/scram.d
144   cat << \EOF_TOOLFILE >%i/etc/scram.d/%n
145   <doc type=BuildSystem::ToolDoc version=1.0>
146   <Tool name=%n version=%v>
147 < <lib name=python2.4>
147 > <lib name=python2.6>
148   <Client>
149   <Environment name=PYTHON_BASE default="%i"></Environment>
150   <Environment name=LIBDIR default="$PYTHON_BASE/lib"></Environment>
151 < <Environment name=INCLUDE default="$PYTHON_BASE/include/python2.4"></Environment>
152 < <Environment name=PYTHON_COMPILE default="$PYTHON_BASE/lib/python2.4/compileall.py"></Environment>
151 > <Environment name=INCLUDE default="$PYTHON_BASE/include/python2.6"></Environment>
152 > <Environment name=PYTHON_COMPILE default="$PYTHON_BASE/lib/python2.6/compileall.py"></Environment>
153   </Client>
154   <use name=sockets>
155   <Runtime name=PATH value="$PYTHON_BASE/bin" type=path>
156   </Tool>
157   EOF_TOOLFILE
158  
159 + # Makes sure that executables start with /usr/bin/env perl and not with comments.
160 + find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|^"""|#/usr/bin/env python\n"""|}' {} \;
161 + find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|^\'\'\'|#/usr/bin/env python\n\'\'\'|}' {} \;
162 + find %i -type f -perm -555 -name '*.py' -exec perl -p -i -e 'if ($. == 1) {s|/usr/local/bin/python|/usr/bin/env python|}' {} \;
163 + rm -f %i/share/doc/python/Demo/rpc/test
164 +
165   %post
166   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
167   %{relocateConfig}etc/scram.d/%n

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines