aboutsummaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2023-01-17 14:07:33 -0800
committerGerald Combs <gerald@wireshark.org>2023-01-18 14:26:33 -0800
commitde7ca4c64a8aa5a1f1c62d351928bbf870e6bc18 (patch)
treec74a47d56fd1c94c6c31c47d593afa40a24f2502 /packaging
parent5a9812ab6130c241ff304c2b76f0b57fb7cccde6 (diff)
Packaging: Add a Logray AppImage package
Diffstat (limited to 'packaging')
-rw-r--r--packaging/appimage/Logray-AppRun.in41
1 files changed, 41 insertions, 0 deletions
diff --git a/packaging/appimage/Logray-AppRun.in b/packaging/appimage/Logray-AppRun.in
new file mode 100644
index 0000000000..87698570bf
--- /dev/null
+++ b/packaging/appimage/Logray-AppRun.in
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# Custom AppRun entry point that allows symlinking multiple
+# executables, e.g. logray, tshark, dumpcap, editcap, etc.
+
+# Adapted from
+# https://github.com/probonopd/ippsample/blob/feature/appimage/appimage/AppRun
+
+SELF=$(readlink -f "$0")
+HERE=${SELF%/*}
+
+# https://github.com/AppImage/AppImageKit/issues/126
+export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}"
+
+# We should probably set these relative to the program path in
+# wsutil/filesystem.c
+if [ -z "$LOGRAY_DATA_DIR" ] ; then
+ export LOGRAY_DATA_DIR="$APPDIR@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_DATADIR@/wireshark"
+fi
+
+if [ -z "$LOGRAY_EXTCAP_DIR" ] ; then
+ export LOGRAY_EXTCAP_DIR="$APPDIR@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/wireshark/extcap"
+fi
+
+if [ -z "$LOGRAY_PLUGIN_DIR" ] ; then
+ export LOGRAY_PLUGIN_DIR="$APPDIR@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/wireshark/plugins"
+fi
+
+# See if we were called by runtime.c, which sets APPIMAGE, ARGV0,
+# and APPDIR.
+if [ -n "$APPIMAGE" ] && [ -n "$ARGV0" ] ; then
+ BINARY_NAME=${ARGV0##*/}
+else
+ BINARY_NAME=${0##*/}
+fi
+
+if [ -e "$HERE/usr/bin/$BINARY_NAME" ] ; then
+ exec "$HERE/usr/bin/$BINARY_NAME" "$@"
+else
+ exec "$HERE/usr/bin/logray" "$@"
+fi