diff options
| author | Danilo M. <danix@danix.xyz> | 2026-07-14 16:59:44 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-07-14 16:59:44 +0200 |
| commit | 3cd610c212076d438f2d1103e0fc584a310011d5 (patch) | |
| tree | b82bd71ff139408dc84f685345862f944653966b /install.sh | |
| download | sbo-dockerbuild-3cd610c212076d438f2d1103e0fc584a310011d5.tar.gz sbo-dockerbuild-3cd610c212076d438f2d1103e0fc584a310011d5.zip | |
initial commit: docker test-build toolchain
Extracted from the .extras/ dir of the sbo-slackbuilds package repo, where it
grew from a throwaway helper into a standalone tool. Git history starts fresh;
the original 41-commit development log is preserved in HISTORY.md.
Contents: the test-build CLI (resolves a local SlackBuild's deps from a
configured SBo tree and builds it in a throwaway container, lints, caches deps),
the image-builder chain that produces the images it consumes, their pure-logic
self-checks, design specs/plans, an install.sh for ~/bin, and docs.
Licensed GPLv2-only.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'install.sh')
| -rwxr-xr-x | install.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..8be02f0 --- /dev/null +++ b/install.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# Copyright (C) 2026 Danilo M. <danix@danix.xyz> +# +# 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. +# +# Install the test-build CLI into ~/bin (override with BINDIR=...). Copies the +# file, so re-run after editing. The image-builder scripts are NOT installed: +# they run on the docker host from their own checkout. +# +# ./install.sh install to ~/bin +# BINDIR=/usr/local/bin ./install.sh +# ./install.sh --uninstall remove it + +set -euo pipefail +HERE="$(cd "$(dirname "$0")" && pwd)" +BINDIR="${BINDIR:-$HOME/bin}" +PROG=test-build + +if [[ "${1:-}" == "--uninstall" ]]; then + rm -f "$BINDIR/$PROG" && echo "removed $BINDIR/$PROG" + exit 0 +fi + +[[ -f "$HERE/$PROG" ]] || { echo "$PROG not found in $HERE" >&2; exit 1; } +mkdir -p "$BINDIR" +install -m 0755 "$HERE/$PROG" "$BINDIR/$PROG" +echo "installed $BINDIR/$PROG" + +case ":$PATH:" in + *":$BINDIR:"*) ;; + *) echo "note: $BINDIR is not in \$PATH; add it (e.g. in ~/.bashrc):" + echo " export PATH=\"$BINDIR:\$PATH\"" ;; +esac |
