annotate packaging/linux-createpackage.sh.in @ 761:49168bcb02e2

(Issue55) Sign a linux installer This uses the same RSA key that is used for Windows codesigning to create an additonal S:<base64encodedsignature> line. Signed is everything up to the last \r\n before the S: line. The hash algorithm is sha256
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 07 Jul 2014 18:52:48 +0200
parents ea8d13590cbd
children 3a9b0c75f5a6
rev   line source
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
1 #!/bin/bash
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
2 # Copyright (C) 2014 by Bundesamt f�r Sicherheit in der Informationstechnik
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
3 # Software engineering by Intevation GmbH
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
4 #
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
5 # This file is Free Software under the GNU GPL (v>=2)
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
6 # and comes with ABSOLUTELY NO WARRANTY!
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
7 # See LICENSE.txt for details.
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
8
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
9 TMPDIR=$(mktemp -d)
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 680
diff changeset
10 TMPSHAR=$(mktemp "@CMAKE_BINARY_DIR@/shar.XXXXXXXXXX")
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
11
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
12 INSTALLER="@CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.sh"
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
13
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
14 EXEFILES=("@CMAKE_BINARY_DIR@/cinst/cinst"
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
15 "@CMAKE_BINARY_DIR@/cinst/mozilla"
738
ea8d13590cbd Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents: 711
diff changeset
16 "@CMAKE_BINARY_DIR@/ui/trustbridge"
ea8d13590cbd Added trustbridge-tray-starter script for use with cron job.
Sascha Wilde <wilde@intevation.de>
parents: 711
diff changeset
17 "@CMAKE_BINARY_DIR@/ui/trustbridge-tray-starter.sh")
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
18
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
19 # Make installation in TMPDIR, this is what we will put into the
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
20 # shar-archive.
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
21 echo "Using $TMPDIR for temporary installation to build installer..."
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
22 install -d "$TMPDIR/bin"
711
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 700
diff changeset
23 install "${EXEFILES[@]}" "$TMPDIR/bin"
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 700
diff changeset
24
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 700
diff changeset
25 echo "Creating shar archive ..."
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 700
diff changeset
26 cd "$TMPDIR"
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 700
diff changeset
27 shar -z -B bin/* | sed 's/^exit 0//' >>"$TMPSHAR"
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
28
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
29 echo "Building $INSTALLER..."
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 680
diff changeset
30 cp "@CMAKE_BINARY_DIR@/packaging/linux-installer.inc" "$INSTALLER"
711
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 700
diff changeset
31 binnames=""
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 700
diff changeset
32 for file in "${EXEFILES[@]}" ; do
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 700
diff changeset
33 binnames="`basename $file` $binnames"
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 700
diff changeset
34 done
acbe75423283 Added deinstallation functionality.
Sascha Wilde <wilde@intevation.de>
parents: 700
diff changeset
35 sed -i "s/###BINNAMES###/${binnames}/" "$INSTALLER"
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 680
diff changeset
36 sed -i "/###SHAR###/r $TMPSHAR" "$INSTALLER"
680
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
37 chmod +x "$INSTALLER"
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
38
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
39 echo "Cleaning up..."
a5a709c6ce93 Added minimal shar based installer for linux.
Sascha Wilde <wilde@intevation.de>
parents:
diff changeset
40 rm -r "$TMPDIR"
700
bf87feccb26c Write installation configuration file.
Sascha Wilde <wilde@intevation.de>
parents: 680
diff changeset
41 rm "$TMPSHAR"

http://wald.intevation.org/projects/trustbridge/