added test-build-install-use
authorJens Thiele <jens.thiele@intra2net.com>
Tue, 5 Dec 2006 14:47:22 +0000 (14:47 +0000)
committerJens Thiele <jens.thiele@intra2net.com>
Tue, 5 Dec 2006 14:47:22 +0000 (14:47 +0000)
test-build-install-use [new file with mode: 0755]

diff --git a/test-build-install-use b/test-build-install-use
new file mode 100755 (executable)
index 0000000..15c0ddf
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/bash -x
+set -o errexit
+set -o nounset
+
+# todo: safe temp dir creation
+INSTDIR="/tmp/jens-delme"
+mkdir "$INSTDIR"
+INSTPREFIX="/tmp/jens-delme/usr"
+MAKE="dmake -d"
+./configure --prefix="$INSTPREFIX"
+$MAKE dist
+$MAKE install
+
+VERSION="0.1"
+TARFILE="libt2n-$VERSION.tar.gz"
+cp "$TARFILE" "$INSTDIR"
+
+# now build example-client using installed libt2n
+cd "$INSTDIR"
+
+function append() {
+       if [ "x$1" = "x" ]; then
+               echo "$2"
+       else
+               echo "$1:$2"
+       fi
+}
+
+
+# adjust some environment variables
+# (this is needed because we installed in non-standard directories)
+
+# temporarily disable nounset
+set +o nounset
+export PATH=$(append "$PATH" "$INSTPREFIX/bin")
+export LD_LIBRARY_PATH=$(append "$LD_LIBRARY_PATH" "$INSTPREFIX/lib")
+export PKG_CONFIG_PATH=$(append "$PKG_CONFIG_PATH" "$INSTPREFIX/lib/pkgconfig")
+set -o nounset
+
+tar xzvf "$TARFILE"
+mv "libt2n-$VERSION/example-codegen" .
+cd example-codegen
+autoreconf -f -i -M "$INSTDIR/usr/share/aclocal"
+./configure
+# todo: at the moment running make dist on clean source does not work
+$MAKE
+$MAKE distcheck