diff packaging/linux-createpackage.sh.in @ 1150:a72d59f8c3ea

Create uninstaller.
author Sascha Wilde <wilde@intevation.de>
date Thu, 18 Sep 2014 13:27:57 +0200
parents 45de97d43e13
children e210ecc32d69
line wrap: on
line diff
--- a/packaging/linux-createpackage.sh.in	Thu Sep 18 12:04:30 2014 +0200
+++ b/packaging/linux-createpackage.sh.in	Thu Sep 18 13:27:57 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" \

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