[PATCH 3 of 3] (issue89) Add help packaging for Linux installer

Wald Commits scm-commit at wald.intevation.org
Fri Aug 22 19:16:50 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1408727791 -7200
# Node ID 15f7b3ebf21bc5a94df6270030b6f9a6ef424403
# Parent  f6b52f60f64358b1aa0cf69ef56997a59249bc61
(issue89) Add help packaging for Linux installer

diff -r f6b52f60f643 -r 15f7b3ebf21b packaging/linux-createpackage.sh.in
--- a/packaging/linux-createpackage.sh.in	Fri Aug 22 19:15:31 2014 +0200
+++ b/packaging/linux-createpackage.sh.in	Fri Aug 22 19:16:31 2014 +0200
@@ -16,6 +16,14 @@
           "@CMAKE_BINARY_DIR@/ui/trustbridge"
           "@CMAKE_BINARY_DIR@/ui/trustbridge-tray-starter.sh")
 ICON="@CMAKE_SOURCE_DIR@/ui/img/logo-128.png"
+HELPFILES=$(find @CMAKE_BINARY_DIR@/manuals/help-manual/html \
+    -maxdepth 1 -type f -printf "%p \n")
+HELPFILES_STATIC=$(find @CMAKE_BINARY_DIR@/manuals/help-manual/html/_static \
+    -maxdepth 1 -type f -printf "%p \n")
+HELPFILES_IMG=$(find @CMAKE_BINARY_DIR@/manuals/help-manual/html/_images \
+    -maxdepth 1 -type f -printf "%p \n")
+HELPFILES_SOURCES=$(find @CMAKE_BINARY_DIR@/manuals/help-manual/html/_sources \
+    -maxdepth 1 -type f -printf "%p \n")
 
 L10N_DE_FILE="@CMAKE_BINARY_DIR@/packaging/linux-installer.l10n-de"
 
@@ -24,23 +32,49 @@
 echo "Using $TMPDIR for temporary installation to build installer..."
 install -d "$TMPDIR/bin"
 install -d "$TMPDIR/share/pixmaps/trustbridge"
+install -d "$TMPDIR/share/doc/trustbridge"
+install -d "$TMPDIR/share/doc/trustbridge/_static"
+install -d "$TMPDIR/share/doc/trustbridge/_sources"
+install -d "$TMPDIR/share/doc/trustbridge/_images"
 install "${EXEFILES[@]}" "$TMPDIR/bin"
 install "$ICON" "$TMPDIR/share/pixmaps/trustbridge/trustbridge.png"
 
-echo "Creating shar archive ..."
-cd "$TMPDIR"
-shar -z -B bin/* share/pixmaps/trustbridge/trustbridge.png | sed 's/^exit 0//' >>"$TMPSHAR"
-
 echo "Building $INSTALLER..."
 cp "@CMAKE_BINARY_DIR@/packaging/linux-installer.inc" "$INSTALLER"
 binnames=""
 for file in "${EXEFILES[@]}" ; do
   binnames="`basename $file` $binnames"
 done
+for file in ${HELPFILES} ; do
+  install "$file" "$TMPDIR/share/doc/trustbridge"
+  helpnames="`basename $file` $helpnames"
+done
+for file in ${HELPFILES_IMAGES} ; do
+  install "$file" "$TMPDIR/share/doc/trustbridge/_images"
+  helpnames_img="`basename $file` $helpnames_img"
+done
+for file in ${HELPFILES_STATIC} ; do
+  install "$file" "$TMPDIR/share/doc/trustbridge/_static"
+  helpnames_static="`basename $file` $helpnames_static"
+done
+for file in ${HELPFILES_SOURCES}; do
+  install "$file" "$TMPDIR/share/doc/trustbridge/_sources"
+  helpnames_sources="`basename $file` $helpnames_sources"
+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 "/###L10N_DE###/r $L10N_DE_FILE" "$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
+
 chmod +x "$INSTALLER"
 echo "Signing"
 @CMAKE_SOURCE_DIR@/ui/tests/append-sig.sh @CMAKE_SOURCE_DIR@/ui/tests/data/codesign/codesigning.key \
diff -r f6b52f60f643 -r 15f7b3ebf21b packaging/linux-installer.inc.in
--- a/packaging/linux-installer.inc.in	Fri Aug 22 19:15:31 2014 +0200
+++ b/packaging/linux-installer.inc.in	Fri Aug 22 19:16:31 2014 +0200
@@ -16,6 +16,10 @@
 DEINSTALL=0
 BINNAMES="###BINNAMES###"
 ICONNAME="###ICONNAME###"
+HELPNAMES="###HELPNAMES###"
+HELPNAMES_SOURCES="###HELPNAMES_SOURCES###"
+HELPNAMES_STATIC="###HELPNAMES_STATIC###"
+HELPNAMES_IMG="###HELPNAMES_IMG###"
 
 declare -A instcfg oldinstcfg
 declare inst_default_prefix instdata_path instcfg_path instcfg_file
@@ -333,6 +337,50 @@
         rm "$path" || getxt >&2 "WARNING: Could not delete: '%s'!\n" "$path"
       done
       rm_empty_dirs "$deinstdir"
+
+      # images
+      deinstdir="${oldinstcfg[PREFIX]}/share/doc/trustbridge/_images"
+      for file in $HELPNAMES_IMG; do
+        local path="${deinstdir}/$file"
+        if [ -f "$path" ]; then
+          getxt "Deleting '%s' ...\n" "$path"
+          rm "$path" || getxt >&2 "WARNING: Could not delete: '%s'!\n" "$path"
+        fi
+      done
+      rm_empty_dirs "$deinstdir"
+
+      # Javascript sources
+      deinstdir="${oldinstcfg[PREFIX]}/share/doc/trustbridge/_sources"
+      for file in $HELPNAMES_SOURCES; do
+        local path="${deinstdir}/$file"
+        if [ -f "$path" ]; then
+          getxt "Deleting '%s' ...\n" "$path"
+          rm "$path" || getxt >&2 "WARNING: Could not delete: '%s'!\n" "$path"
+        fi
+      done
+      rm_empty_dirs "$deinstdir"
+
+      # Static files
+      deinstdir="${oldinstcfg[PREFIX]}/share/doc/trustbridge/_static"
+      for file in $HELPNAMES_STATIC; do
+        local path="${deinstdir}/$file"
+        if [ -f "$path" ]; then
+          getxt "Deleting '%s' ...\n" "$path"
+          rm "$path" || getxt >&2 "WARNING: Could not delete: '%s'!\n" "$path"
+        fi
+      done
+      rm_empty_dirs "$deinstdir"
+
+      # The actual html
+      deinstdir="${oldinstcfg[PREFIX]}/share/doc/trustbridge"
+      for file in $HELPNAMES; do
+        local path="${deinstdir}/$file"
+        if [ -f "$path" ]; then
+          getxt "Deleting '%s' ...\n" "$path"
+          rm "$path" || getxt >&2 "WARNING: Could not delete: '%s'!\n" "$path"
+        fi
+      done
+      rm_empty_dirs "$deinstdir"
       deinstdir="${oldinstcfg[PREFIX]}/share/pixmaps/trustbridge"
       getxt "Deinstalling from '%s'.\n" "${oldinstcfg[PREFIX]}"
       for file in $ICONNAME; do


More information about the Trustbridge-commits mailing list