(no commit message)
[libt2n] / test-build-install-use
... / ...
CommitLineData
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"
10./configure --prefix="$INSTPREFIX"
11# todo: at the moment running make dist on clean source does not work
12$MAKE
13#$MAKE distcheck
14$MAKE dist
15$MAKE install
16
17echo "OK: library and code generator compiled and installed"
18
19VERSION="0.1"
20TARFILE="libt2n-$VERSION.tar.gz"
21cp "$TARFILE" "$INSTDIR"
22EXAMPLE_LIBUSAGE="example-libusage"
23cp -af "$EXAMPLE_LIBUSAGE" "$INSTDIR"
24
25# now build example-client using installed libt2n
26cd "$INSTDIR"
27
28function append() {
29 if [ "x$1" = "x" ]; then
30 echo "$2"
31 else
32 echo "$1:$2"
33 fi
34}
35
36
37# adjust some environment variables
38# (this is needed because we installed in non-standard directories)
39
40# temporarily disable nounset
41set +o nounset
42export PATH=$(append "$PATH" "$INSTPREFIX/bin")
43export LD_LIBRARY_PATH=$(append "$LD_LIBRARY_PATH" "$INSTPREFIX/lib")
44export PKG_CONFIG_PATH=$(append "$PKG_CONFIG_PATH" "$INSTPREFIX/lib/pkgconfig")
45set -o nounset
46
47tar xzvf "$TARFILE"
48mv "libt2n-$VERSION/example-codegen" .
49cd example-codegen
50autoreconf -f -i -M "$INSTDIR/usr/share/aclocal"
51./configure --prefix="$INSTPREFIX"
52# todo: at the moment running make dist on clean source does not work
53$MAKE
54$MAKE distcheck
55$MAKE install
56cd ..
57echo "OK: example using installed libt2n works"
58
59# now compile client using the installed default lib
60cd "$EXAMPLE_LIBUSAGE"
61autoreconf -f -i -M "$INSTDIR/usr/share/aclocal"
62./configure --prefix="$INSTPREFIX"
63$MAKE distcheck
64echo "OK: example using installed example lib works"