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.78 by eulisse, Wed Nov 2 14:15:50 2011 UTC vs.
Revision 1.85 by diego, Thu Apr 19 14:05:13 2012 UTC

# Line 1 | Line 1
1 < ### RPM external python 2.6.4
1 > ### RPM external python 2.6.8
2   ## INITENV +PATH PATH %i/bin
3   ## INITENV +PATH LD_LIBRARY_PATH %i/lib
4   ## INITENV SETV PYTHON_LIB_SITE_PACKAGES lib/python%{python_major_version}/site-packages
5 + ## INITENV SETV PYTHONHASHSEED random
6   # OS X patches and build fudging stolen from fink
7   %{expand:%%define python_major_version %(echo %realversion | cut -d. -f1,2)}
8   %define online %(case %cmsplatf in (*onl_*_*) echo true;; (*) echo false;; esac)
# Line 16 | Line 17 | Requires: zlib openssl sqlite
17   # FIXME: gmp, panel, tk/tcl, x11
18  
19   Source0: http://www.python.org/ftp/%n/%realversion/Python-%realversion.tgz
20 < Patch0: python-2.6.4-dont-detect-dbm
21 < Patch1: python-2.6.4-fix-macosx-relocation
20 > Patch0: python-dont-detect-dbm
21 > Patch1: python-fix-macosx-relocation
22  
23   %prep
24   %setup -n Python-%realversion
# Line 26 | Line 27 | find . -type f | while read f; do
27      perl -p -i -e "s|#!.*/usr/local/bin/python|#!/usr/bin/env python|" $f
28    else :; fi
29   done
30 <
31 < case %cmsplatf in
31 <  osx*)
32 <        sed 's|@PREFIX@|%i|g' < %_sourcedir/python-osx | patch -p1
33 <  ;;
34 < esac
35 < %patch0 -p1
36 < %patch1 -p1
30 > %patch0 -p0
31 > %patch1 -p0
32  
33   %build
34   # Python is awkward about passing other include or library directories
# Line 62 | Line 57 | dirs="$EXPAT_ROOT $BZ2LIB_ROOT $NCURSES_
57   # location of DB4, this was needed to avoid having it picked up from the system.
58   export DB4_ROOT
59  
60 + # Python's configure parses LDFLAGS and CPPFLAGS to look for aditional library and include directories
61   echo $dirs
62 + LDFLAGS=""
63 + CPPFLAGS=""
64   for d in $dirs; do
65 <  for f in $d/include/*; do
66 <    [ -e $f ] || continue
69 <    rm -f %i/include/$(basename $f)
70 <    ln -s $f %i/include
71 <  done
72 <  for f in $d/lib/*; do
73 <    [ -e $f ] || continue
74 <    rm -f %i/lib/$(basename $f)
75 <    ln -s $f %i/lib
76 <  done
65 >  LDFLAGS="$LDFLAGS -L $d/lib"
66 >  CPPFLAGS="$CPPFLAGS -I $d/include"
67   done
68 + export LDFLAGS
69 + export CPPFLAGS
70  
71   additionalConfigureOptions=""
72   case %cmsplatf in
# Line 86 | Line 78 | esac
78   ./configure --prefix=%i $additionalConfigureOptions --enable-shared \
79              --without-tkinter --disable-tkinter
80  
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
81   make %makeprocesses
82  
83   %install
# Line 124 | Line 108 | case %cmsplatf in
108    ;;
109   esac
110  
111 < perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
112 <                    %{i}/bin/pydoc \
113 <                    %{i}/bin/python-config \
114 <                    %{i}/bin/2to3 \
115 <                    %{i}/bin/python2.6-config \
116 <                    %{i}/bin/smtpd.py \
117 <                    %{i}/lib/python2.6/bsddb/dbshelve.py \
118 <                    %{i}/lib/python2.6/test/test_bz2.py \
119 <                    %{i}/lib/python2.6/test/test_largefile.py \
120 <                    %{i}/lib/python2.6/test/test_optparse.py
111 > perl -p -i -e "s|^#!.*python|#!/usr/bin/env python|" %{i}/bin/idle \
112 >                     %{i}/bin/pydoc \
113 >                     %{i}/bin/python-config \
114 >                     %{i}/bin/2to3 \
115 >                     %{i}/bin/python2.6-config \
116 >                     %{i}/bin/smtpd.py \
117 >                     %{i}/lib/python2.6/bsddb/dbshelve.py \
118 >                     %{i}/lib/python2.6/test/test_bz2.py \
119 >                     %{i}/lib/python2.6/test/test_largefile.py \
120 >                     %{i}/lib/python2.6/test/test_optparse.py
121  
122   find %{i}/lib -maxdepth 1 -mindepth 1 ! -name '*python*' -exec rm {} \;
123   find %{i}/include -maxdepth 1 -mindepth 1 ! -name '*python*' -exec rm {} \;
# Line 149 | Line 133 | done
133   find %{i}/lib -type f -name "_tkinter.so" -exec rm {} \;
134  
135   # Remove documentation, examples and test files.
136 < %define drop_files %i/share %{i}/lib/python%{pythonv}/test
136 > %define drop_files { %i/share %{i}/lib/python%{pythonv}/test \
137 >                   %{i}/lib/python%{pythonv}/distutils/tests \
138 >                   %{i}/lib/python%{pythonv}/json/tests \
139 >                   %{i}/lib/python%{pythonv}/ctypes/test \
140 >                   %{i}/lib/python%{pythonv}/sqlite3/test \
141 >                   %{i}/lib/python%{pythonv}/bsddb/test \
142 >                   %{i}/lib/python%{pythonv}/email/test \
143 >                   %{i}/lib/python%{pythonv}/lib2to3/tests }
144  
145   # Remove .pyo files
146   find %i -name '*.pyo' -exec rm {} \;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines