Skip to content

Commit af5de74

Browse files
Update pack.sh
Co-Authored-By: Matthew John Cheetham <[email protected]>
1 parent 17f03be commit af5de74

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

src/linux/Packaging.Linux/pack.sh

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,17 @@ fi
5555
if [ -z "$SYMBOLS" ]; then
5656
die "--symbols was not set"
5757
fi
58-
if [ -z "$ARCH" ]; then
59-
die "--arch was not set"
58+
if [ -z "$RUNTIME" ]; then
59+
die "--runtime was not set"
6060
fi
6161

6262
TAROUT="$PROJ_OUT/$CONFIGURATION/tar/"
63-
TARBALL="$TAROUT/gcm-linux_$ARCH.$VERSION.tar.gz"
64-
SYMTARBALL="$TAROUT/gcm-linux_$ARCH.$VERSION-symbols.tar.gz"
63+
TARBALL="$TAROUT/gcm-$RUNTIME.$VERSION.tar.gz"
64+
SYMTARBALL="$TAROUT/gcm-$RUNTIME.$VERSION-symbols.tar.gz"
6565

6666
DEBOUT="$PROJ_OUT/$CONFIGURATION/deb"
6767
DEBROOT="$DEBOUT/root"
68-
DEBPKG="$DEBOUT/gcm-linux_$ARCH.$VERSION.deb"
68+
DEBPKG="$DEBOUT/gcm-$RUNTIME.$VERSION.deb"
6969
mkdir -p "$DEBROOT"
7070

7171
# Set full read, write, execute permissions for owner and just read and execute permissions for group and other
@@ -100,6 +100,22 @@ INSTALL_TO="$DEBROOT/usr/local/share/gcm-core/"
100100
LINK_TO="$DEBROOT/usr/local/bin/"
101101
mkdir -p "$DEBROOT/DEBIAN" "$INSTALL_TO" "$LINK_TO" || exit 1
102102

103+
# Determine architecture for debian control file from the runtime architecture
104+
case $RUNTIME in
105+
linux-x64)
106+
ARCH="amd64"
107+
;;
108+
linux-arm64)
109+
ARCH="arm64"
110+
;;
111+
linux-arm)
112+
ARCH="armhf"
113+
;;
114+
*)
115+
die "Incompatible runtime architecture given for pack.sh"
116+
;;
117+
esac
118+
103119
# make the debian control file
104120
# this is purposefully not indented, see
105121
# https://stackoverflow.com/questions/9349616/bash-eof-in-if-statement

0 commit comments

Comments
 (0)