Harden install, update and uninstall; add shared lib and tests
Updates - install-compiled.sh never prompts: unknown versions rebuild, a missing version= fails - Detect VARA Terminal by "VARA Terminal.exe" in drive_c/VARA, not by the folder VARA HF also uses - install-windows-apps.sh checks first: nothing is downloaded and winetricks doesn't run unless a product is missing, and installers only run with a desktop session - Flatpaks install system-wide from flathub and honor skip-packages - Rewrite desktop files on every run so icon paths stay right; add the missing QtTermTCP desktop file - Build steps can't read the rest of the conf through stdin Uninstall - update.sh records the packages and Flatpaks HamPack itself installed; hampackremove removes only those that nothing else needs, and lists the rest - Read package lists from packages.conf instead of copies, remove files from install manifests, conf install paths and older builds, and revert the Wine Decorated setting Security - Replace the NOPASSWD sudoers file with a sudo keepalive, and delete a leftover /etc/sudoers.d/hampack - Verify binaries.conf downloads against sha256=; pin dx.py to a commit - Graywolf's web UI listens on 127.0.0.1; update.sh manages its unit - Install direwolf and kiwix through a staging directory with install_staged, so nothing in ~/.local ends up owned by root; hand back any root-owned files left by older builds - Use private temp directories instead of fixed /tmp paths Code quality - Shared lib.sh: conf parser, variable expansion, version records, install tracking, staged installs, sudo keepalive - bats tests covering first install and update paths, Makefile with lint/test/hooks, pre-commit hook - patch-potacat.sh uses jq; drop stale kiwix version entries README: fill in what gets installed, uninstall and graywolf notes, development section, typo and Matrix link fixes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ebda32d567
commit
0b471c9771
+18
-9
@@ -1,15 +1,22 @@
|
||||
# compile.conf - Applications to build from source and install
|
||||
#
|
||||
# Fields:
|
||||
# version= - version string for update checking
|
||||
# version= - version string for update checking (required). Changing it
|
||||
# rebuilds the app on the next update
|
||||
# git= - git repository URL to clone (mutually exclusive with wget). Builds the
|
||||
# tag named after the version (1.2.3 or v1.2.3), or the default branch
|
||||
# if the repo has no tags
|
||||
# ref= - commit to build instead of the version's tag, for repos whose tags are wrong
|
||||
# wget= - URL of a zip/tar archive to download and extract (mutually exclusive with git)
|
||||
# install= - path to the installed binary, used to detect if already installed
|
||||
# steps= - comma-separated build commands, run in order from the source directory
|
||||
# $HOME is expanded; use sudo for steps that require elevated privileges
|
||||
# install= - path to the installed binary, used to detect if already installed (required)
|
||||
# steps= - comma-separated build commands, run in order from a private copy of
|
||||
# the source (required). A step that fails stops the build, and the
|
||||
# app is tried again on the next update. Steps run unattended, so
|
||||
# they mustn't ask questions. $HOME, $USER and $HAMPACK_DIR are set.
|
||||
# For an app that installs many files, install to a staging
|
||||
# directory and finish with `install_staged DIR` (see lib.sh): it
|
||||
# copies the files into place without leaving anything owned by
|
||||
# root in your home, and records them for hampackremove
|
||||
# gui=true - set if a .desktop file should be installed
|
||||
# desktop= - path to the .desktop file to install (required when gui=true)
|
||||
|
||||
@@ -17,7 +24,7 @@
|
||||
version=1.8.1
|
||||
git=https://github.com/wb2osz/direwolf.git
|
||||
install=$HOME/.local/bin/direwolf
|
||||
steps=mkdir build, cd build, cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local, make -j4, sudo make install, sudo udevadm control --reload-rules, mkdir -p $HOME/.local/state/HamPack/conf.d, cp -n $HAMPACK_DIR/conf.d/direwolf.conf $HOME/.local/state/HamPack/conf.d/
|
||||
steps=mkdir build, cd build, cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local, make -j4, make install DESTDIR=$PWD/stage, install_staged stage, sudo rm -f /etc/udev/rules.d/99-direwolf-cmedia.rules, sudo udevadm control --reload-rules, mkdir -p $HAMPACK_STATE/conf.d, cp -n $HAMPACK_DIR/conf.d/direwolf.conf $HAMPACK_STATE/conf.d/
|
||||
|
||||
[QtTermTCP]
|
||||
version=0.81
|
||||
@@ -25,6 +32,7 @@ git=https://github.com/g8bpq/QtTermTCP.git
|
||||
# Upstream tags are one release behind: tag 0.81 is the 0.0.0.79 commit
|
||||
ref=00ca15573c4653882265d6bfc884fca619556c30
|
||||
install=$HOME/.local/bin/QtTermTCP
|
||||
desktop=$HAMPACK_DIR/desktop/qttermtcp.desktop
|
||||
gui=true
|
||||
steps=rm -f *.o .qmake.stash Makefile, qmake-qt5, make, mv QtTermTCP $HOME/.local/bin/
|
||||
|
||||
@@ -33,13 +41,13 @@ version=2.5.1
|
||||
git=https://github.com/kiwix/kiwix-desktop.git
|
||||
install=$HOME/.local/bin/kiwix-desktop
|
||||
gui=true
|
||||
steps=/usr/lib/qt6/bin/qmake PREFIX=$HOME/.local "QMAKE_CXXFLAGS+=-Wno-error=sfinae-incomplete", make, make install
|
||||
steps=/usr/lib/qt6/bin/qmake PREFIX=$HOME/.local "QMAKE_CXXFLAGS+=-Wno-error=sfinae-incomplete", make, make install INSTALL_ROOT=$PWD/stage, install_staged stage
|
||||
|
||||
[kiwix-tools]
|
||||
version=3.8.2
|
||||
git=https://github.com/kiwix/kiwix-tools.git
|
||||
install=$HOME/.local/bin/kiwix-serve
|
||||
steps=sudo chown -R $USER:$USER $HOME/.local/share/man, meson setup build --prefix=$HOME/.local, ninja -C build, ninja -C build install
|
||||
steps=meson setup build --prefix=$HOME/.local, ninja -C build, DESTDIR=$PWD/stage ninja -C build install, install_staged stage
|
||||
|
||||
[Dump1090]
|
||||
version=1.0.0
|
||||
@@ -53,7 +61,7 @@ wget=https://www.ka2ddo.org/ka2ddo/YAAC.zip
|
||||
install=$HOME/.local/bin/yaac/YAAC.jar
|
||||
desktop=$HAMPACK_DIR/desktop/yaac.desktop
|
||||
gui=true
|
||||
steps=rm -rf $HOME/.local/bin/yaac, mkdir -p $HOME/.local/bin/yaac, mv /tmp/hampack-build/yaac/* $HOME/.local/bin/yaac/
|
||||
steps=rm -rf $HOME/.local/bin/yaac, mkdir -p $HOME/.local/bin/yaac, mv ./* $HOME/.local/bin/yaac/
|
||||
|
||||
[potacat]
|
||||
version=1.11.7
|
||||
@@ -72,8 +80,9 @@ desktop=$HAMPACK_DIR/desktop/js8call.desktop
|
||||
gui=true
|
||||
steps=mkdir build, cd build, cmake -D CMAKE_INSTALL_PREFIX=/opt/JS8Call-improved .., cmake --build . -- -j 4, mv JS8Call $HOME/.local/bin/JS8Call
|
||||
|
||||
# update.sh installs and enables graywolf's systemd service once it's built
|
||||
[graywolf]
|
||||
version=0.14.14
|
||||
git=https://github.com/chrissnell/graywolf.git
|
||||
install=$HOME/.local/bin/graywolf
|
||||
steps=getent group dialout || sudo groupadd dialout, make all, install -m 755 bin/graywolf $HOME/.local/bin/graywolf, install -m 755 bin/graywolf-modem $HOME/.local/bin/graywolf-modem, mkdir -p $HOME/.local/share/graywolf, sed "s|HAMPACK_USER|$USER|g; s|HAMPACK_HOME|$HOME|g" $HAMPACK_DIR/systemd/graywolf.service > /tmp/graywolf.service, sudo install -m 644 /tmp/graywolf.service /etc/systemd/system/graywolf.service, sudo systemctl daemon-reload, sudo systemctl enable graywolf
|
||||
steps=make all, install -m 755 bin/graywolf $HOME/.local/bin/graywolf, install -m 755 bin/graywolf-modem $HOME/.local/bin/graywolf-modem
|
||||
|
||||
Reference in New Issue
Block a user