#!/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