[PATCH] (issue68) Package licenses

Wald Commits scm-commit at wald.intevation.org
Thu Sep 25 12:44:00 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1411641836 -7200
# Node ID 014586ef8a84fa64e0963c57eaa1e55d9e8893fe
# Parent  9f5893faa60bbb6a47b3ffb936e9301b624e6085
(issue68) Package licenses

diff -r 9f5893faa60b -r 014586ef8a84 packaging/create-dist-package.sh.in
--- 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
diff -r 9f5893faa60b -r 014586ef8a84 packaging/linux-createpackage.sh.in
--- 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
 
diff -r 9f5893faa60b -r 014586ef8a84 packaging/linux-installer-common.inc.in
--- 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
diff -r 9f5893faa60b -r 014586ef8a84 packaging/linux-installer-uninstall.inc
--- 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
diff -r 9f5893faa60b -r 014586ef8a84 packaging/win-createpackage.sh.in
--- 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


More information about the Trustbridge-commits mailing list