[PATCH 1 of 2] Added minimal shar based installer for linux

Wald Commits scm-commit at wald.intevation.org
Mon Jun 30 18:36:18 CEST 2014


# HG changeset patch
# User Sascha Wilde <wilde at intevation.de>
# Date 1404146006 -7200
# Node ID a5a709c6ce93eb146d04c908d8cbfe560042522b
# Parent  237af0c824540f22343bc3fee190ad72912b829c
Added minimal shar based installer for linux.

diff -r 237af0c82454 -r a5a709c6ce93 CMakeLists.txt
--- a/CMakeLists.txt	Mon Jun 30 15:41:13 2014 +0200
+++ b/CMakeLists.txt	Mon Jun 30 18:33:26 2014 +0200
@@ -118,6 +118,8 @@
 
 set(NSS_BASE_DIR "${NSS_BASE_DIR}/..")
 configure_file (packaging/tmp-createpackage.sh.in packaging/tmp-createpackage.sh)
+configure_file (packaging/linux-createpackage.sh.in packaging/linux-createpackage.sh @ONLY)
+configure_file (packaging/linux-installer.inc.in packaging/linux-installer.inc @ONLY)
 
 if (ENABLE_PROFILING)
    configure_file (make-coverage.sh.in make-coverage.sh)
diff -r 237af0c82454 -r a5a709c6ce93 packaging/linux-createpackage.sh.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/packaging/linux-createpackage.sh.in	Mon Jun 30 18:33:26 2014 +0200
@@ -0,0 +1,30 @@
+#!/bin/bash
+# Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
+# Software engineering by Intevation GmbH
+#
+# This file is Free Software under the GNU GPL (v>=2)
+# and comes with ABSOLUTELY NO WARRANTY!
+# See LICENSE.txt for details.
+
+TMPDIR=$(mktemp -d)
+
+INSTALLER="@CMAKE_BINARY_DIR@/TrustBridge- at PROJECT_VERSION@.sh"
+
+EXEFILES=("@CMAKE_BINARY_DIR@/cinst/cinst"
+          "@CMAKE_BINARY_DIR@/cinst/mozilla"
+          "@CMAKE_BINARY_DIR@/ui/trustbridge")
+
+# Make installation in TMPDIR, this is what we will put into the
+# shar-archive.
+echo "Using $TMPDIR for temporary installation to build installer..."
+install -d "$TMPDIR/bin"
+install "${EXEFILES[@]}" "$TMPDIR/bin" 
+
+echo "Building $INSTALLER..."
+cat "@CMAKE_BINARY_DIR@/packaging/linux-installer.inc" >"$INSTALLER"
+cd "$TMPDIR"
+shar -z -B bin/* >>"$INSTALLER"
+chmod +x "$INSTALLER"
+
+echo "Cleaning up..."
+rm -r "$TMPDIR"
diff -r 237af0c82454 -r a5a709c6ce93 packaging/linux-installer.inc.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/packaging/linux-installer.inc.in	Mon Jun 30 18:33:26 2014 +0200
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+PREFIX=/usr/local
+
+fatal()
+{
+  echo "$1" >&2
+  echo "Installation failed." >&2
+  exit 1
+}
+
+cat <<EOF
+------------------------------------------------------------------------
+
+   TrustBridge - Installer
+   Version @PROJECT_VERSION@
+
+------------------------------------------------------------------------
+EOF
+
+echo -n "Select installation prefix for TrustBridge [${PREFIX}]: "
+read -e path
+
+echo "Installing to '$path':"
+
+if [ ! -d "$path" ] ; then
+    echo "creating installation directory ..."
+    install -d "$path" || fatal "Could not create '$path'!"
+fi
+
+echo "unpacking files ..."
+cd "$path"
+
+# ----------------------------------------------------------------------
+# regular shar archive appended here:


More information about the Trustbridge-commits mailing list