build_python-2.7() { . ./bzip2-sc.inc || exit 1 . ./expat-sc.inc || exit 1 . ./fontconfig-sc.inc || exit 1 . ./openssl-sc.inc || exit 1 . ./sqlite3-sc.inc || exit 1 . ./tcl-tk-sc.inc || exit 1 HERE=`pwd` NAME=python-2.7 VER=2.7.2 BUILDDEPS="compiletc.tcz perl5.tcz autoconf.tcz automake.tcz" if [ ! -f Python-2.7.2.tar.xz ]; then wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tar.xz || exit 1 fi for I in `echo "$BUILDDEPS"`; do su tc -c "tce-load -i "$I"" || su tc -c "tce-load -iw "$I"" done PKGPATH=$1 export LDFLAGS="-L$PKGPATH/lib" export CPPFLAGS="-I$PKGPATH/include" export PATH="$PKGPATH/bin:$PATH" export PKG_CONFIG_PATH="$PKGPATH/lib/pkgconfig:/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$PKGPATH/lib" export LD_RUN_PATH="$PKGPATH/lib" if [ ! -f "$TMPDIR"/bzip2 ]; then build_bzip2 "$PKGPATH" || exit 1 fi if [ ! -f "$TMPDIR"/expat ]; then build_expat "$PKGPATH" || exit 1 fi if [ ! -f "$TMPDIR"/fontconfig ]; then build_fontconfig "$PKGPATH" || exit 1 fi if [ ! -f "$TMPDIR"/openssl ]; then build_openssl "$PKGPATH" || exit 1 fi if [ ! -f "$TMPDIR"/sqlite3 ]; then build_sqlite3 "$PKGPATH" || exit 1 fi if [ ! -f "$TMPDIR"/tcl-tk ]; then build_tcl-tk "$PKGPATH" || exit 1 fi rm -f /usr/local/lib/libdb*.so tar xvf Python-2.7.2.tar.xz || exit 1 cd Python-2.7.2 || exit 1 sed -i "/progname =/s/python/python2.7/" Python/pythonrun.c || exit 1 sed -i "/SQLITE_OMIT_LOAD_EXTENSION/d" setup.py || exit 1 sed -i -e "s|^#.* /usr/local/bin/python|#!/usr/bin/python2|" Lib/cgi.py || exit 1 patch -p1 < ../python-2.7.linux2.patch || exit 1 ./configure --prefix="$PKGPATH" || exit 1 make MACHDEP=linux2 || exit 1 make install || exit 1 touch "$TMPDIR"/python-2.7 cd "$HERE" }