changeset 1249:014586ef8a84

(issue68) Package licenses
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 25 Sep 2014 12:43:56 +0200
parents 9f5893faa60b
children 7ea3a4c0e2ae
files packaging/create-dist-package.sh.in packaging/linux-createpackage.sh.in packaging/linux-installer-common.inc.in packaging/linux-installer-uninstall.inc packaging/win-createpackage.sh.in
diffstat 5 files changed, 41 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/packaging/create-dist-package.sh.in	Thu Sep 25 12:04:54 2014 +0200
+++ b/packaging/create-dist-package.sh.in	Thu Sep 25 12:43:56 2014 +0200
@@ -52,6 +52,7 @@
 cp -r @CMAKE_SOURCE_DIR@/packaging/resources $TMPDIR/resources
 cp @CMAKE_SOURCE_DIR@/build-windows/packaging/DesktopShellRun.dll $TMPDIR/resources
 cp -r @CMAKE_BINARY_DIR@/doc/help/client/html $TMPDIR/windows/doc
+cp -r @CMAKE_SOURCE_DIR@/licenses $TMPDIR/windows/licenses
 
 echo "; This file is autogenerated." > $TMPDIR/resources/filelist_in.nsh
 echo "; This file is autogenerated." > $TMPDIR/resources/filelist_un.nsh
@@ -65,6 +66,15 @@
     fi
     echo Delete \"\$INSTDIR\\$file\" >> $TMPDIR/resources/filelist_un.nsh
 done
+
+cd $TMPDIR/windows/licenses
+echo SetOutPath \"\$INSTDIR\\licenses\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh
+for file in `find * -type f`; do
+    echo File \"\${files_dir}\${path_sep}licenses\${path_sep}$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh
+    echo Delete \"\$INSTDIR\\licenses\\$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh
+done
+echo RmDir \"\$INSTDIR\\licenses\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh
+
 cd $TMPDIR/windows/doc
 
 for curdir in `find * -maxdepth 0 -type d -not -path .`; do
--- a/packaging/linux-createpackage.sh.in	Thu Sep 25 12:04:54 2014 +0200
+++ b/packaging/linux-createpackage.sh.in	Thu Sep 25 12:43:56 2014 +0200
@@ -56,6 +56,8 @@
     -maxdepth 1 -type f -printf "%p \n")
 HELPFILES_SOURCES=$(find @CMAKE_BINARY_DIR@/doc/help/client/html/_sources \
     -maxdepth 1 -type f -printf "%p \n")
+LICENSES=$(find @CMAKE_SOURCE_DIR@/licenses \
+    -maxdepth 1 -type f -printf "%p \n")
 
 # Make installation in TMPDIR, this is what we will put into the
 # shar-archive.
@@ -66,6 +68,7 @@
 install -d "$TMPDIR/share/doc/trustbridge/_static"
 install -d "$TMPDIR/share/doc/trustbridge/_sources"
 install -d "$TMPDIR/share/doc/trustbridge/_images"
+install -d "$TMPDIR/share/doc/trustbridge/licenses"
 install "${EXEFILES[@]}" "$TMPDIR/bin"
 install "$ICON" "$TMPDIR/share/pixmaps/trustbridge/trustbridge.png"
 
@@ -89,6 +92,10 @@
   install "$file" "$TMPDIR/share/doc/trustbridge/_sources"
   helpnames_sources="`basename $file` $helpnames_sources"
 done
+for file in ${LICENSES}; do
+  install "$file" "$TMPDIR/share/doc/trustbridge/licenses"
+  licensenames="`basename $file` $licensenames"
+done
 
 echo "Building $INSTALLER and $UNINSTALLER ..."
 
@@ -107,6 +114,7 @@
   sed -i "s/###HELPNAMES_STATIC###/${helpnames_static}/" "$script"
   sed -i "s/###HELPNAMES_IMG###/${helpnames_img}/" "$script"
   sed -i "s/###ARCH###/${ARCH}/" "$script"
+  sed -i "s/###LICENSES###/${licensenames}/" "$script"
   chmod +x "$script"
 done
 
--- a/packaging/linux-installer-common.inc.in	Thu Sep 25 12:04:54 2014 +0200
+++ b/packaging/linux-installer-common.inc.in	Thu Sep 25 12:43:56 2014 +0200
@@ -21,6 +21,7 @@
 HELPNAMES_SOURCES="###HELPNAMES_SOURCES###"
 HELPNAMES_STATIC="###HELPNAMES_STATIC###"
 HELPNAMES_IMG="###HELPNAMES_IMG###"
+LICENSENAMES="###LICENSES###"
 ARCH="###ARCH###"
 
 declare -A instcfg oldinstcfg
--- a/packaging/linux-installer-uninstall.inc	Thu Sep 25 12:04:54 2014 +0200
+++ b/packaging/linux-installer-uninstall.inc	Thu Sep 25 12:43:56 2014 +0200
@@ -134,6 +134,17 @@
       done
       rm_empty_dirs "$deinstdir"
 
+      # Licenses
+      deinstdir="${oldinstcfg[PREFIX]}/share/doc/trustbridge/licenses"
+      for file in $LICENSENAMES; 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
--- a/packaging/win-createpackage.sh.in	Thu Sep 25 12:04:54 2014 +0200
+++ b/packaging/win-createpackage.sh.in	Thu Sep 25 12:43:56 2014 +0200
@@ -13,9 +13,11 @@
 
 EXEFILES=$(find . -name trustbridge-certificate-installer.exe -o -name trustbridge.exe -o -name trustbridge-nss-installer.exe)
 HELPDIR=@CMAKE_BINARY_DIR@/doc/help/client/html
+LICENSE_DIR=@CMAKE_SOURCE_DIR@/licenses
 
 cp $EXEFILES $TMPDIR
 cp -r $HELPDIR $TMPDIR/doc
+cp -r $LICENSE_DIR $TMPDIR/licenses
 
 echo "; This file is autogenerated." > @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh
 echo "; This file is autogenerated." > @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh
@@ -29,6 +31,15 @@
     fi
     echo Delete \"\$INSTDIR\\$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh
 done
+
+cd $TMPDIR/licenses
+echo SetOutPath \"\$INSTDIR\\licenses\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh
+for file in `find * -type f`; do
+    echo File \"\${files_dir}\${path_sep}licenses\${path_sep}$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_in.nsh
+    echo Delete \"\$INSTDIR\\licenses\\$file\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh
+done
+echo RmDir \"\$INSTDIR\\licenses\" >> @CMAKE_CURRENT_BINARY_DIR@/filelist_un.nsh
+
 cd $TMPDIR/doc
 
 for curdir in `find * -maxdepth 0 -type d -not -path .`; do

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