Conform to sibling requirements

This commit is contained in:
David Young
2026-10-20 06:21:10 -06:00
parent 7d9bdfcb35
commit b7c7b6f6e8
23 changed files with 142 additions and 297 deletions
+21 -71
View File
@@ -1,6 +1,6 @@
#!/bin/bash -i
#!/bin/bash
#
# Purpose : HamPack installer
# Purpose : Install HamPack (run by CoreDesktop's `sibling add`)
# Print the logo
print_logo() {
@@ -24,83 +24,33 @@ EOF
# --- Main ---
set -e
clear
SELF="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
COREDESKTOP="$HOME/.local/share/coredesktop"
LEGACY_DIR="$HOME/.local/share/HamPack"
clear || true
print_logo
if [ ! -d "$HOME/.local/share/coredesktop" ]; then
if [ ! -d "$COREDESKTOP" ]; then
echo "HamPack requires CoreDesktop to be installed first."
echo "Please install CoreDesktop: https://coredesktop.federated.computer"
exit 1
fi
cd ~
echo "Getting the latest version of HamPack..."
rm -rf ~/.local/share/HamPack
git clone https://gitea.young.computer/david/HamPack.git ~/.local/share/HamPack > /dev/null
cd ~/.local/share/HamPack
# HamPack used to clone itself to ~/.local/share/HamPack and copy its own hooks
# into CoreDesktop's updates.d. It now lives wherever `sibling` cloned it.
if [ -d "$LEGACY_DIR/.git" ] && [ "$LEGACY_DIR" != "$SELF" ]; then
echo "Removing the old HamPack install at $LEGACY_DIR..."
rm -rf "$LEGACY_DIR"
fi
rm -f "$COREDESKTOP"/updates.d/[0-9][0-9][0-9]-hampack-*
echo "Setting up sudo..."
. sudo.sh
# Remove the temporary sudoers file however this script exits
trap 'sudo rm -f /etc/sudoers.d/hampack' EXIT
bash "$SELF/sudo.sh"
mkdir -p ~/.local/bin
sudo rm -f ~/.local/bin/hampackrefresh ~/.local/bin/hampackupdate ~/.local/bin/hampackremove
cp ~/.local/share/HamPack/hampackrefresh ~/.local/bin/hampackrefresh
cp ~/.local/share/HamPack/hampackupdate ~/.local/bin/hampackupdate
cp ~/.local/share/HamPack/hampackremove ~/.local/bin/hampackremove
bash "$SELF/update.sh"
# Source utility functions
source utils.sh
# Source package list
if [ ! -f "packages.conf" ]; then
echo "Error: packages.conf not found!"
exit 1
fi
source packages.conf
echo "Installing system utilities..."
install_packages "${UTILITIES[@]}"
echo "Installing applications..."
install_packages "${APPLICATIONS[@]}"
cd ~/.local/share/HamPack
echo "Installing Flatpak applications..."
. install-flatpaks.sh
echo "Installing stand-alone compiled applications..."
. install-compiled.sh
cd ~/.local/share/HamPack
echo "Installing Windows-only applications..."
. install-windows-apps.sh
echo "Installing not1mm..."
curl -LsSf uvx.sh/not1mm/install.sh | sh
echo "Installing dx.py..."
wget -q https://raw.githubusercontent.com/HB9VQQ/dx.py/main/dx.py -O "$HOME/.local/bin/dx.py"
chmod +x "$HOME/.local/bin/dx.py"
echo "Installing JS8Call desktop file..."
mkdir -p ~/.local/share/applications
sed "s|\$HOME|$HOME|g" ~/.local/share/HamPack/desktop/js8call.desktop \
> ~/.local/share/applications/js8call.desktop
echo "Updating desktop database..."
update-desktop-database "$HOME/.local/share/applications/"
echo "Registering HamPack with coredesktop updater..."
for hook in ~/.local/share/HamPack/updates.d/[0-9][0-9][0-9]-hampack*; do
name="$(basename "$hook")"
rm -f ~/.local/share/coredesktop/updates.d/"$name"
install -Dm755 "$hook" ~/.local/share/coredesktop/updates.d/"${name}.sh"
done
sudo rm /etc/sudoers.d/hampack
echo "HamPack is installed. You may want to restart existing applications when convenient."
echo "HamPack is installed. You may want to restart existing applications when convenient."