auto-install a recent python on imini and gwen
[amitay/build-farm.git] / install_python.fns
1 # this script should be . included into the fns file
2 # of any system that needs an update to its python install
3
4 PATH=$HOME/python/bin:$PATH
5 export PATH
6
7 VERSION="Python-2.6.5"
8
9 do_install_python() {
10    ( 
11        mkdir -p python_install || exit 1
12        rsync -av samba.org::ftp/tridge/python/$VERSION.tgz python_install || exit 1
13        cd python_install || exit 1;
14        rm -f $VERSION.tar
15        gunzip $VERSION.tgz || exit 1
16        rm -rf $VERSION || exit 1
17        tar -xf $VERSION.tar || exit 1
18        cd $VERSION || exit 1
19        ./configure --prefix=$HOME/python --disable-ipv6 || exit 1
20        make || exit 1
21        make install || exit 1
22        cd ..
23        rm -rf $VERSION || exit 1     
24        cd .. || exit 1
25        rsync install_python.fns $HOME/python || exit 1
26    ) > install_python.$host.log 2>&1
27
28    rsync  -c -q --password-file=.password -z --timeout=200 install_python.$host.log $host@build.samba.org::build_farm_data/
29 }
30
31 if ! test -d $HOME/python || ! cmp install_python.fns $HOME/python/install_python.fns; then
32    # needs to be installed
33    do_install_python
34 fi