build: Add a script to install python and Samba with one command
authorAndrew Bartlett <abartlet@samba.org>
Thu, 23 Jun 2011 10:43:16 +0000 (20:43 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 23 Jun 2011 12:56:54 +0000 (14:56 +0200)
This should help folks on systems that don't have a recent python
provided by the OS.

Python is installed into the same prefix as Samba, not in the default
path.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Jun 23 14:56:54 CEST 2011 on sn-devel-104

install_with_python.sh [new file with mode: 0644]

diff --git a/install_with_python.sh b/install_with_python.sh
new file mode 100644 (file)
index 0000000..d7ae55d
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# this script installs a private copy of python in the same prefix as Samba
+
+if [ $# -lt 1 ]; then
+cat <<EOF
+Usage: install_with_python.sh PREFIX [CONFIGURE OPTIONS]
+EOF
+exit 1;
+fi
+
+PREFIX="$1"
+shift
+
+PATH=$PREFIX/python/bin:$PATH
+export PATH
+
+VERSION="Python-2.6.5"
+
+do_install_python() {
+       mkdir -p python_install || exit 1
+       rsync -avz samba.org::ftp/tridge/python/$VERSION.tar python_install || exit 1
+       cd python_install || exit 1;
+       rm -rf $VERSION || exit 1
+       tar -xf $VERSION.tar || exit 1
+       cd $VERSION || exit 1
+       ./configure --prefix=$PREFIX/python --enable-shared --disable-ipv6 || exit 1
+       make || exit 1
+       make install || exit 1
+       cd ../.. || exit 1
+       rm -rf python_install || exit 1
+}
+
+if ! test -d $PREFIX/python; then
+   # needs to be installed
+   do_install_python
+fi
+
+`dirname $0`/configure --prefix=$PREFIX $@ || exit 1
+make -j || exit 1
+make install || exit 1