from fabric.api import * env.hosts = ['255.255.255.255'] # your IP env.user = u'root' # you need root env.password = u'yourpassword' # root password def zembu(): """Install python 2.6.6 on target Debian 5.0 system""" with settings(warn_only = True): with cd("/root"): run("apt-get -y update", pty = True) run("apt-get -y install debian-keyring debian-archive-keyring", pty = True) run("apt-get -y update", pty = True) run("rm -rf pythontemp", pty = True) run("mkdir pythontemp", pty = True) # cleanup apache if present run("apt-get -y remove --purge apache2*", pty = True) with cd("/root/pythontemp"): run("apt-get -y install bzip2", pty = True) run("apt-get -y install wget", pty = True) run("wget http://python.org/ftp/python/2.6.6/Python-2.6.6.tar.bz2", pty = True) run("tar xjvf Python-2.6.6.tar.bz2", pty = True) with cd("/root/pythontemp/Python-2.6.6"): run("apt-get -y install make", pty = True) run("apt-get -y install gcc", pty = True) run("apt-get -y install libssl-dev", pty = True) run("apt-get -y install libsqlite3-dev", pty = True) run("apt-get -y install libbz2-dev", pty = True) run("apt-get -y install tk8.4-dev libgdbm-dev libdb-dev libreadline-dev libncurses-dev", pty = True) run("apt-get -y install patch", pty = True) run("apt-get -y install checkinstall", pty = True) run('./configure', pty = True) run("make", pty = True) run("checkinstall -y --pkgname=python2.6 --showinstall=no", pty = True) def zembu_mongrel2(): with settings(warn_only = True): with cd("/root"): run("apt-get -y install uuid-dev") run("wget http://www.zeromq.org/local--files/area:download/zeromq-2.0.8.tar.gz", pty = True) run("tar -xzvf zeromq-2.0.8.tar.gz", pty = True) with cd("/root/zeromq-2.0.8"): run("./configure", pty = True) run("make", pty = True) run("make install", pty = True) with cd("/root"): run("mkdir distribute", pty=True) with cd("/root/distribute"): run("wget http://python-distribute.org/distribute_setup.py", pty = True) run("python2.6 distribute_setup.py", pty = True) with cd("/root"): run("apt-get -y install sqlite3", pty = True) run("apt-get -y install git-core", pty = True) run("git clone http://github.com/zeromq/pyzmq.git", pty = True) with cd("/root/pyzmq"): run("python2.6 setup.py install", pty=True) with cd("/root"): run("easy_install-2.6 pip", pty=True) run("pip install web.py", pty=True) run("wget http://mongrel2.org/static/downloads/mongrel2-1.0beta6.tar.bz2", pty=True) run("tar -xjvf mongrel2-1.0beta6.tar.bz2", pty=True) def zembu_mongrel2_run(): with settings(warn_only = True): with cd("/root/mongrel2_2010-08-31_015320_dd10baf7fc"): run("make clean all install", pty=True) def zembu27(): with settings(warn_only = True): # install python 2.7 on target system with cd("/root"): run("apt-get -y update", pty = True) run("apt-get -y install debian-keyring debian-archive-keyring", pty = True) run("apt-get -y update", pty = True) run("rm -rf pythontemp", pty = True) run("mkdir pythontemp", pty = True) # cleanup apache if present run("apt-get -y remove --purge apache2*", pty = True) with cd("/root/pythontemp"): run("apt-get -y install bzip2", pty = True) run("apt-get -y install wget", pty = True) run("wget http://python.org/ftp/python/2.7/Python-2.7.tar.bz2", pty = True) run("tar xjvf Python-2.7.tar.bz2", pty = True) with cd("/root/pythontemp/Python-2.7"): run("apt-get -y install make", pty = True) run("apt-get -y install gcc", pty = True) run("apt-get -y install libssl-dev", pty = True) run("apt-get -y install libsqlite3-dev", pty = True) run("apt-get -y install libbz2-dev", pty = True) run("apt-get -y install tk8.4-dev libgdbm-dev libdb-dev libreadline-dev libncurses-dev", pty = True) run("apt-get -y install patch", pty = True) run("apt-get -y install checkinstall", pty = True) #put("setup.patch","/root/pythontemp/Python-2.7/setup.patch") # lets try without the path #run("patch -p0 < setup.patch", pty = True ) run('./configure', pty = True) run("make", pty = True) run("checkinstall -y --pkgname=python2.7 --showinstall=no", pty = True)