Update BackTunnel PKGBUILD: add profile management, improve script installs, and enhance Plasma integration
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
pkgname=backtunnel
|
pkgname=backtunnel
|
||||||
pkgver=0.0.0
|
pkgver=0.0.0
|
||||||
pkgrel=1
|
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')
|
arch=('any')
|
||||||
url="https://labs.pmisuite.com/PMISuite/BackTunnel"
|
url="https://labs.pmisuite.com/PMISuite/BackTunnel"
|
||||||
license=('GPL3')
|
license=('GPL3')
|
||||||
@@ -26,35 +26,57 @@ pkgver() {
|
|||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd "${srcdir}/BackTunnel"
|
cd "${srcdir}/BackTunnel"
|
||||||
# nothing to build
|
: # nothing to build
|
||||||
:
|
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "${srcdir}/BackTunnel"
|
cd "${srcdir}/BackTunnel"
|
||||||
|
|
||||||
# Binaries
|
# Binaries
|
||||||
install -Dm755 "scripts/backtunnel-share" "${pkgdir}/usr/bin/backtunnel-share"
|
install -Dm755 "scripts/backtunnel-share" "${pkgdir}/usr/bin/backtunnel-share"
|
||||||
install -Dm755 "scripts/backtunnel-access" "${pkgdir}/usr/bin/backtunnel-access"
|
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"
|
||||||
install -Dm755 "scripts/backtunnel-share-gui" "${pkgdir}/usr/bin/backtunnel-share-gui"
|
|
||||||
|
|
||||||
# Man page
|
# Optional helper to create per-user config from example
|
||||||
install -Dm644 "man/backtunnel.1" "${pkgdir}/usr/share/man/man1/backtunnel.1"
|
if [[ -f "scripts/backtunnel-init" ]]; then
|
||||||
|
install -Dm755 "scripts/backtunnel-init" "${pkgdir}/usr/bin/backtunnel-init"
|
||||||
# Bash completion (install for both command names)
|
else
|
||||||
install -Dm644 "completions/backtunnel.bash" "${pkgdir}/usr/share/bash-completion/completions/backtunnel-share"
|
# Provide a tiny builtin version if script missing (safe)
|
||||||
install -Dm644 "completions/backtunnel.bash" "${pkgdir}/usr/share/bash-completion/completions/backtunnel-access"
|
install -Dm755 /dev/stdin "${pkgdir}/usr/bin/backtunnel-init" <<'EOF'
|
||||||
|
#!/usr/bin/env bash
|
||||||
# Desktop launcher (if present)
|
set -euo pipefail
|
||||||
if [[ -f "desktop/backtunnel.desktop" ]]; then
|
SRC="/usr/share/backtunnel/profiles.ini"
|
||||||
install -Dm644 "desktop/backtunnel.desktop" "${pkgdir}/usr/share/applications/backtunnel.desktop"
|
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
|
fi
|
||||||
|
|
||||||
# Dolphin service menus
|
# Man page
|
||||||
|
install -Dm644 "man/backtunnel.1" "${pkgdir}/usr/share/man/man1/backtunnel.1"
|
||||||
|
|
||||||
|
# Bash completion (install for both command names)
|
||||||
|
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"
|
||||||
|
|
||||||
|
# Dolphin service menus (Plasma 6 path)
|
||||||
install -Dm644 "servicemenus/backtunnel_share.desktop" "${pkgdir}/usr/share/kio/servicemenus/backtunnel_share.desktop"
|
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"
|
install -Dm644 "servicemenus/backtunnel_access.desktop" "${pkgdir}/usr/share/kio/servicemenus/backtunnel_access.desktop"
|
||||||
# Plasma 5 legacy path (keep for users on older Plasma)
|
# 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_share.desktop" "${pkgdir}/usr/share/kservices5/ServiceMenus/backtunnel_share.desktop"
|
||||||
install -Dm644 "servicemenus/backtunnel_access.desktop" "${pkgdir}/usr/share/kservices5/ServiceMenus/backtunnel_access.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
|
||||||
|
|
||||||
|
# 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"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,20 @@ post_install() {
|
|||||||
elif command -v kbuildsycoca5 >/dev/null 2>&1; then
|
elif command -v kbuildsycoca5 >/dev/null 2>&1; then
|
||||||
kbuildsycoca5 --noincremental >/dev/null 2>&1 || true
|
kbuildsycoca5 --noincremental >/dev/null 2>&1 || true
|
||||||
fi
|
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() {
|
post_upgrade() {
|
||||||
|
|||||||
Reference in New Issue
Block a user