Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a8bdda0aa | ||
|
|
b7c7b6f6e8 |
@@ -12,12 +12,18 @@ The main objectives of this project are to:
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Run the following command from the command-line:
|
HamPack is a CoreDesktop sibling project. With CoreDesktop installed, run:
|
||||||
|
|
||||||
```
|
```
|
||||||
wget -qO- https://gitea.young.computer/david/hampack/raw/branch/main/install.sh | bash
|
sibling add https://gitea.young.computer/david/HamPack.git
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This clones HamPack into `~/.local/share/siblings/HamPack` and runs its `install.sh`. From then on, CoreDesktop's `update` command pulls HamPack and runs its `update.sh`, so HamPack stays current along with the rest of the system. Re-run the `sibling add` command above to repair an install.
|
||||||
|
|
||||||
|
To uninstall HamPack and the applications it installed, run `hampackremove`.
|
||||||
|
|
||||||
|
If you installed HamPack before it became a sibling project, run the `sibling add` command above once. It moves HamPack to the new location and removes the old update hooks.
|
||||||
|
|
||||||
## What Get's Installed
|
## What Get's Installed
|
||||||
|
|
||||||
This is the long list of stuff that gets installed...
|
This is the long list of stuff that gets installed...
|
||||||
|
|||||||
+5
-5
@@ -7,7 +7,7 @@
|
|||||||
# exec= - command for the .desktop Exec= field (defaults to install path if omitted)
|
# exec= - command for the .desktop Exec= field (defaults to install path if omitted)
|
||||||
# gui=true - set if a .desktop file should be generated. No .desktop file is created if false
|
# gui=true - set if a .desktop file should be generated. No .desktop file is created if false
|
||||||
# comment= - description for the .desktop file
|
# comment= - description for the .desktop file
|
||||||
# icon= - icon theme name (e.g. wsjtx) or path to icon file (e.g. $HOME/.local/share/HamPack/icons/wsjtx.png)
|
# icon= - icon theme name (e.g. wsjtx) or path to icon file (e.g. $HAMPACK_DIR/desktop/icons/wsjtx.png)
|
||||||
# categories= - desktop categories (default: HamRadio;)
|
# categories= - desktop categories (default: HamRadio;)
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
@@ -30,10 +30,10 @@ gui=false
|
|||||||
[paracon]
|
[paracon]
|
||||||
version=1.3.0
|
version=1.3.0
|
||||||
url=https://github.com/mfncooper/paracon/releases/download/v1.3.0/paracon_1.3.0.pyz
|
url=https://github.com/mfncooper/paracon/releases/download/v1.3.0/paracon_1.3.0.pyz
|
||||||
install=$HOME/.local/bin/paracon_1.3.0.pyz
|
install=$HOME/.local/bin/paracon.pyz
|
||||||
gui=true
|
gui=true
|
||||||
comment=Weak signal digital modes for amateur radio
|
comment=Packet radio terminal
|
||||||
exec=python $HOME/.local/bin/paracon_1.3.0.pyz
|
exec=python $HOME/.local/bin/paracon.pyz
|
||||||
icon=$HOME/.local/share/HamPack/desktop/icons/paracon.png
|
icon=$HAMPACK_DIR/desktop/icons/paracon.png
|
||||||
categories=HamRadio;
|
categories=HamRadio;
|
||||||
|
|
||||||
|
|||||||
+17
-12
@@ -2,7 +2,10 @@
|
|||||||
#
|
#
|
||||||
# Fields:
|
# Fields:
|
||||||
# version= - version string for update checking
|
# version= - version string for update checking
|
||||||
# git= - git repository URL to clone (mutually exclusive with wget)
|
# 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)
|
# 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
|
# install= - path to the installed binary, used to detect if already installed
|
||||||
# steps= - comma-separated build commands, run in order from the source directory
|
# steps= - comma-separated build commands, run in order from the source directory
|
||||||
@@ -14,14 +17,16 @@
|
|||||||
version=1.8.1
|
version=1.8.1
|
||||||
git=https://github.com/wb2osz/direwolf.git
|
git=https://github.com/wb2osz/direwolf.git
|
||||||
install=$HOME/.local/bin/direwolf
|
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 $HOME/.local/share/HamPack/conf.d/direwolf.conf $HOME/.local/state/HamPack/conf.d/
|
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/
|
||||||
|
|
||||||
[QtTermTCP]
|
[QtTermTCP]
|
||||||
version=0.39
|
version=0.81
|
||||||
wget=http://www.cantab.net/users/john.wiseman/Downloads/QtTermSource.zip
|
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
|
install=$HOME/.local/bin/QtTermTCP
|
||||||
gui=true
|
gui=true
|
||||||
steps=qmake, make, mv QtTermTCP $HOME/.local/bin/
|
steps=rm -f *.o .qmake.stash Makefile, qmake-qt5, make, mv QtTermTCP $HOME/.local/bin/
|
||||||
|
|
||||||
[kiwix-desktop]
|
[kiwix-desktop]
|
||||||
version=2.5.1
|
version=2.5.1
|
||||||
@@ -46,29 +51,29 @@ steps=make, mv dump1090 $HOME/.local/bin/dump1090
|
|||||||
version=1.0-beta229
|
version=1.0-beta229
|
||||||
wget=https://www.ka2ddo.org/ka2ddo/YAAC.zip
|
wget=https://www.ka2ddo.org/ka2ddo/YAAC.zip
|
||||||
install=$HOME/.local/bin/yaac/YAAC.jar
|
install=$HOME/.local/bin/yaac/YAAC.jar
|
||||||
desktop=$HOME/.local/share/HamPack/desktop/yaac.desktop
|
desktop=$HAMPACK_DIR/desktop/yaac.desktop
|
||||||
gui=true
|
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 /tmp/hampack-build/yaac/* $HOME/.local/bin/yaac/
|
||||||
|
|
||||||
[potacat]
|
[potacat]
|
||||||
version=1.10.12
|
version=1.11.7
|
||||||
git=https://github.com/Waffleslop/POTACAT.git
|
git=https://github.com/Waffleslop/POTACAT.git
|
||||||
install=$HOME/.local/bin/POTACAT.AppImage
|
install=$HOME/.local/bin/POTACAT.AppImage
|
||||||
desktop=$HOME/.local/share/HamPack/desktop/potacat.desktop
|
desktop=$HAMPACK_DIR/desktop/potacat.desktop
|
||||||
gui=true
|
gui=true
|
||||||
steps=bash $HOME/.local/share/HamPack/patch-potacat.sh, npm install, npm run dist:linux, mv dist/*.AppImage $HOME/.local/bin/POTACAT.AppImage
|
steps=bash $HAMPACK_DIR/patch-potacat.sh, npm install, npm run dist:linux, mv dist/*.AppImage $HOME/.local/bin/POTACAT.AppImage
|
||||||
|
|
||||||
[js8call-improved]
|
[js8call-improved]
|
||||||
name=JS8Call
|
name=JS8Call
|
||||||
version=3.0.3
|
version=3.0.3
|
||||||
git=https://github.com/JS8Call-improved/JS8Call-improved.git
|
git=https://github.com/JS8Call-improved/JS8Call-improved.git
|
||||||
install=$HOME/.local/bin/JS8Call
|
install=$HOME/.local/bin/JS8Call
|
||||||
desktop=$HOME/.local/share/HamPack/desktop/js8call.desktop
|
desktop=$HAMPACK_DIR/desktop/js8call.desktop
|
||||||
gui=true
|
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
|
steps=mkdir build, cd build, cmake -D CMAKE_INSTALL_PREFIX=/opt/JS8Call-improved .., cmake --build . -- -j 4, mv JS8Call $HOME/.local/bin/JS8Call
|
||||||
|
|
||||||
[graywolf]
|
[graywolf]
|
||||||
version=0.14.13
|
version=0.14.14
|
||||||
git=https://github.com/chrissnell/graywolf.git
|
git=https://github.com/chrissnell/graywolf.git
|
||||||
install=$HOME/.local/bin/graywolf
|
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" $HOME/.local/share/HamPack/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=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
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
Name=JS8Call
|
Name=JS8Call
|
||||||
Comment=Ham Radio real time chat over HF
|
Comment=Ham Radio real time chat over HF
|
||||||
Exec=$HOME/.local/bin/JS8Call
|
Exec=$HOME/.local/bin/JS8Call
|
||||||
Icon=$HOME/.local/share/HamPack/desktop/icons/js8call_icon.png
|
Icon=$HAMPACK_DIR/desktop/icons/js8call_icon.png
|
||||||
Type=Application
|
Type=Application
|
||||||
Categories=HamRadio;Utility;
|
Categories=HamRadio;Utility;
|
||||||
Terminal=false
|
Terminal=false
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
Name=POTACAT
|
Name=POTACAT
|
||||||
Comment=Amateur radio spot aggregator with CAT control, QSO logging, and panadapter integration
|
Comment=Amateur radio spot aggregator with CAT control, QSO logging, and panadapter integration
|
||||||
Exec=$HOME/.local/bin/POTACAT.AppImage
|
Exec=$HOME/.local/bin/POTACAT.AppImage
|
||||||
Icon=$HOME/.local/share/HamPack/desktop/icons/potacat.png
|
Icon=$HAMPACK_DIR/desktop/icons/potacat.png
|
||||||
Type=Application
|
Type=Application
|
||||||
Categories=HamRadio;Utility;
|
Categories=HamRadio;Utility;
|
||||||
Terminal=false
|
Terminal=false
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
Name=QtTermTCP
|
Name=QtTermTCP
|
||||||
Comment=TCP Terminal
|
Comment=TCP Terminal
|
||||||
Exec=$HOME/.local/bin/QtTermTCP
|
Exec=$HOME/.local/bin/QtTermTCP
|
||||||
Icon=$HOME/.local/share/HamPack/desktop/icons/qttermtcp.png
|
Icon=$HAMPACK_DIR/desktop/icons/qttermtcp.png
|
||||||
Type=Application
|
Type=Application
|
||||||
Categories=HamRadio;Utility;
|
Categories=HamRadio;Utility;
|
||||||
Terminal=false
|
Terminal=false
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
Name=YAAC
|
Name=YAAC
|
||||||
Comment=Yet another aprs client
|
Comment=Yet another aprs client
|
||||||
Exec=java -jar $HOME/.local/bin/yaac/YAAC.jar
|
Exec=java -jar $HOME/.local/bin/yaac/YAAC.jar
|
||||||
Icon=$HOME/.local/share/HamPack/desktop/icons/yaaclogo.png
|
Icon=$HAMPACK_DIR/desktop/icons/yaaclogo.png
|
||||||
Type=Application
|
Type=Application
|
||||||
Categories=HamRadio;Utility;
|
Categories=HamRadio;Utility;
|
||||||
Terminal=false
|
Terminal=false
|
||||||
|
|||||||
+33
-3
@@ -24,16 +24,29 @@ github_latest() {
|
|||||||
| sed 's/^v//'
|
| sed 's/^v//'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Latest release tag in a git repo, stripping leading "v". Only plain version
|
||||||
|
# tags count (1.2.3 or v1.2.3), not pre-releases like 1.8-beta1.
|
||||||
|
git_latest_tag() {
|
||||||
|
local url="$1"
|
||||||
|
git ls-remote --tags --refs "$url" 2>/dev/null \
|
||||||
|
| sed 's|.*refs/tags/||' \
|
||||||
|
| grep -E '^v?[0-9]+(\.[0-9]+)+$' \
|
||||||
|
| sed 's/^v//' \
|
||||||
|
| sort -V \
|
||||||
|
| tail -n1
|
||||||
|
}
|
||||||
|
|
||||||
print_result() {
|
print_result() {
|
||||||
local app="$1"
|
local app="$1"
|
||||||
local pinned="$2"
|
local pinned="$2"
|
||||||
local latest="$3"
|
local latest="$3"
|
||||||
local manual_url="$4"
|
local manual_url="$4"
|
||||||
|
local source="${5:-GitHub API}"
|
||||||
|
|
||||||
if [ -n "$manual_url" ]; then
|
if [ -n "$manual_url" ]; then
|
||||||
printf " %-20s pinned=%-15s (manual check: %s)\n" "$app" "$pinned" "${manual_url%/*}"
|
printf " %-20s pinned=%-15s (manual check: %s)\n" "$app" "$pinned" "${manual_url%/*}"
|
||||||
elif [ -z "$latest" ]; then
|
elif [ -z "$latest" ]; then
|
||||||
printf " %-20s pinned=%-15s (GitHub API unavailable)\n" "$app" "$pinned"
|
printf " %-20s pinned=%-15s (%s unavailable)\n" "$app" "$pinned" "$source"
|
||||||
elif [ "$pinned" = "$latest" ]; then
|
elif [ "$pinned" = "$latest" ]; then
|
||||||
printf " %-20s up to date (%s)\n" "$app" "$pinned"
|
printf " %-20s up to date (%s)\n" "$app" "$pinned"
|
||||||
else
|
else
|
||||||
@@ -82,6 +95,23 @@ check_binaries() {
|
|||||||
check_app "$app" "$version" "$url" ""
|
check_app "$app" "$version" "$url" ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# compile.conf builds git= apps from the tag matching their version, so compare
|
||||||
|
# against the repo's tags rather than GitHub releases
|
||||||
|
check_compiled_app() {
|
||||||
|
local app="$1"
|
||||||
|
local version="$2"
|
||||||
|
local git_url="$3"
|
||||||
|
local wget_url="$4"
|
||||||
|
|
||||||
|
[ -z "$app" ] || [ -z "$version" ] && return
|
||||||
|
|
||||||
|
if [ -n "$git_url" ]; then
|
||||||
|
print_result "$app" "$version" "$(git_latest_tag "$git_url")" "" "version tags"
|
||||||
|
else
|
||||||
|
check_app "$app" "$version" "" "$wget_url"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
check_compiled() {
|
check_compiled() {
|
||||||
echo ""
|
echo ""
|
||||||
echo "=== compile.conf ==="
|
echo "=== compile.conf ==="
|
||||||
@@ -91,7 +121,7 @@ check_compiled() {
|
|||||||
[[ -z "$line" || "$line" == \#* ]] && continue
|
[[ -z "$line" || "$line" == \#* ]] && continue
|
||||||
|
|
||||||
if [[ "$line" =~ ^\[(.+)\]$ ]]; then
|
if [[ "$line" =~ ^\[(.+)\]$ ]]; then
|
||||||
check_app "${name:-$app}" "$version" "$git_url" "$wget_url"
|
check_compiled_app "${name:-$app}" "$version" "$git_url" "$wget_url"
|
||||||
app="${BASH_REMATCH[1]}" name="" version="" git_url="" wget_url=""
|
app="${BASH_REMATCH[1]}" name="" version="" git_url="" wget_url=""
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
@@ -105,7 +135,7 @@ check_compiled() {
|
|||||||
esac
|
esac
|
||||||
done < "$COMPILE_CONF"
|
done < "$COMPILE_CONF"
|
||||||
|
|
||||||
check_app "${name:-$app}" "$version" "$git_url" "$wget_url"
|
check_compiled_app "${name:-$app}" "$version" "$git_url" "$wget_url"
|
||||||
}
|
}
|
||||||
|
|
||||||
# --- Main ---
|
# --- Main ---
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Print the logo
|
|
||||||
print_logo() {
|
|
||||||
cat << "EOF"
|
|
||||||
|
|
||||||
|
|
||||||
██╗ ██╗ █████╗ ███╗ ███╗██████╗ █████╗ ██████╗██╗ ██╗
|
|
||||||
██║ ██║██╔══██╗████╗ ████║██╔══██╗██╔══██╗██╔════╝██║ ██╔╝
|
|
||||||
███████║███████║██╔████╔██║██████╔╝███████║██║ █████╔╝
|
|
||||||
██╔══██║██╔══██║██║╚██╔╝██║██╔═══╝ ██╔══██║██║ ██╔═██╗
|
|
||||||
██║ ██║██║ ██║██║ ╚═╝ ██║██║ ██║ ██║╚██████╗██║ ██╗
|
|
||||||
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝
|
|
||||||
|
|
||||||
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
# Clear screen and show logo
|
|
||||||
clear
|
|
||||||
print_logo
|
|
||||||
|
|
||||||
HAMPACK_DIR="$HOME/.local/share/HamPack"
|
|
||||||
|
|
||||||
echo "Let's ensure we get the latest changes to HamPack..."
|
|
||||||
git -C "$HAMPACK_DIR" pull
|
|
||||||
|
|
||||||
echo "Running HamPack installer..."
|
|
||||||
bash "$HAMPACK_DIR/install.sh"
|
|
||||||
@@ -58,12 +58,15 @@ rm -f ~/.local/bin/dump1090
|
|||||||
rm -f ~/.local/bin/graywolf
|
rm -f ~/.local/bin/graywolf
|
||||||
rm -f ~/.local/bin/graywolf-modem
|
rm -f ~/.local/bin/graywolf-modem
|
||||||
rm -rf ~/.local/share/graywolf
|
rm -rf ~/.local/share/graywolf
|
||||||
|
rm -f ~/.local/bin/ardopcf_amd64_Linux_64
|
||||||
|
rm -f ~/.local/bin/paracon.pyz ~/.local/bin/paracon_*.pyz
|
||||||
|
|
||||||
# Remove HamPack scripts and binaries
|
# Remove HamPack scripts and binaries
|
||||||
echo "Removing HamPack scripts and binaries..."
|
echo "Removing HamPack scripts and binaries..."
|
||||||
rm -f ~/.local/bin/hampackrefresh
|
rm -f ~/.local/bin/hampackrefresh
|
||||||
rm -f ~/.local/bin/hampackupdate
|
rm -f ~/.local/bin/hampackupdate
|
||||||
rm -f ~/.local/bin/hampackcheck
|
rm -f ~/.local/bin/hampackcheck
|
||||||
|
rm -f ~/.local/bin/hampackremove
|
||||||
rm -f ~/.local/bin/dx.py
|
rm -f ~/.local/bin/dx.py
|
||||||
|
|
||||||
# Uninstall not1mm
|
# Uninstall not1mm
|
||||||
@@ -163,6 +166,7 @@ rm -f ~/.local/share/applications/js8call.desktop
|
|||||||
rm -f ~/.local/share/applications/yaac.desktop
|
rm -f ~/.local/share/applications/yaac.desktop
|
||||||
rm -f ~/.local/share/applications/potacat.desktop
|
rm -f ~/.local/share/applications/potacat.desktop
|
||||||
rm -f ~/.local/share/applications/qttermtcp.desktop
|
rm -f ~/.local/share/applications/qttermtcp.desktop
|
||||||
|
rm -f ~/.local/share/applications/paracon.desktop
|
||||||
|
|
||||||
update-desktop-database "$HOME/.local/share/applications/" 2>/dev/null || true
|
update-desktop-database "$HOME/.local/share/applications/" 2>/dev/null || true
|
||||||
|
|
||||||
@@ -170,6 +174,15 @@ update-desktop-database "$HOME/.local/share/applications/" 2>/dev/null || true
|
|||||||
echo "Removing HamPack state and data..."
|
echo "Removing HamPack state and data..."
|
||||||
rm -rf ~/.local/state/HamPack
|
rm -rf ~/.local/state/HamPack
|
||||||
rm -rf ~/.local/share/HamPack
|
rm -rf ~/.local/share/HamPack
|
||||||
|
rm -f ~/.local/share/coredesktop/updates.d/[0-9][0-9][0-9]-hampack-*
|
||||||
|
|
||||||
|
# Remove the sibling clone, so CoreDesktop's `update` stops updating HamPack
|
||||||
|
for dir in ~/.local/share/siblings/*/; do
|
||||||
|
[ -d "$dir/.git" ] || continue
|
||||||
|
if [[ "$(git -C "$dir" remote get-url origin 2>/dev/null)" =~ /[Hh]am[Pp]ack(\.git)?/?$ ]]; then
|
||||||
|
rm -rf "$dir"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "HamPack has been removed."
|
echo "HamPack has been removed."
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
print_logo() {
|
|
||||||
cat << "EOF"
|
|
||||||
|
|
||||||
|
|
||||||
██╗ ██╗ █████╗ ███╗ ███╗██████╗ █████╗ ██████╗██╗ ██╗
|
|
||||||
██║ ██║██╔══██╗████╗ ████║██╔══██╗██╔══██╗██╔════╝██║ ██╔╝
|
|
||||||
███████║███████║██╔████╔██║██████╔╝███████║██║ █████╔╝
|
|
||||||
██╔══██║██╔══██║██║╚██╔╝██║██╔═══╝ ██╔══██║██║ ██╔═██╗
|
|
||||||
██║ ██║██║ ██║██║ ╚═╝ ██║██║ ██║ ██║╚██████╗██║ ██╗
|
|
||||||
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝
|
|
||||||
|
|
||||||
|
|
||||||
EOF
|
|
||||||
}
|
|
||||||
|
|
||||||
clear
|
|
||||||
print_logo
|
|
||||||
|
|
||||||
HAMPACK_DIR="$HOME/.local/share/HamPack"
|
|
||||||
|
|
||||||
for updater in "$HAMPACK_DIR/updates.d/"[0-9][0-9][0-9]-*; do
|
|
||||||
[ -f "$updater" ] || continue
|
|
||||||
(
|
|
||||||
source "$updater"
|
|
||||||
if is_installed; then
|
|
||||||
run_update
|
|
||||||
fi
|
|
||||||
)
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "Done."
|
|
||||||
+22
-11
@@ -2,9 +2,12 @@
|
|||||||
#
|
#
|
||||||
# Purpose: Download and install pre-built binaries from binaries.conf
|
# Purpose: Download and install pre-built binaries from binaries.conf
|
||||||
|
|
||||||
CONF_FILE="${HAMPACK_BINARIES_CONF:-$HOME/.local/share/HamPack/binaries.conf}"
|
HAMPACK_DIR="${HAMPACK_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"
|
||||||
|
export HAMPACK_DIR
|
||||||
|
CONF_FILE="${HAMPACK_BINARIES_CONF:-$HAMPACK_DIR/binaries.conf}"
|
||||||
TMP_DIR="/tmp/hampack-build"
|
TMP_DIR="/tmp/hampack-build"
|
||||||
VERSION_FILE="$HOME/.local/state/HamPack/.installed_versions"
|
VERSION_FILE="$HOME/.local/state/HamPack/.installed_versions"
|
||||||
|
FAILED=()
|
||||||
|
|
||||||
# Get the installed version of an app
|
# Get the installed version of an app
|
||||||
get_installed_version() {
|
get_installed_version() {
|
||||||
@@ -51,14 +54,8 @@ needs_update() {
|
|||||||
installed=$(get_installed_version "$app")
|
installed=$(get_installed_version "$app")
|
||||||
|
|
||||||
if [ "$installed" = "unknown" ]; then
|
if [ "$installed" = "unknown" ]; then
|
||||||
echo " Warning: could not determine installed version of $app."
|
echo " Installed version of $app is unknown, reinstalling version $latest."
|
||||||
echo " binaries.conf specifies version $latest."
|
return 0
|
||||||
read -rp " Download and install $app anyway? [y/N] " response
|
|
||||||
if [[ "$response" =~ ^[yY] ]]; then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " Installed version : $installed"
|
echo " Installed version : $installed"
|
||||||
@@ -83,7 +80,11 @@ download_binary() {
|
|||||||
local tmp_file="$TMP_DIR/$filename"
|
local tmp_file="$TMP_DIR/$filename"
|
||||||
|
|
||||||
echo " Downloading $url..."
|
echo " Downloading $url..."
|
||||||
wget -q "$url" -O "$tmp_file"
|
if ! wget -q "$url" -O "$tmp_file"; then
|
||||||
|
echo " Error: download of $url failed."
|
||||||
|
rm -f "$tmp_file"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "$(dirname "$install_path")"
|
mkdir -p "$(dirname "$install_path")"
|
||||||
mv "$tmp_file" "$install_path"
|
mv "$tmp_file" "$install_path"
|
||||||
@@ -140,11 +141,13 @@ process_app() {
|
|||||||
|
|
||||||
if [ -z "$url" ]; then
|
if [ -z "$url" ]; then
|
||||||
echo " Error: no url specified for $app, skipping."
|
echo " Error: no url specified for $app, skipping."
|
||||||
|
FAILED+=("$app")
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$install_path" ]; then
|
if [ -z "$install_path" ]; then
|
||||||
echo " Error: no install path specified for $app, skipping."
|
echo " Error: no install path specified for $app, skipping."
|
||||||
|
FAILED+=("$app")
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -160,7 +163,10 @@ process_app() {
|
|||||||
echo " $app is not installed."
|
echo " $app is not installed."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
download_binary "$app" "$url" "$install_path"
|
if ! download_binary "$app" "$url" "$install_path"; then
|
||||||
|
FAILED+=("$app")
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$gui" = "true" ]; then
|
if [ "$gui" = "true" ]; then
|
||||||
install_desktop "$app" "$install_path" "$exec_cmd" "$comment" "$icon" "$categories"
|
install_desktop "$app" "$install_path" "$exec_cmd" "$comment" "$icon" "$categories"
|
||||||
@@ -234,4 +240,9 @@ echo ""
|
|||||||
echo "Cleaning up..."
|
echo "Cleaning up..."
|
||||||
rm -rf "$TMP_DIR"
|
rm -rf "$TMP_DIR"
|
||||||
|
|
||||||
|
if (( ${#FAILED[@]} > 0 )); then
|
||||||
|
echo "Failed to install: ${FAILED[*]}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "All done."
|
echo "All done."
|
||||||
|
|||||||
+71
-17
@@ -2,9 +2,12 @@
|
|||||||
#
|
#
|
||||||
# Purpose : Compile and install applications from compile.conf
|
# Purpose : Compile and install applications from compile.conf
|
||||||
|
|
||||||
CONF_FILE="${HAMPACK_COMPILE_CONF:-$HOME/.local/share/HamPack/compile.conf}"
|
HAMPACK_DIR="${HAMPACK_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"
|
||||||
|
export HAMPACK_DIR
|
||||||
|
CONF_FILE="${HAMPACK_COMPILE_CONF:-$HAMPACK_DIR/compile.conf}"
|
||||||
TMP_DIR="/tmp/hampack-build"
|
TMP_DIR="/tmp/hampack-build"
|
||||||
VERSION_FILE="$HOME/.local/state/HamPack/.installed_versions"
|
VERSION_FILE="$HOME/.local/state/HamPack/.installed_versions"
|
||||||
|
FAILED=()
|
||||||
|
|
||||||
# Get the installed version of an app
|
# Get the installed version of an app
|
||||||
get_installed_version() {
|
get_installed_version() {
|
||||||
@@ -102,7 +105,7 @@ generate_desktop() {
|
|||||||
local desktop="$1"
|
local desktop="$1"
|
||||||
local tmp_desktop="/tmp/$(basename "$desktop")"
|
local tmp_desktop="/tmp/$(basename "$desktop")"
|
||||||
|
|
||||||
sed "s|\$HOME|$HOME|g" "$desktop" > "$tmp_desktop"
|
sed "s|\$HAMPACK_DIR|$HAMPACK_DIR|g; s|\$HOME|$HOME|g" "$desktop" > "$tmp_desktop"
|
||||||
echo "$tmp_desktop"
|
echo "$tmp_desktop"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,31 +132,71 @@ install_desktop() {
|
|||||||
echo " Desktop file installed."
|
echo " Desktop file installed."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Find the tag for a version, named either "1.2.3" or "v1.2.3". Prints nothing
|
||||||
|
# if the repo has no tags at all; fails if it has tags but none for the version.
|
||||||
|
find_version_tag() {
|
||||||
|
local git_url="$1"
|
||||||
|
local version="$2"
|
||||||
|
local tags
|
||||||
|
|
||||||
|
tags=$(git ls-remote --tags --refs "$git_url" | sed 's|.*refs/tags/||') || return 1
|
||||||
|
[ -z "$tags" ] && return 0
|
||||||
|
|
||||||
|
local tag
|
||||||
|
for tag in "$version" "v$version"; do
|
||||||
|
if grep -qxF "$tag" <<< "$tags"; then
|
||||||
|
echo "$tag"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
# Fetch source via git or wget
|
# Fetch source via git or wget
|
||||||
fetch_source() {
|
fetch_source() {
|
||||||
local app="$1"
|
local app="$1"
|
||||||
local git_url="$2"
|
local git_url="$2"
|
||||||
local wget_url="$3"
|
local wget_url="$3"
|
||||||
|
local version="$4"
|
||||||
|
local ref="$5"
|
||||||
local src_dir="$TMP_DIR/$app"
|
local src_dir="$TMP_DIR/$app"
|
||||||
|
|
||||||
rm -rf "$src_dir"
|
rm -rf "$src_dir"
|
||||||
mkdir -p "$src_dir"
|
mkdir -p "$src_dir"
|
||||||
|
|
||||||
if [ -n "$git_url" ]; then
|
if [ -n "$git_url" ] && [ -n "$ref" ]; then
|
||||||
echo " Cloning $git_url..."
|
echo " Cloning $git_url at $ref..."
|
||||||
git clone "$git_url" "$src_dir"
|
git clone "$git_url" "$src_dir" || return 1
|
||||||
|
git -C "$src_dir" -c advice.detachedHead=false checkout "$ref" || return 1
|
||||||
|
|
||||||
|
elif [ -n "$git_url" ]; then
|
||||||
|
local tag=""
|
||||||
|
if [ -n "$version" ]; then
|
||||||
|
if ! tag=$(find_version_tag "$git_url" "$version"); then
|
||||||
|
echo " Error: no tag $version or v$version in $git_url"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$tag" ]; then
|
||||||
|
echo " Cloning $git_url at $tag..."
|
||||||
|
git -c advice.detachedHead=false clone --branch "$tag" "$git_url" "$src_dir" || return 1
|
||||||
|
else
|
||||||
|
echo " $git_url has no tags; cloning the default branch..."
|
||||||
|
git clone "$git_url" "$src_dir" || return 1
|
||||||
|
fi
|
||||||
|
|
||||||
elif [ -n "$wget_url" ]; then
|
elif [ -n "$wget_url" ]; then
|
||||||
echo " Downloading $wget_url..."
|
echo " Downloading $wget_url..."
|
||||||
local filename="${wget_url##*/}"
|
local filename="${wget_url##*/}"
|
||||||
local filepath="$TMP_DIR/$filename"
|
local filepath="$TMP_DIR/$filename"
|
||||||
|
|
||||||
wget -q "$wget_url" -O "$filepath"
|
wget -q "$wget_url" -O "$filepath" || return 1
|
||||||
|
|
||||||
echo " Extracting $filename..."
|
echo " Extracting $filename..."
|
||||||
case "$filename" in
|
case "$filename" in
|
||||||
*.zip)
|
*.zip)
|
||||||
unzip -q "$filepath" -d "$src_dir"
|
unzip -q "$filepath" -d "$src_dir" || return 1
|
||||||
# If the zip extracted into a single subdirectory, flatten it
|
# If the zip extracted into a single subdirectory, flatten it
|
||||||
local contents
|
local contents
|
||||||
contents=$(ls -1 "$src_dir")
|
contents=$(ls -1 "$src_dir")
|
||||||
@@ -167,24 +210,24 @@ fetch_source() {
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*.tar.gz|*.tgz)
|
*.tar.gz|*.tgz)
|
||||||
tar -xzf "$filepath" -C "$src_dir" --strip-components=1
|
tar -xzf "$filepath" -C "$src_dir" --strip-components=1 || return 1
|
||||||
;;
|
;;
|
||||||
*.tar.bz2)
|
*.tar.bz2)
|
||||||
tar -xjf "$filepath" -C "$src_dir" --strip-components=1
|
tar -xjf "$filepath" -C "$src_dir" --strip-components=1 || return 1
|
||||||
;;
|
;;
|
||||||
*.tar.xz)
|
*.tar.xz)
|
||||||
tar -xJf "$filepath" -C "$src_dir" --strip-components=1
|
tar -xJf "$filepath" -C "$src_dir" --strip-components=1 || return 1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo " Error: unknown file type for $filename"
|
echo " Error: unknown file type for $filename"
|
||||||
exit 1
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
rm -f "$filepath"
|
rm -f "$filepath"
|
||||||
else
|
else
|
||||||
echo " Error: no git or wget URL specified for $app"
|
echo " Error: no git or wget URL specified for $app"
|
||||||
exit 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,6 +265,7 @@ process_app() {
|
|||||||
local version="$6"
|
local version="$6"
|
||||||
local desktop="$7"
|
local desktop="$7"
|
||||||
local gui="$8"
|
local gui="$8"
|
||||||
|
local ref="$9"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "=== $app ==="
|
echo "=== $app ==="
|
||||||
@@ -245,7 +289,11 @@ process_app() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fetch_source "$app" "$git_url" "$wget_url"
|
if ! fetch_source "$app" "$git_url" "$wget_url" "$version" "$ref"; then
|
||||||
|
echo " Error: could not fetch $app source, skipping."
|
||||||
|
FAILED+=("$app")
|
||||||
|
return
|
||||||
|
fi
|
||||||
run_steps "$app" "$steps"
|
run_steps "$app" "$steps"
|
||||||
install_desktop "$desktop"
|
install_desktop "$desktop"
|
||||||
save_installed_version "$app" "$version"
|
save_installed_version "$app" "$version"
|
||||||
@@ -258,17 +306,17 @@ process_app() {
|
|||||||
|
|
||||||
# Parse compile.conf and process each app
|
# Parse compile.conf and process each app
|
||||||
process_conf() {
|
process_conf() {
|
||||||
local app="" git_url="" wget_url="" install_path="" steps="" version="" desktop="" gui=""
|
local app="" git_url="" wget_url="" install_path="" steps="" version="" desktop="" gui="" ref=""
|
||||||
|
|
||||||
while IFS= read -r line || [ -n "$line" ]; do
|
while IFS= read -r line || [ -n "$line" ]; do
|
||||||
[[ -z "$line" || "$line" == \#* ]] && continue
|
[[ -z "$line" || "$line" == \#* ]] && continue
|
||||||
|
|
||||||
if [[ "$line" =~ ^\[(.+)\]$ ]]; then
|
if [[ "$line" =~ ^\[(.+)\]$ ]]; then
|
||||||
if [ -n "$app" ]; then
|
if [ -n "$app" ]; then
|
||||||
process_app "$app" "$git_url" "$wget_url" "$install_path" "$steps" "$version" "$desktop" "$gui"
|
process_app "$app" "$git_url" "$wget_url" "$install_path" "$steps" "$version" "$desktop" "$gui" "$ref"
|
||||||
fi
|
fi
|
||||||
app="${BASH_REMATCH[1]}"
|
app="${BASH_REMATCH[1]}"
|
||||||
git_url="" wget_url="" install_path="" steps="" version="" desktop="" gui=""
|
git_url="" wget_url="" install_path="" steps="" version="" desktop="" gui="" ref=""
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -277,6 +325,7 @@ process_conf() {
|
|||||||
|
|
||||||
case "$key" in
|
case "$key" in
|
||||||
git) git_url="$(eval echo "$value")" ;;
|
git) git_url="$(eval echo "$value")" ;;
|
||||||
|
ref) ref="$value" ;;
|
||||||
wget) wget_url="$(eval echo "$value")" ;;
|
wget) wget_url="$(eval echo "$value")" ;;
|
||||||
install) install_path="$(eval echo "$value")" ;;
|
install) install_path="$(eval echo "$value")" ;;
|
||||||
steps) steps="$value" ;;
|
steps) steps="$value" ;;
|
||||||
@@ -289,7 +338,7 @@ process_conf() {
|
|||||||
|
|
||||||
# Process the last app in the file
|
# Process the last app in the file
|
||||||
if [ -n "$app" ]; then
|
if [ -n "$app" ]; then
|
||||||
process_app "$app" "$git_url" "$wget_url" "$install_path" "$steps" "$version" "$desktop" "$gui"
|
process_app "$app" "$git_url" "$wget_url" "$install_path" "$steps" "$version" "$desktop" "$gui" "$ref"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -313,4 +362,9 @@ echo ""
|
|||||||
echo "Cleaning up..."
|
echo "Cleaning up..."
|
||||||
rm -rf "$TMP_DIR"
|
rm -rf "$TMP_DIR"
|
||||||
|
|
||||||
|
if (( ${#FAILED[@]} > 0 )); then
|
||||||
|
echo "Failed to install: ${FAILED[*]}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "All done."
|
echo "All done."
|
||||||
+20
-70
@@ -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 the logo
|
||||||
print_logo() {
|
print_logo() {
|
||||||
@@ -24,83 +24,33 @@ EOF
|
|||||||
# --- Main ---
|
# --- Main ---
|
||||||
|
|
||||||
set -e
|
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
|
print_logo
|
||||||
|
|
||||||
if [ ! -d "$HOME/.local/share/coredesktop" ]; then
|
if [ ! -d "$COREDESKTOP" ]; then
|
||||||
echo "HamPack requires CoreDesktop to be installed first."
|
echo "HamPack requires CoreDesktop to be installed first."
|
||||||
echo "Please install CoreDesktop: https://coredesktop.federated.computer"
|
echo "Please install CoreDesktop: https://coredesktop.federated.computer"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd ~
|
# 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.
|
||||||
echo "Getting the latest version of HamPack..."
|
if [ -d "$LEGACY_DIR/.git" ] && [ "$LEGACY_DIR" != "$SELF" ]; then
|
||||||
rm -rf ~/.local/share/HamPack
|
echo "Removing the old HamPack install at $LEGACY_DIR..."
|
||||||
git clone https://gitea.young.computer/david/HamPack.git ~/.local/share/HamPack > /dev/null
|
rm -rf "$LEGACY_DIR"
|
||||||
|
fi
|
||||||
cd ~/.local/share/HamPack
|
rm -f "$COREDESKTOP"/updates.d/[0-9][0-9][0-9]-hampack-*
|
||||||
|
|
||||||
echo "Setting up sudo..."
|
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
|
bash "$SELF/update.sh"
|
||||||
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
|
|
||||||
|
|
||||||
# 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."
|
||||||
@@ -29,6 +29,9 @@ UTILITIES=(
|
|||||||
pat-bin
|
pat-bin
|
||||||
python-yattag # must come before chirp-next
|
python-yattag # must come before chirp-next
|
||||||
qgis
|
qgis
|
||||||
|
qt5-base # QtTermTCP builds against Qt 5
|
||||||
|
qt5-multimedia
|
||||||
|
qt5-serialport
|
||||||
qt6-base
|
qt6-base
|
||||||
qt6-tools
|
qt6-tools
|
||||||
qt6-webengine
|
qt6-webengine
|
||||||
|
|||||||
@@ -0,0 +1,87 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Purpose : Keep HamPack current (run by CoreDesktop's `update`, and by install.sh)
|
||||||
|
|
||||||
|
SELF="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
COREDESKTOP="$HOME/.local/share/coredesktop"
|
||||||
|
source "$COREDESKTOP/utils.sh"
|
||||||
|
|
||||||
|
# Config files and build steps refer to files in this repo through $HAMPACK_DIR
|
||||||
|
export HAMPACK_DIR="$SELF"
|
||||||
|
|
||||||
|
FAILED=()
|
||||||
|
|
||||||
|
# Run one update step; a failure is reported but doesn't stop the later steps
|
||||||
|
step() {
|
||||||
|
local name="$1"
|
||||||
|
shift
|
||||||
|
echo "→ $name..."
|
||||||
|
if ! "$@"; then
|
||||||
|
echo "✗ $name failed."
|
||||||
|
FAILED+=("$name")
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
remove_stale_files() {
|
||||||
|
# The HamPack GUI app was removed
|
||||||
|
rm -f "$HOME/.local/bin/hampack"
|
||||||
|
rm -f "$HOME/.local/share/applications/hampack.desktop"
|
||||||
|
# Replaced by CoreDesktop's `update` and `sibling add`
|
||||||
|
rm -f "$HOME/.local/bin/hampackupdate" "$HOME/.local/bin/hampackrefresh"
|
||||||
|
# Paracon is now installed without the version in its file name
|
||||||
|
rm -f "$HOME"/.local/bin/paracon_*.pyz
|
||||||
|
# Hooks from before HamPack was a sibling; 71-siblings.sh now runs this script
|
||||||
|
rm -f "$COREDESKTOP"/updates.d/[0-9][0-9][0-9]-hampack-*
|
||||||
|
}
|
||||||
|
|
||||||
|
install_tools() {
|
||||||
|
mkdir -p "$HOME/.local/bin"
|
||||||
|
install_script "$SELF/hampackremove" "$HOME/.local/bin/hampackremove"
|
||||||
|
}
|
||||||
|
|
||||||
|
install_hampack_packages() {
|
||||||
|
source "$SELF/packages.conf"
|
||||||
|
install_packages "${UTILITIES[@]}" && install_packages "${APPLICATIONS[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
|
install_not1mm() {
|
||||||
|
if command -v uv &> /dev/null && uv tool list 2> /dev/null | grep -q '^not1mm '; then
|
||||||
|
uv tool upgrade not1mm
|
||||||
|
else
|
||||||
|
curl -LsSf uvx.sh/not1mm/install.sh | sh
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
install_dxpy() {
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
|
install_desktop_files() {
|
||||||
|
mkdir -p "$HOME/.local/share/applications"
|
||||||
|
sed "s|\$HAMPACK_DIR|$SELF|g; s|\$HOME|$HOME|g" "$SELF/desktop/js8call.desktop" \
|
||||||
|
> "$HOME/.local/share/applications/js8call.desktop" &&
|
||||||
|
update-desktop-database "$HOME/.local/share/applications/"
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- Main ---
|
||||||
|
|
||||||
|
echo "Updating HamPack..."
|
||||||
|
|
||||||
|
step "Removing stale HamPack files" remove_stale_files
|
||||||
|
step "Installing HamPack tools" install_tools
|
||||||
|
step "Installing HamPack packages" install_hampack_packages
|
||||||
|
step "Installing Flatpak applications" bash "$SELF/install-flatpaks.sh"
|
||||||
|
step "Installing pre-built binaries" bash "$SELF/install-binaries.sh"
|
||||||
|
step "Installing compiled applications" bash "$SELF/install-compiled.sh"
|
||||||
|
step "Installing Windows applications" bash "$SELF/install-windows-apps.sh"
|
||||||
|
step "Installing not1mm" install_not1mm
|
||||||
|
step "Installing dx.py" install_dxpy
|
||||||
|
step "Installing desktop files" install_desktop_files
|
||||||
|
|
||||||
|
if (( ${#FAILED[@]} > 0 )); then
|
||||||
|
echo "HamPack updated, with errors in: ${FAILED[*]}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "✓ HamPack updated."
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# /etc/coredesktop/updaters.d/100-hampack-pull
|
|
||||||
|
|
||||||
HAMPACK_DIR="$HOME/.local/share/HamPack"
|
|
||||||
|
|
||||||
is_installed() {
|
|
||||||
[[ -d "$HAMPACK_DIR" ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
run_update() {
|
|
||||||
echo "→ Pulling latest HamPack..."
|
|
||||||
git -C "$HAMPACK_DIR" pull --ff-only
|
|
||||||
echo "✓ HamPack pulled."
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# /etc/coredesktop/updaters.d/105-hampack-cleanup
|
|
||||||
|
|
||||||
is_installed() {
|
|
||||||
[[ -f "$HOME/.local/bin/hampack" ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
run_update() {
|
|
||||||
echo "→ Removing stale HamPack app..."
|
|
||||||
rm -f "$HOME/.local/bin/hampack"
|
|
||||||
rm -f "$HOME/.local/share/applications/hampack.desktop"
|
|
||||||
echo "✓ Stale HamPack app removed."
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# /etc/coredesktop/updaters.d/110-hampack-tools
|
|
||||||
|
|
||||||
HAMPACK_DIR="$HOME/.local/share/HamPack"
|
|
||||||
|
|
||||||
is_installed() {
|
|
||||||
[[ -d "$HAMPACK_DIR" ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
run_update() {
|
|
||||||
echo "→ Updating HamPack tools..."
|
|
||||||
cp "$HAMPACK_DIR/hampackrefresh" "$HOME/.local/bin/hampackrefresh"
|
|
||||||
cp "$HAMPACK_DIR/hampackupdate" "$HOME/.local/bin/hampackupdate"
|
|
||||||
cp "$HAMPACK_DIR/hampackremove" "$HOME/.local/bin/hampackremove"
|
|
||||||
echo "✓ HamPack tools updated."
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# /etc/coredesktop/updaters.d/120-hampack-packages
|
|
||||||
|
|
||||||
HAMPACK_DIR="$HOME/.local/share/HamPack"
|
|
||||||
|
|
||||||
is_installed() {
|
|
||||||
[[ -f "$HAMPACK_DIR/packages.conf" ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
run_update() {
|
|
||||||
echo "→ Updating HamPack packages..."
|
|
||||||
source "$HAMPACK_DIR/utils.sh"
|
|
||||||
source "$HAMPACK_DIR/packages.conf"
|
|
||||||
install_packages "${UTILITIES[@]}"
|
|
||||||
install_packages "${APPLICATIONS[@]}"
|
|
||||||
echo "✓ HamPack packages updated."
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# /etc/coredesktop/updaters.d/130-hampack-flatpaks
|
|
||||||
|
|
||||||
HAMPACK_DIR="$HOME/.local/share/HamPack"
|
|
||||||
|
|
||||||
is_installed() {
|
|
||||||
[[ -d "$HAMPACK_DIR" ]] && command -v flatpak &>/dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
run_update() {
|
|
||||||
echo "→ Updating HamPack Flatpaks..."
|
|
||||||
bash "$HAMPACK_DIR/install-flatpaks.sh"
|
|
||||||
echo "✓ HamPack Flatpaks updated."
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# /etc/coredesktop/updaters.d/140-hampack-compiled
|
|
||||||
|
|
||||||
HAMPACK_DIR="$HOME/.local/share/HamPack"
|
|
||||||
|
|
||||||
is_installed() {
|
|
||||||
[[ -f "$HAMPACK_DIR/compile.conf" ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
run_update() {
|
|
||||||
echo "→ Updating HamPack compiled apps..."
|
|
||||||
bash "$HAMPACK_DIR/install-compiled.sh"
|
|
||||||
echo "✓ HamPack compiled apps updated."
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# /etc/coredesktop/updaters.d/150-hampack-windows
|
|
||||||
|
|
||||||
HAMPACK_DIR="$HOME/.local/share/HamPack"
|
|
||||||
|
|
||||||
is_installed() {
|
|
||||||
[[ -d "$HAMPACK_DIR" ]] && command -v wine &>/dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
run_update() {
|
|
||||||
echo "→ Updating HamPack Windows apps..."
|
|
||||||
bash "$HAMPACK_DIR/install-windows-apps.sh"
|
|
||||||
echo "✓ HamPack Windows apps updated."
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# /etc/coredesktop/updaters.d/160-hampack-extras
|
|
||||||
|
|
||||||
is_installed() {
|
|
||||||
command -v curl &>/dev/null && command -v wget &>/dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
run_update() {
|
|
||||||
echo "→ Upgrading uv tools..."
|
|
||||||
uv tool upgrade --all
|
|
||||||
|
|
||||||
echo "→ Updating 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 "✓ Extras updated."
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Function to check if a package is installed
|
|
||||||
is_installed() {
|
|
||||||
pacman -Qi "$1" &> /dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to check if a package is installed
|
|
||||||
is_group_installed() {
|
|
||||||
pacman -Qg "$1" &> /dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to install packages if not already installed
|
|
||||||
install_packages() {
|
|
||||||
local packages=("$@")
|
|
||||||
local to_install=()
|
|
||||||
|
|
||||||
for pkg in "${packages[@]}"; do
|
|
||||||
if ! is_installed "$pkg" && ! is_group_installed "$pkg"; then
|
|
||||||
to_install+=("$pkg")
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ ${#to_install[@]} -ne 0 ]; then
|
|
||||||
echo "Installing: ${to_install[*]}"
|
|
||||||
yay -S --noconfirm "${to_install[@]}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user