#!/bin/sh
set -e

pkg=libsonlib-dev

if [ -z "$AUTOPKGTEST_TMP" ]; then
    AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
    trap 'rm -rf "$AUTOPKGTEST_TMP"' EXIT HUP INT QUIT TERM
fi

# The examples are shipped as user documentation.  Build and run them
# against the installed package to verify the public headers and both
# the shared and the static library.
cp -a /usr/share/doc/${pkg}/examples/. "$AUTOPKGTEST_TMP"/
cd "$AUTOPKGTEST_TMP"
make check
