changeset 1151:22b3daa4e464

Merged
author Sascha Wilde <wilde@intevation.de>
date Thu, 18 Sep 2014 13:29:32 +0200
parents a72d59f8c3ea (diff) 6ec64a30fd5f (current diff)
children 46f025a1450c
files packaging/linux-installer.inc ui/img/security-high.png ui/img/security-low.png ui/img/security-medium.png
diffstat 12 files changed, 167 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/packaging/CMakeLists.txt	Thu Sep 18 11:43:54 2014 +0200
+++ b/packaging/CMakeLists.txt	Thu Sep 18 13:29:32 2014 +0200
@@ -3,9 +3,13 @@
 configure_file (create-dist-package.sh.in create-dist-package.sh @ONLY)
 configure_file (linux-createpackage.sh.in linux-createpackage.sh @ONLY)
 configure_file (linux-installer.inc linux-installer.inc COPYONLY)
+configure_file (linux-uninstaller.inc linux-uninstaller.inc COPYONLY)
 configure_file (linux-installer-common.inc.in linux-installer-common.inc @ONLY)
 configure_file (linux-installer-uninstall.inc linux-installer-uninstall.inc COPYONLY)
 configure_file (linux-installer.l10n-de linux-installer.l10n-de COPYONLY)
+configure_file (linux-uninstaller.l10n-de linux-uninstaller.l10n-de COPYONLY)
+configure_file (linux-installer-common.l10n-de linux-installer-common.l10n-de COPYONLY)
+configure_file (linux-installer-uninstall.l10n-de linux-installer-uninstall.l10n-de COPYONLY)
 
 if (WIN32)
    # Build the nss safer plugin.
--- a/packaging/README.linux-installer-l10n	Thu Sep 18 11:43:54 2014 +0200
+++ b/packaging/README.linux-installer-l10n	Thu Sep 18 13:29:32 2014 +0200
@@ -18,18 +18,22 @@
 Relevant files
 --------------
 
-* linux-installer.inc.in :
+* linux-installer.inc :
+  linux-installer-common.inc.in :
+  linux-installer-uninstall.inc :
 
-  Linux Installer Template, written in bash.  l10n-enabled messages
+  Linux Installer Templates, written in bash.  l10n-enabled messages
   are printed using the function "getxt" or "fatal" (which in turn
   uses getxt for output).  The semantics are these of printf and all
   messages are in English.
 
 * linux-installer.l10n-de :
+  linux-installer-common.l10n-de :
+  linux-installer-uninstall.l10n-de :
 
-  This file contains the associative array L10N_DE which has the
-  English messages as used in linux-installer.inc.in as keys and the
-  corresponding German strings as values.
+  This files contain assignments to the associative array L10N_DE
+  which has the English messages as used in linux-installer.inc as
+  keys and the corresponding German strings as values.
 
 * getxt-gen-l10n-array.sh :
 
@@ -53,12 +57,17 @@
 When any messages in "linux-installer.inc.in" were changed or added
 the array file "linux-installer.l10n-de" needs to be updated:
 
-1. Edit "linux-installer.inc.in" (obviously)
+1. Edit one or more of "linux-installer.inc",
+   "linux-installer-common.inc.in", "linux-installer-uninstall.inc"
+   (obviously)
 
 2. Update the array file using getxt-gen-l10n-array.sh in the
-   packaging source directory (the directory containing this README):
+   packaging source directory (the directory containing this README)
+   for the file(s) you edited:
 
    $ ./getxt-gen-l10n-array.sh linux-installer.inc.in L10N_DE linux-installer.l10n-de
+   $ ./getxt-gen-l10n-array.sh linux-installer-common.inc.in L10N_DE linux-installer-common.l10n-de
+   $ ./getxt-gen-l10n-array.sh linux-installer-uninstall.inc L10N_DE linux-installer-uninstall.l10n-de
 
    the associative array "L10N_DE" in "linux-installer.l10n-de" will
    now contain entries for all new or changed messaged with empty
--- a/packaging/getxt-gen-l10n-array.sh	Thu Sep 18 11:43:54 2014 +0200
+++ b/packaging/getxt-gen-l10n-array.sh	Thu Sep 18 13:29:32 2014 +0200
@@ -48,7 +48,7 @@
 
 write_l10n_array()
 {
-  echo "$1=("
+  echo "$1+=("
   for msgid in "${MSGIDS[@]}" ; do
     echo "  [${msgid}]=\"${L10N[$msgid]}\""
   done
--- a/packaging/linux-createpackage.sh.in	Thu Sep 18 11:43:54 2014 +0200
+++ b/packaging/linux-createpackage.sh.in	Thu Sep 18 13:29:32 2014 +0200
@@ -39,11 +39,13 @@
 fi
 
 INSTALLER="@CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.sh"
+UNINSTALLER="$TMPDIR/bin/trustbridge-deinstall.sh"
 
 EXEFILES=("@CMAKE_BINARY_DIR@/cinst/cinst"
           "@CMAKE_BINARY_DIR@/cinst/mozilla"
           "@CMAKE_BINARY_DIR@/ui/trustbridge"
-          "@CMAKE_BINARY_DIR@/ui/trustbridge-tray-starter.sh")
+          "@CMAKE_BINARY_DIR@/ui/trustbridge-tray-starter.sh"
+          "$UNINSTALLER")
 
 ICON="@CMAKE_SOURCE_DIR@/ui/img/logo-128.png"
 HELPFILES=$(find @CMAKE_BINARY_DIR@/manuals/help-manual/html \
@@ -67,10 +69,6 @@
 install "${EXEFILES[@]}" "$TMPDIR/bin"
 install "$ICON" "$TMPDIR/share/pixmaps/trustbridge/trustbridge.png"
 
-echo "Building $INSTALLER..."
-cp "@CMAKE_BINARY_DIR@/packaging/linux-installer.inc" "$INSTALLER"
-process_includes "$INSTALLER" "@CMAKE_BINARY_DIR@/packaging"
-
 binnames=""
 for file in "${EXEFILES[@]}" ; do
   binnames="`basename $file` $binnames"
@@ -92,20 +90,32 @@
   helpnames_sources="`basename $file` $helpnames_sources"
 done
 
+echo "Building $INSTALLER and $UNINSTALLER ..."
+
+cp "@CMAKE_BINARY_DIR@/packaging/linux-installer.inc" "$INSTALLER"
+cp "@CMAKE_BINARY_DIR@/packaging/linux-uninstaller.inc" "$UNINSTALLER"
+
+declare -a INSTALLER_SCRIPTS
+INSTALLER_SCRIPTS=("$INSTALLER" "$UNINSTALLER")
+
+for script in "${INSTALLER_SCRIPTS[@]}" ; do
+  process_includes "$script" "@CMAKE_BINARY_DIR@/packaging"
+  sed -i "s/###BINNAMES###/${binnames}/" "$script"
+  sed -i "s/###ICONNAME###/trustbridge.png/" "$script"
+  sed -i "s/###HELPNAMES###/${helpnames}/" "$script"
+  sed -i "s/###HELPNAMES_SOURCES###/${helpnames_sources}/" "$script"
+  sed -i "s/###HELPNAMES_STATIC###/${helpnames_static}/" "$script"
+  sed -i "s/###HELPNAMES_IMG###/${helpnames_img}/" "$script"
+  sed -i "s/###ARCH###/${ARCH}/" "$script"
+  chmod +x "$script"
+done
+
 echo "Creating shar archive ..."
 cd "$TMPDIR"
 shar -z -B `find -type f` | sed 's/^exit 0//' >>"$TMPSHAR"
 
-sed -i "s/###BINNAMES###/${binnames}/" "$INSTALLER"
-sed -i "s/###ICONNAME###/trustbridge.png/" "$INSTALLER"
 sed -i "/###SHAR###/r $TMPSHAR" "$INSTALLER"
-sed -i "s/###HELPNAMES###/${helpnames}/" "$INSTALLER"
-sed -i "s/###HELPNAMES_SOURCES###/${helpnames_sources}/" "$INSTALLER"
-sed -i "s/###HELPNAMES_STATIC###/${helpnames_static}/" "$INSTALLER"
-sed -i "s/###HELPNAMES_IMG###/${helpnames_img}/" "$INSTALLER"
-sed -i "s/###ARCH###/${ARCH}/" "$INSTALLER"
 
-chmod +x "$INSTALLER"
 echo "Signing"
 "@CMAKE_SOURCE_DIR@/ui/tests/append-sig.sh" \
     "@CMAKE_SOURCE_DIR@/ui/tests/data/codesign/codesigning.key" \
--- a/packaging/linux-installer-common.inc.in	Thu Sep 18 11:43:54 2014 +0200
+++ b/packaging/linux-installer-common.inc.in	Thu Sep 18 13:29:32 2014 +0200
@@ -35,7 +35,7 @@
 )
 
 declare -A L10N_DE
-###INCLUDE:linux-installer.l10n-de
+###INCLUDE:linux-installer-common.l10n-de
 
 getxt()
 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/packaging/linux-installer-common.l10n-de	Thu Sep 18 13:29:32 2014 +0200
@@ -0,0 +1,7 @@
+L10N_DE+=(
+  ["Answer [Y]es or [N]o:\n"]="Bitte [J]a oder [N]ein eingeben:\n"
+  ["Deinstallation failed.\n"]="Deinstallation fehlgeschlagen.\n"
+  ["Installation failed.\n"]="Installation fehlgeschlagen.\n"
+  ["Reading '%s' ...\n"]="Lese '%s' ...\n"
+  ["System wide installation or deinstallation requires root privileges!\n"]="Für die systemweite Installation werden root-Rechte benötigt!\n"
+)
--- a/packaging/linux-installer-uninstall.inc	Thu Sep 18 11:43:54 2014 +0200
+++ b/packaging/linux-installer-uninstall.inc	Thu Sep 18 13:29:32 2014 +0200
@@ -1,4 +1,7 @@
 #-*-sh-*-
+
+###INCLUDE:linux-installer-uninstall.l10n-de
+
 rm_empty_dirs()
 {
   # Args: $1 - DIRECTORY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/packaging/linux-installer-uninstall.l10n-de	Thu Sep 18 13:29:32 2014 +0200
@@ -0,0 +1,19 @@
+L10N_DE+=(
+  ["Deinstallation finished.\n"]="Deinstallation abgeschlossen.\n"
+  ["Deinstalling from '%s'.\n"]="Deinstalliere aus '%s'.\n"
+  ["Deleting '%s' ...\n"]="Lösche '%s' ...\n"
+  ["Deleting empty directory '%s' ...\n"]="Lösche das leere Verzeichnis '%s' ...\n"
+  ["No certificate list found.  Nothing to do.\n"]="Keine Zertifikatsliste gefunden.  Es muss nichts getan werden.\n"
+  ["No current installation found!  No harm done.\n"]="Keine vorhandene Installation gefunden!\n"
+  ["Really deinstall TrustBridge from '%s'? [y/n]\n"]="Soll TrustBridge wirklich aus '%s' deinstalliert werden? [j/n]\n"
+  ["Removing PID file from: %s:\n"]="Entferne PID-File aus: %s\n"
+  ["Removing TrustBridge from autostart\n"]="Entferne TrustBridge aus autostart\n"
+  ["Removing TrustBridge from start menu\n"]="Entferne TrustBridge aus dem Startmenü\n"
+  ["Removing certificate lists from: %s:\n"]="Entferne Zertifikatsliste aus: %s\n"
+  ["Removing configuration files:\n"]="Entferne Konfigurationsdateien:\n"
+  ["Removing cron job ...\n"]="Entferne den Cron-Job ...\n"
+  ["Uninstalling certificates ...\n"]="Deinstalliere Zertifikate ...\n"
+  ["Using certificate list '%s'.\n"]="Die Zertifikatsliste '%s' wird verwendet.\n"
+  ["WARNING: Could not delete: '%s'!\n"]="WARNUNG: Konnte '%s' nicht löschen!\n"
+  ["WARNING: can't execute %s for certificate deinstallation.\n"]="WARNUNG: '%s' kann nicht zum deinstallieren der Zertifikate ausgeführt werden.\n"
+)
--- a/packaging/linux-installer.inc	Thu Sep 18 11:43:54 2014 +0200
+++ b/packaging/linux-installer.inc	Thu Sep 18 13:29:32 2014 +0200
@@ -33,6 +33,7 @@
 set -u
 
 ###INCLUDE:linux-installer-common.inc
+###INCLUDE:linux-installer.l10n-de
 
 ###INCLUDE:linux-installer-uninstall.inc
 
@@ -113,7 +114,7 @@
 
   getxt "To remove the application and the root certificates it has inserted,\n"
   getxt "call the deinstall command:\n"
-  echo "  $RUNCMD ${instcfg[PREFIX]}/bin/trustbridge-deinstall-TODO.sh"
+  echo "  $RUNCMD ${instcfg[PREFIX]}/bin/trustbridge-deinstall.sh"
 
   echo "#################################################################################"
   getxt "Press enter to launch '%s'\n" "${instcfg[PREFIX]}/bin/trustbridge"
--- a/packaging/linux-installer.l10n-de	Thu Sep 18 11:43:54 2014 +0200
+++ b/packaging/linux-installer.l10n-de	Thu Sep 18 13:29:32 2014 +0200
@@ -1,65 +1,43 @@
-L10N_DE=(
+L10N_DE+=(
+  ["                     installation with different prefix exists.\n"]="                     bereits eine Installation in einem andern Pfad existiert.\n"
+  ["      --help         display this help and exit\n"]="      --help         diese Hilfe anzeigen und beenden\n"
+  ["      --version      output version information and exit\n"]="      --version      Versions-Information ausgeben und beenden\n"
+  ["  -d, --deinstall    deinstall files from current installation\n"]="  -d, --deinstall    vorhandene Installation deinstallieren\n"
+  ["  -f, --force        install to given prefix, even when a current\n"]="  -f, --force        installiere in den angegebenen Installations-Pfad auch wenn\n"
+  ["  -p, --prefix=PATH  install files in PATH\n"]="  -p, --prefix=PATH  den Installations-Pfad PATH verwenden\n"
+  ["  -s, --system       create a system wide (de)installation\n"]="  -s, --system       eine systemweite (De)Installation durchführen\n"
   ["An existing installation (v%s) was detected!\n"]="Es wurde eine vorhandene Installation (v%s) gefunden!\n"
-  ["Answer [Y]es or [N]o:\n"]="Bitte [J]a oder [N]ein eingeben:\n"
-  ["call the deinstall command:\n"]="rufen Sie den De-Installationsbefehl auf:\n"
-  ["checking for uudecode ...\n"]="Prüfe uudecode ...\n"
   ["Cleaning up temporary stuff ...\n"]="Räume temporäre Dateien auf ...\n"
   ["Could not create '%s'!\n"]="Konnte '%s' nicht erstellen!\n"
-  ["creating installation directory ...\n"]="lege das Installations-Verzeichnis an ...\n"
-  ["  -d, --deinstall    deinstall files from current installation\n"]="  -d, --deinstall    vorhandene Installation deinstallieren\n"
-  ["Deinstallation failed.\n"]="Deinstallation fehlgeschlagen.\n"
-  ["Deinstallation finished.\n"]="Deinstallation abgeschlossen.\n"
-  ["Deinstalling from '%s'.\n"]="Deinstalliere aus '%s'.\n"
-  ["Deleting empty directory '%s' ...\n"]="Lösche das leere Verzeichnis '%s' ...\n"
-  ["Deleting '%s' ...\n"]="Lösche '%s' ...\n"
   ["Failed to create autostart directory: '%s'\n"]="Konnte das autostart-Verzeichnis '%s' nicht erstellen\n"
   ["Failed to create startmenu directory: '%s'\n"]="Konnte das Startmenü-Verzeichnis '%s' nicht erstellen\n"
-  ["  -f, --force        install to given prefix, even when a current\n"]="  -f, --force        installiere in den angegebenen Installations-Pfad auch wenn\n"
   ["For a new prefix you should deinstall first!\n"]="Um einen neuen Installations-Pfad zu verwenden bitte erst deinstallieren!\n"
   ["Found system uudecode.\n"]="System uudecode gefunden.\n"
-  ["      --help         display this help and exit\n"]="      --help         diese Hilfe anzeigen und beenden\n"
-  ["Installation failed.\n"]="Installation fehlgeschlagen.\n"
-  ["                     installation with different prefix exists.\n"]="                     bereits eine Installation in einem andern Pfad existiert.\n"
+  ["Install TrustBridge.\n\n"]="Installiere TrustBridge.\n\n"
   ["Installing to '%s':\n"]="Installiere in '%s':\n"
-  ["Install TrustBridge.\n\n"]="Installiere TrustBridge.\n\n"
   ["It appears your system architecture is %s.\n"]="Dieses System scheint eine %s Architektur zu besitzen.\n"
   ["It is HIGHLY RECOMMENDED to accept the default prefix\n"]="Es wird DRINGEND EMPFOHLEN die Vorgabe zu akzeptieren\n"
-  ["No certificate list found.  Nothing to do.\n"]="Keine Zertifikatsliste gefunden.  Es muss nichts getan werden.\n"
-  ["No current installation found!  No harm done.\n"]="Keine vorhandene Installation gefunden!\n"
   ["Options:\n"]="Optionen:\n"
-  ["  -p, --prefix=PATH  install files in PATH\n"]="  -p, --prefix=PATH  den Installations-Pfad PATH verwenden\n"
   ["Prefix differs from current installation (%s).  Aborting!\n"]="Installations-Pfad weicht von vorhandener Installation (%s) ab.\nVorgang abgebrochen!\n"
   ["Preparing trustbridge-tray-starter ...\n"]="Bereite trustbridge-tray-starter vor ...\n"
   ["Press enter to launch '%s'\n"]="Drücken Sie die Eingabetaste um '%s' auszuführen\n"
-  ["Reading '%s' ...\n"]="Lese '%s' ...\n"
-  ["Really deinstall TrustBridge from '%s'? [y/n]\n"]="Soll TrustBridge wirklich aus '%s' deinstalliert werden? [j/n]\n"
   ["Really install TrustBridge for '%s' systems? [y/n]\n"]="Soll TrustBridge für '%s' wirklich installiert werden? [j/n]\n"
-  ["Removing certificate lists from: %s:\n"]="Entferne Zertifikatsliste aus: %s\n"
-  ["Removing configuration files:\n"]="Entferne Konfigurationsdateien:\n"
-  ["Removing cron job ...\n"]="Entferne den Cron-Job ...\n"
-  ["Removing PID file from: %s:\n"]="Entferne PID-File aus: %s\n"
-  ["Removing TrustBridge from autostart\n"]="Entferne TrustBridge aus autostart\n"
-  ["Removing TrustBridge from start menu\n"]="Entferne TrustBridge aus dem Startmenü\n"
   ["Select installation prefix for TrustBridge [%s]: "]="Installations-Pfad für TrustBridge [%s]: "
   ["Setting up autostart ...\n"]="Konfiguriere autostart ...\n"
   ["Setting up cronjob ...\n"]="Konfiguriere den Cron-Job ...\n"
   ["Setting up start menu entries ...\n"]="Konfiguriere Startmenü-Einträge...\n"
   ["Single user installation successful.\n"]="Einzelnutzer Installation erfolgreich.\n"
-  ["  -s, --system       create a system wide (de)installation\n"]="  -s, --system       eine systemweite (De)Installation durchführen\n"
-  ["System wide installation or deinstallation requires root privileges!\n"]="Für die systemweite Installation werden root-Rechte benötigt!\n"
   ["System wide installation successful.\n"]="Systemweite Installation erfolgreich.\n"
   ["This installer is for 32 bit systems.\n"]="Dieses Installationspaket ist für 32 bit Systeme.\n"
   ["This installer is for 64 bit systems.\n"]="Dieses Installationspaket ist für 64 bit Systeme.\n"
   ["To remove the application and the root certificates it has inserted,\n"]="Um die Anwendung und die eingefügten Wurzelzertifikate zu entfernen,\n"
-  ["to update the current installation.\n"]="um die vorhandene Installation zu aktualisieren.\n"
   ["TrustBridge has been installed to: '%s'\n\n"]="TrustBridge wurde nach '%s' installiert\n\n"
-  ["Uninstalling certificates ...\n"]="Deinstalliere Zertifikate ...\n"
-  ["unpacking files ...\n"]="Entpacke Dateien ...\n"
   ["Usage: %s [OPTION]...\n"]="Aufruf:  %s [OPTION]...\n"
-  ["Using certificate list '%s'.\n"]="Die Zertifikatsliste '%s' wird verwendet.\n"
   ["Using python uudecode provided by installer.\n"]="Verwende vom Installer bereitgestelltes python uudecode.\n"
-  ["      --version      output version information and exit\n"]="      --version      Versions-Information ausgeben und beenden\n"
-  ["WARNING: can't execute %s for certificate deinstallation.\n"]="WARNUNG: '%s' kann nicht zum deinstallieren der Zertifikate ausgeführt werden.\n"
-  ["WARNING: Could not delete: '%s'!\n"]="WARNUNG: Konnte '%s' nicht löschen!\n"
   ["Writing installation configuration to: %s ...\n"]="Schreibe Installationskonfiguration nach: %s ...\n"
+  ["call the deinstall command:\n"]="rufen Sie den De-Installationsbefehl auf:\n"
+  ["checking for uudecode ...\n"]="Prüfe uudecode ...\n"
+  ["creating installation directory ...\n"]="lege das Installations-Verzeichnis an ...\n"
+  ["to update the current installation.\n"]="um die vorhandene Installation zu aktualisieren.\n"
+  ["unpacking files ...\n"]="Entpacke Dateien ...\n"
 )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/packaging/linux-uninstaller.inc	Thu Sep 18 13:29:32 2014 +0200
@@ -0,0 +1,69 @@
+#!/bin/bash
+set -u
+
+###INCLUDE:linux-installer-common.inc
+###INCLUDE:linux-uninstaller.l10n-de
+
+###INCLUDE:linux-installer-uninstall.inc
+
+DEINSTALL=1
+
+usage()
+{
+  getxt "Usage: %s [OPTION]...\n" "$ME"
+  getxt "Uninstall TrustBridge.\n\n"
+  getxt "Options:\n"
+  getxt "  -s, --system       do a system wide deinstallation\n"
+  getxt "      --help         display this help and exit\n"
+  getxt "      --version      output version information and exit\n"
+  exit $1
+}
+
+parse_args()
+{
+  OPTS=`getopt \
+      -l help,system,version \
+      -o s -n "$ME" -- "$@"`
+  [ $? -eq 0 ] || usage 23
+
+  eval set -- "$OPTS"
+
+  while true ; do
+    case "$1" in
+      --system|-s)
+        SYSINST=1
+        shift 1
+        ;;
+      --help)
+        usage 0
+        ;;
+      --version)
+        version
+        ;;
+      --)
+        shift
+        break
+        ;;
+    esac
+  done
+}
+
+#======================================================================
+# main()
+
+parse_args "$@"
+check_priv
+init_vars
+read_oldinstcfg
+
+cat <<EOF
+------------------------------------------------------------------------
+
+   TrustBridge - Uninstaller
+   Version ${instcfg[VERSION]} - ${ARCH} (Testversion)
+
+------------------------------------------------------------------------
+EOF
+
+deinstall
+exit 0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/packaging/linux-uninstaller.l10n-de	Thu Sep 18 13:29:32 2014 +0200
@@ -0,0 +1,8 @@
+L10N_DE+=(
+  ["      --help         display this help and exit\n"]="      --help         diese Hilfe anzeigen und beenden\n"
+  ["      --version      output version information and exit\n"]="      --version      Versions-Information ausgeben und beenden\n"
+  ["  -s, --system       do a system wide deinstallation\n"]="  -s, --system       Systemweit deinstallieren\n"
+  ["Options:\n"]="Optionen:\n"
+  ["Uninstall TrustBridge.\n\n"]="TrustBridge deinstallieren.\n\n"
+  ["Usage: %s [OPTION]...\n"]="Aufruf:  %s [OPTION]...\n"
+)

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