changeset 972:8be2f510adbf

(issue91) Make installer architecture aware.
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 28 Aug 2014 17:51:22 +0200
parents d3258a6faedd
children 6d8382a1b874
files packaging/create-dist-package.sh.in packaging/linux-createpackage.sh.in packaging/linux-installer.inc.in packaging/linux-installer.l10n-de ui/l10n/trustbridge_de_DE.ts
diffstat 5 files changed, 35 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/packaging/create-dist-package.sh.in	Thu Aug 28 15:03:10 2014 +0200
+++ b/packaging/create-dist-package.sh.in	Thu Aug 28 17:51:22 2014 +0200
@@ -27,10 +27,10 @@
 cd @CMAKE_SOURCE_DIR@/build-i386
 echo "Building x86 package"
 make -j`nproc`
-/bin/bash packaging/linux-createpackage.sh
+/bin/bash packaging/linux-createpackage.sh i386
 cd @CMAKE_BINARY_DIR@
 echo "Building amd64 package"
-/bin/bash packaging/linux-createpackage.sh
+/bin/bash packaging/linux-createpackage.sh x86_64
 mkdir -p $TMPDIR/linux
 mkdir -p $TMPDIR/windows
 mv @CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.sh \
--- a/packaging/linux-createpackage.sh.in	Thu Aug 28 15:03:10 2014 +0200
+++ b/packaging/linux-createpackage.sh.in	Thu Aug 28 17:51:22 2014 +0200
@@ -9,12 +9,20 @@
 TMPDIR=$(mktemp -d)
 TMPSHAR=$(mktemp "@CMAKE_BINARY_DIR@/shar.XXXXXXXXXX")
 
+ARCH="$1"
+
+if [ "$ARCH" != "i386" -a "$ARCH" != "x86_64" ]; then
+    echo "Usage $0 <architecture>"
+    echo "with archtiecture either i386 or x86_64"
+fi
+
 INSTALLER="@CMAKE_BINARY_DIR@/TrustBridge-@PROJECT_VERSION@.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")
+
 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")
@@ -74,6 +82,7 @@
 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"
--- a/packaging/linux-installer.inc.in	Thu Aug 28 15:03:10 2014 +0200
+++ b/packaging/linux-installer.inc.in	Thu Aug 28 17:51:22 2014 +0200
@@ -20,6 +20,7 @@
 HELPNAMES_SOURCES="###HELPNAMES_SOURCES###"
 HELPNAMES_STATIC="###HELPNAMES_STATIC###"
 HELPNAMES_IMG="###HELPNAMES_IMG###"
+ARCH="###ARCH###"
 
 declare -A instcfg oldinstcfg
 declare inst_default_prefix instdata_path instcfg_path instcfg_file
@@ -177,6 +178,7 @@
   fi
   instcfg_file="${instcfg_path}/${INSTCFGNAME}"
   extra_bin_path=`mktemp --tmpdir -d tmpbin.XXXXXXXXXX`
+  HOST_ARCH=$(uname -m)
 }
 
 cleanup()
@@ -501,11 +503,27 @@
 ------------------------------------------------------------------------
 
    TrustBridge - Installer
-   Version ${instcfg[VERSION]} (Testversion)
+   Version ${instcfg[VERSION]} - ${ARCH} (Testversion)
 
 ------------------------------------------------------------------------
 EOF
 
+if [ "$ARCH" == "x86_64" -a "$ARCH" != "$HOST_ARCH" ]; then
+    getxt "It appears your system architecture is %s.\n" "$HOST_ARCH"
+    getxt "This installer is for 64 bit systems.\n"
+    getxt "Really install TrustBridge for '%s' systems? [y/n]\n" "${ARCH}"
+    yorn || exit 0
+fi
+
+if [ "$ARCH" == "i386" ]; then
+    if [[ "$HOST_ARCH" != *86 ]]; then
+        getxt "It appears your system architecture is %s.\n" "$HOST_ARCH"
+        getxt "This installer is for 32 bit systems.\n"
+        getxt "Really install TrustBridge for '%s' systems? [y/n]\n" "${ARCH}"
+        yorn || exit 0
+    fi
+fi
+
 if [ $DEINSTALL -eq 1 ] ; then
     deinstall
     # Stop after deinstallation:
--- a/packaging/linux-installer.l10n-de	Thu Aug 28 15:03:10 2014 +0200
+++ b/packaging/linux-installer.l10n-de	Thu Aug 28 17:51:22 2014 +0200
@@ -52,4 +52,8 @@
   ["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"
+  ["It appears your system architecture is %s.\n"]="Dieses System scheint eine %s Architektur zu besitzen.\n"
+  ["This installer is for 64 bit systems.\n"]="Dieses Installationspaket ist für 64 bit Systeme.\n"
+  ["This installer is for 32 bit systems.\n"]="Dieses Installationspaket ist für 32 bit Systeme.\n"
+  ["Really install TrustBridge for '%s' systems? [y/n]\n"]="Soll TrustBridge für '%s' wirklich installiert werden? [j/n]\n"
 )
--- a/ui/l10n/trustbridge_de_DE.ts	Thu Aug 28 15:03:10 2014 +0200
+++ b/ui/l10n/trustbridge_de_DE.ts	Thu Aug 28 17:51:22 2014 +0200
@@ -129,7 +129,7 @@
     </message>
     <message>
         <location filename="../mainwindow.cpp" line="462"/>
-        <location filename="../mainwindow.cpp" line="590"/>
+        <location filename="../mainwindow.cpp" line="591"/>
         <source>Check for Updates</source>
         <translation type="unfinished"></translation>
     </message>

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