Update BackTunnel PKGBUILD: add profile management, improve script installs, and enhance Plasma integration

This commit is contained in:
2025-09-14 19:44:46 +02:00
parent dfa39dcaa9
commit cae2543fe1
2 changed files with 55 additions and 19 deletions

View File

@@ -5,7 +5,7 @@
pkgname=backtunnel
pkgver=0.0.0
pkgrel=1
pkgdesc="BackTunnel Reverse SSH folder sharing toolkit with Dolphin (KDE) service menus (with GUI wrapper)"
pkgdesc="BackTunnel Reverse SSH folder sharing toolkit with Dolphin (KDE) service menus, GUI wrapper, and profiles"
arch=('any')
url="https://labs.pmisuite.com/PMISuite/BackTunnel"
license=('GPL3')
@@ -26,8 +26,7 @@ pkgver() {
build() {
cd "${srcdir}/BackTunnel"
# nothing to build
:
: # nothing to build
}
package() {
@@ -36,9 +35,28 @@ package() {
# Binaries
install -Dm755 "scripts/backtunnel-share" "${pkgdir}/usr/bin/backtunnel-share"
install -Dm755 "scripts/backtunnel-access" "${pkgdir}/usr/bin/backtunnel-access"
# NEW: GUI wrapper for Dolphin service menu
install -Dm755 "scripts/backtunnel-share-gui" "${pkgdir}/usr/bin/backtunnel-share-gui"
# Optional helper to create per-user config from example
if [[ -f "scripts/backtunnel-init" ]]; then
install -Dm755 "scripts/backtunnel-init" "${pkgdir}/usr/bin/backtunnel-init"
else
# Provide a tiny builtin version if script missing (safe)
install -Dm755 /dev/stdin "${pkgdir}/usr/bin/backtunnel-init" <<'EOF'
#!/usr/bin/env bash
set -euo pipefail
SRC="/usr/share/backtunnel/profiles.ini"
DST="${XDG_CONFIG_HOME:-$HOME/.config}/backtunnel/profiles.ini"
mkdir -p "$(dirname "$DST")"
if [[ -f "$DST" ]]; then
echo "backtunnel: ${DST} already exists — not overwriting."
exit 0
fi
cp "$SRC" "$DST"
echo "backtunnel: wrote ${DST}. Edit it to customize profiles."
EOF
fi
# Man page
install -Dm644 "man/backtunnel.1" "${pkgdir}/usr/share/man/man1/backtunnel.1"
@@ -46,15 +64,19 @@ package() {
install -Dm644 "completions/backtunnel.bash" "${pkgdir}/usr/share/bash-completion/completions/backtunnel-share"
install -Dm644 "completions/backtunnel.bash" "${pkgdir}/usr/share/bash-completion/completions/backtunnel-access"
# Desktop launcher (if present)
# Dolphin service menus (Plasma 6 path)
install -Dm644 "servicemenus/backtunnel_share.desktop" "${pkgdir}/usr/share/kio/servicemenus/backtunnel_share.desktop"
install -Dm644 "servicemenus/backtunnel_access.desktop" "${pkgdir}/usr/share/kio/servicemenus/backtunnel_access.desktop"
# Plasma 5 legacy path (harmless if unused)
install -Dm644 "servicemenus/backtunnel_share.desktop" "${pkgdir}/usr/share/kservices5/ServiceMenus/backtunnel_share.desktop"
install -Dm644 "servicemenus/backtunnel_access.desktop" "${pkgdir}/usr/share/kservices5/ServiceMenus/backtunnel_access.desktop"
# Optional desktop launcher if present
if [[ -f "desktop/backtunnel.desktop" ]]; then
install -Dm644 "desktop/backtunnel.desktop" "${pkgdir}/usr/share/applications/backtunnel.desktop"
fi
# Dolphin service menus
install -Dm644 "servicemenus/backtunnel_share.desktop" "${pkgdir}/usr/share/kio/servicemenus/backtunnel_share.desktop"
install -Dm644 "servicemenus/backtunnel_access.desktop" "${pkgdir}/usr/share/kio/servicemenus/backtunnel_access.desktop"
# Plasma 5 legacy path (keep for users on older Plasma)
install -Dm644 "servicemenus/backtunnel_share.desktop" "${pkgdir}/usr/share/kservices5/ServiceMenus/backtunnel_share.desktop"
install -Dm644 "servicemenus/backtunnel_access.desktop" "${pkgdir}/usr/share/kservices5/ServiceMenus/backtunnel_access.desktop"
# Profiles: system default + packaged example/fallback
install -Dm644 "docs/profiles.ini.example" "${pkgdir}/etc/backtunnel/profiles.ini"
install -Dm644 "docs/profiles.ini.example" "${pkgdir}/usr/share/backtunnel/profiles.ini"
}

View File

@@ -9,6 +9,20 @@ post_install() {
elif command -v kbuildsycoca5 >/dev/null 2>&1; then
kbuildsycoca5 --noincremental >/dev/null 2>&1 || true
fi
cat <<'EOF'
==> BackTunnel profiles
Per-user: ~/.config/backtunnel/profiles.ini
System-wide: /etc/backtunnel/profiles.ini
Example: /usr/share/backtunnel/profiles.ini
To create a per-user config from the example, run:
backtunnel-init
or manually:
mkdir -p ~/.config/backtunnel
cp /usr/share/backtunnel/profiles.ini ~/.config/backtunnel/profiles.ini
# then edit ~/.config/backtunnel/profiles.ini
EOF
}
post_upgrade() {