#!/bin/sh # # mysql-python.cgi automatic installer for msql-python # # Put this script in a protected directory and chmod 700, # then access it onece: http://yourdomain.com/protected_dir/mysql-python.cgi # # You must have Python package installed using extratools.php before to use this # http://check-these.info/tools/extratools_php.txt # echo -e "Content-type: text/html\n\n
"
exec 2>&1
VER=1.2.0
HOME=${DOCUMENT_ROOT%/*}
exitmes (){
echo $1
exit $2
}
cd $HOME/py24 || exitmes "cd $HOME/py24 failed. Maybe you don't have Python installed
You must have Python package installed using extratools.php before to use this
http://check-these.info/tools/extratools_php.txt
" 1
pwd
#ls -alt
if [ ! -f MySQL-python-$VER.tar.gz ] ; then
wget -nd http://easynews.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python-$VER.tar.gz || exitmes "Failed to download sourcecode. Please try again" 2
fi
if [ ! -f MySQL-python-$VER.tar.gz ] ; then
wget -nd http://voxel.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python-$VER.tar.gz || exitmes "Failed to download sourcecode. Please try again" 2
fi
if [ ! -f MySQL-python-$VER.tar.gz ] ; then
exitmes "Failed to download sourcecode. Please try again" 2
fi
if [ ! -d MySQL-python-$VER ] ; then
tar xfvz MySQL-python-$VER.tar.gz || exitmes "Failed to extract. Please try again" 3
fi
cd MySQL-python-$VER;
mkdir -p build/lib.freebsd-4.11-RELEASE-i386-2.4 || exitmes "Failed to create directory: build/lib.freebsd-4.11-RELEASE-i386-2.4. Please report the error to me (extras) in Powweb forum, or via PM."
if [ ! -f build/lib.freebsd-4.11-RELEASE-i386-2.4/_mysql.so ] ; then
wget -O build/lib.freebsd-4.11-RELEASE-i386-2.4/_mysql.so http://check-these.info/tools/_mysql.so || exitmes "Failed to download _mysql.so. Please try again" 4
fi
export mysqlversion="4.1.11"
export mysqlclient="mysqlclient_r"
export mysqloptlibs="ssl crypto"
$HOME/py24/bin/python setup.py build
echo '
------build done--------
'
$HOME/py24/bin/python setup.py install --home=$HOME/py24 --install-lib=$HOME/py24/lib/python2.4
echo '
------all done--------
'