[PATCH 1 of 2] (issue70) Handle i386 and amd64 packages

Wald Commits scm-commit at wald.intevation.org
Fri Aug 8 10:59:44 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1407488184 -7200
# Node ID 1cc85fd3daa5728bb24184c8e8c14e19d9125659
# Parent  6abf8e77cd5ff0c7531a4644f699c698a9840b8d
(issue70) Handle i386 and amd64 packages

diff -r 6abf8e77cd5f -r 1cc85fd3daa5 packaging/create-dist-package.sh.in
--- a/packaging/create-dist-package.sh.in	Fri Aug 08 10:49:16 2014 +0200
+++ b/packaging/create-dist-package.sh.in	Fri Aug 08 10:56:24 2014 +0200
@@ -9,13 +9,34 @@
     exit 1
 fi
 
+if [ ! -f @CMAKE_SOURCE_DIR@/build-windows/Makefile ]; then
+    echo "Could not find a windows build in: @CMAKE_SOURCE_DIR@/build-windows "
+    exit 1
+fi
+
+if [ ! -f @CMAKE_SOURCE_DIR@/build-i386/Makefile ]; then
+    echo "Could not find a i386 build in: @CMAKE_SOURCE_DIR@/build-i386 "
+    exit 1
+fi
+
 TMPD=$(mktemp -d)
 TMPDIR=$TMPD/TrustBridge- at PROJECT_VERSION@
+cd @CMAKE_SOURCE_DIR@/build-windows
+echo "Updating windows build"
+make
+cd @CMAKE_SOURCE_DIR@/build-i386
+echo "Building x86 package"
+make
+/bin/bash packaging/linux-createpackage.sh
 cd @CMAKE_BINARY_DIR@
+echo "Building amd64 package"
 /bin/bash packaging/linux-createpackage.sh
 mkdir -p $TMPDIR/linux
 mkdir -p $TMPDIR/windows
-mv @CMAKE_BINARY_DIR@/TrustBridge- at PROJECT_VERSION@.sh $TMPDIR/linux
+mv @CMAKE_BINARY_DIR@/TrustBridge- at PROJECT_VERSION@.sh \
+    $TMPDIR/linux/TrustBridge- at PROJECT_VERSION@-amd64.sh
+mv @CMAKE_SOURCE_DIR@/build-i386/TrustBridge- at PROJECT_VERSION@.sh \
+    $TMPDIR/linux/TrustBridge- at PROJECT_VERSION@-i386.sh
 cp @CMAKE_SOURCE_DIR@/build-windows/ui/trustbridge.exe $TMPDIR/windows
 cp @CMAKE_SOURCE_DIR@/build-windows/cinst/cinst.exe $TMPDIR/windows
 cp @CMAKE_SOURCE_DIR@/build-windows/cinst/mozilla.exe $TMPDIR/windows
diff -r 6abf8e77cd5f -r 1cc85fd3daa5 ui/createinstallerdialog.cpp
--- a/ui/createinstallerdialog.cpp	Fri Aug 08 10:49:16 2014 +0200
+++ b/ui/createinstallerdialog.cpp	Fri Aug 08 10:56:24 2014 +0200
@@ -247,22 +247,31 @@
                 .arg(linuxDir.path()));
         return;
     }
-    if (candidates.size() > 1) {
-        showErrorMessage(tr("Unexpected additional .sh files in: %1")
-                .arg(linuxDir.path()));
-        return;
-    }
-    mProgress.setLabelText(tr("Signing Linux package..."));
-    mProgress.cancel();
 
-    QString outFileName = options.value("setupname", "TrustBridge-default.exe"
-            ).toString().replace(".exe", ".sh").arg(QString());
+    foreach (const QString& candidate, candidates) {
+        mProgress.setLabelText(tr("Signing Linux package..."));
+        mProgress.cancel();
 
-    if (!appendTextSignatureToFile(linuxDir.path() + "/" + candidates.first(),
-                outDir.path() + "/" + outFileName)) {
-        qDebug() << "Failed to sign linux package.";
-        mProgress.close();
-        return;
+        bool x86arch;
+        if (candidate.endsWith("-i386.sh")) {
+            x86arch = true;
+        } else if (candidate.endsWith("-amd64.sh")) {
+            x86arch = false;
+        } else {
+            qDebug() << "Could not detrmine architecture of " << candidate;
+            qDebug() << "Skipping.";
+        }
+
+        QString outFileName = options.value("setupname", "TrustBridge-default.exe"
+                ).toString().replace(".exe",
+                    x86arch ? "-x86arch.sh" : "-64bit.sh").arg(QString());
+
+        if (!appendTextSignatureToFile(linuxDir.path() + "/" + candidate,
+                    outDir.path() + "/" + outFileName)) {
+            showErrorMessage(tr("Failed to sign linux package: %1").arg(candidate));
+            mProgress.close();
+            return;
+        }
     }
 
     /* The Windows installer */
diff -r 6abf8e77cd5f -r 1cc85fd3daa5 ui/mainwindow.cpp
--- a/ui/mainwindow.cpp	Fri Aug 08 10:49:16 2014 +0200
+++ b/ui/mainwindow.cpp	Fri Aug 08 10:56:24 2014 +0200
@@ -55,14 +55,20 @@
 
 #define SERVER_URL "https://files.intevation.de:443"
 
+#if defined(_X86_) || defined(__i386__)
+#define TB_ARCH_STRING "-i386"
+#else
+#define TB_ARCH_STRING "-amd64"
+#endif
+
 #ifdef RELEASE_BUILD
 # define LIST_RESOURCE "/users/aheinecke/zertifikatsliste.txt"
 # ifdef Q_OS_WIN
 #  define SW_RESOURCE_VERSION "/users/aheinecke/TrustBridge-%1.exe"
 #  define SW_RESOURCE "/users/aheinecke/TrustBridge.exe"
 # else
-#  define SW_RESOURCE_VERSION "/users/aheinecke/TrustBridge-%1.sh"
-#  define SW_RESOURCE "/users/aheinecke/TrustBridge.sh"
+#  define SW_RESOURCE_VERSION "/users/aheinecke/TrustBridge-%1" TB_ARCH_STRING ".sh"
+#  define SW_RESOURCE "/users/aheinecke/TrustBridge" TB_ARCH_STRING ".sh"
 # endif
 #else // RELEASE_BUILD
 # define LIST_RESOURCE "/users/aheinecke/development/zertifikatsliste.txt"
@@ -70,8 +76,8 @@
 #  define SW_RESOURCE_VERSION "/users/aheinecke/development/TrustBridge-development.exe"
 #  define SW_RESOURCE "/users/aheinecke/development/TrustBridge.exe"
 # else
-#  define SW_RESOURCE_VERSION "/users/aheinecke/development/TrustBridge-development.sh"
-#  define SW_RESOURCE "/users/aheinecke/development/TrustBridge.sh"
+#  define SW_RESOURCE_VERSION "/users/aheinecke/development/TrustBridge-development" TB_ARCH_STRING ".sh"
+#  define SW_RESOURCE "/users/aheinecke/development/TrustBridge" TB_ARCH_STRING ".sh"
 # endif
 #endif
 


More information about the Trustbridge-commits mailing list