added test-build-install-use
[libt2n] / test-build-install-use
CommitLineData
ad17f523
JT
1#!/bin/bash -x
2set -o errexit
3set -o nounset
4
5# todo: safe temp dir creation
6INSTDIR="/tmp/jens-delme"
7mkdir "$INSTDIR"
8INSTPREFIX="/tmp/jens-delme/usr"
9MAKE="dmake -d"
10./configure --prefix="$INSTPREFIX"
11$MAKE dist
12$MAKE install
13
14VERSION="0.1"
15TARFILE="libt2n-$VERSION.tar.gz"
16cp "$TARFILE" "$INSTDIR"
17
18# now build example-client using installed libt2n
19cd "$INSTDIR"
20
21function append() {
22 if [ "x$1" = "x" ]; then
23 echo "$2"
24 else
25 echo "$1:$2"
26 fi
27}
28
29
30# adjust some environment variables
31# (this is needed because we installed in non-standard directories)
32
33# temporarily disable nounset
34set +o nounset
35export PATH=$(append "$PATH" "$INSTPREFIX/bin")
36export LD_LIBRARY_PATH=$(append "$LD_LIBRARY_PATH" "$INSTPREFIX/lib")
37export PKG_CONFIG_PATH=$(append "$PKG_CONFIG_PATH" "$INSTPREFIX/lib/pkgconfig")
38set -o nounset
39
40tar xzvf "$TARFILE"
41mv "libt2n-$VERSION/example-codegen" .
42cd example-codegen
43autoreconf -f -i -M "$INSTDIR/usr/share/aclocal"
44./configure
45# todo: at the moment running make dist on clean source does not work
46$MAKE
47$MAKE distcheck