wilde@680: #!/bin/bash wilde@680: # Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik wilde@680: # Software engineering by Intevation GmbH wilde@680: # wilde@680: # This file is Free Software under the GNU GPL (v>=2) wilde@680: # and comes with ABSOLUTELY NO WARRANTY! wilde@680: # See LICENSE.txt for details. wilde@680: wilde@680: TMPDIR=$(mktemp -d) wilde@700: TMPSHAR=$(mktemp "@CMAKE_BINARY_DIR@/shar.XXXXXXXXXX") wilde@680: wilde@680: INSTALLER="@CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.sh" wilde@680: wilde@680: EXEFILES=("@CMAKE_BINARY_DIR@/cinst/cinst" wilde@680: "@CMAKE_BINARY_DIR@/cinst/mozilla" wilde@680: "@CMAKE_BINARY_DIR@/ui/trustbridge") wilde@680: wilde@680: # Make installation in TMPDIR, this is what we will put into the wilde@680: # shar-archive. wilde@680: echo "Using $TMPDIR for temporary installation to build installer..." wilde@680: install -d "$TMPDIR/bin" wilde@680: install "${EXEFILES[@]}" "$TMPDIR/bin" wilde@680: wilde@680: echo "Building $INSTALLER..." wilde@700: cp "@CMAKE_BINARY_DIR@/packaging/linux-installer.inc" "$INSTALLER" wilde@680: cd "$TMPDIR" wilde@700: shar -z -B bin/* | sed 's/^exit 0//' >>"$TMPSHAR" wilde@700: sed -i "/###SHAR###/r $TMPSHAR" "$INSTALLER" wilde@680: chmod +x "$INSTALLER" wilde@680: wilde@680: echo "Cleaning up..." wilde@680: rm -r "$TMPDIR" wilde@700: rm "$TMPSHAR"