s4-scripting: allow to specify the number max of iteration around getNcChanges
[sfrench/samba-autobuild/.git] / install_with_python.sh
1 #!/bin/sh
2
3 # this script installs a private copy of python in the same prefix as Samba
4
5 if [ $# -lt 1 ]; then
6 cat <<EOF
7 Usage: install_with_python.sh PREFIX [CONFIGURE OPTIONS]
8 EOF
9 exit 1;
10 fi
11
12 PREFIX="$1"
13 shift
14
15 PATH=$PREFIX/python/bin:$PATH
16 export PATH
17
18 VERSION="Python-2.6.5"
19
20 do_install_python() {
21        mkdir -p python_install || exit 1
22        rsync -avz samba.org::ftp/tridge/python/$VERSION.tar python_install || exit 1
23        cd python_install || exit 1;
24        rm -rf $VERSION || exit 1
25        tar -xf $VERSION.tar || exit 1
26        cd $VERSION || exit 1
27        ./configure --prefix=$PREFIX/python --enable-shared --disable-ipv6 || exit 1
28        make || exit 1
29        make install || exit 1
30        cd ../.. || exit 1
31        rm -rf python_install || exit 1
32 }
33
34 if ! test -d $PREFIX/python; then
35    # needs to be installed
36    do_install_python
37 fi
38
39 `dirname $0`/configure --prefix=$PREFIX $@ || exit 1
40 make -j || exit 1
41 make install || exit 1