From 9c0a9b3c804e14e6d5193733f652b88ddd5abbaa Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 19 Oct 2026 19:12:40 +0200 Subject: Add launcher, install script and usage docs Co-Authored-By: Claude Opus 5.5 --- install.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 install.sh (limited to 'install.sh') diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..464bde9 --- /dev/null +++ b/install.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# sb-builder - install the GUI locally, or the helper on the VM +# Copyright (C) 2026 Danilo M. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +# ./install.sh symlink the launcher into ~/bin (BINDIR overrides), +# create the GUI config from the example if missing +# ./install.sh --remote deploy remote/sbb-remote to the VM (SBB_TARGET, +# default buildsystem) and create its config if missing + +set -euo pipefail +here=$(dirname "$(readlink -f "$0")") + +if [[ ${1:-} == --remote ]]; then + target=${SBB_TARGET:-buildsystem} + read -rp "Deploy sbb-remote to $target:/usr/local/bin (config created only if missing)? [y/N] " a + [[ $a =~ ^[Yy]$ ]] || exit 1 + scp -q "$here/remote/sbb-remote" "$target:/usr/local/bin/sbb-remote" + scp -q "$here/remote/config.example.toml" "$target:/tmp/sbb-config.example.toml" + ssh "$target" 'chmod 755 /usr/local/bin/sbb-remote && + mkdir -p /etc/sb-builder && + { [ -e /etc/sb-builder/config.toml ] || cp /tmp/sbb-config.example.toml /etc/sb-builder/config.toml; } && + rm -f /tmp/sbb-config.example.toml && + sbb-remote version' + exit +fi + +bindir=${BINDIR:-$HOME/bin} +cfgdir=${XDG_CONFIG_HOME:-$HOME/.config}/sb-builder +mkdir -p "$bindir" "$cfgdir" +ln -sfn "$here/sb-builder" "$bindir/sb-builder" +[[ -e $cfgdir/config.toml ]] || cp "$here/config.example.toml" "$cfgdir/config.toml" +echo "installed $bindir/sb-builder -> $here/sb-builder, config in $cfgdir/config.toml" -- cgit v1.2.3