From 7830b3c5e89f0339949940b8986bf4849ad7f223 Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 1 Nov 2026 21:35:30 +0100 Subject: v4.3.0: package the desktop app with verifiable installers publish.sh builds the GUI with the gui-release profile, names it zagan-bet-gui---, and renders a bash and a PowerShell installer next to each app. Both embed the app's SHA-256, verify the file (or fetch it), install per-user and add a launcher: a desktop entry plus an SVG icon on Linux, a Start-menu shortcut on Windows. The download page gains a Desktop app section with the apps and installers, keeps the terminal client and server, links the public git repository for the GPL source, and lists every file in the sha256sum block. deploy.sh verifies all four artifact kinds. Publishing refuses a dirty tree so the linked history matches the binaries. --- scripts/installers/linux.sh.in | 78 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 scripts/installers/linux.sh.in (limited to 'scripts/installers/linux.sh.in') diff --git a/scripts/installers/linux.sh.in b/scripts/installers/linux.sh.in new file mode 100644 index 0000000..5b53c02 --- /dev/null +++ b/scripts/installers/linux.sh.in @@ -0,0 +1,78 @@ +#!/usr/bin/env bash +# Zagan-Bet desktop installer for Linux. +# +# Verifies the app against its published SHA-256, installs it for the current +# user and adds a launcher. Put the downloaded app next to this script, or run +# the script on its own and it will fetch the matching binary. +set -euo pipefail + +VERSION="__VERSION__" +BINARY="__BINARY__" +SHA256="__SHA256__" +URL="__URL__" + +say() { printf '%s\n' "$*"; } +die() { printf 'install: %s\n' "$*" >&2; exit 1; } + +command -v sha256sum >/dev/null 2>&1 || die "sha256sum is required" + +here=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +source_file="" +for candidate in "$here/$BINARY" "./$BINARY" "$HOME/Downloads/$BINARY"; do + if [ -f "$candidate" ]; then + source_file=$candidate + break + fi +done + +cleanup="" +if [ -z "$source_file" ]; then + command -v curl >/dev/null 2>&1 || die "put $BINARY next to this installer, or install curl" + cleanup=$(mktemp) || die "cannot create a temporary file" + say "Downloading $BINARY..." + curl -fsSL --max-time 300 "$URL" -o "$cleanup" || die "download failed" + source_file=$cleanup +fi +trap 'if [ -n "$cleanup" ]; then rm -f "$cleanup"; fi' EXIT + +actual=$(sha256sum "$source_file" | awk '{print $1}') +[ "$actual" = "$SHA256" ] || die "checksum mismatch: expected $SHA256, got $actual" + +bin_dir="${XDG_BIN_HOME:-$HOME/.local/bin}" +data_dir="${XDG_DATA_HOME:-$HOME/.local/share}" +app="$bin_dir/zagan-bet-gui" +desktop_dir="$data_dir/applications" +icon_dir="$data_dir/icons/hicolor/scalable/apps" + +mkdir -p "$bin_dir" "$desktop_dir" "$icon_dir" +install -m 0755 "$source_file" "$app" + +cat > "$icon_dir/zagan-bet.svg" <<'ICON' +__ICON__ +ICON + +cat > "$desktop_dir/zagan-bet.desktop" </dev/null 2>&1; then + update-desktop-database "$desktop_dir" >/dev/null 2>&1 || true +fi +if command -v gtk-update-icon-cache >/dev/null 2>&1; then + gtk-update-icon-cache -q "$data_dir/icons/hicolor" >/dev/null 2>&1 || true +fi + +say "Installed Zagan-Bet $VERSION to $app" +say "A launcher was added to your applications menu." +case ":$PATH:" in + *":$bin_dir:"*) ;; + *) say "Add $bin_dir to PATH to start it as 'zagan-bet-gui'." ;; +esac -- cgit v1.2.3