2025-09-14 11:42:27 +02:00
|
|
|
|
# Maintainer: Matjaž Mozetič <matjaz@matmoz.si>
|
|
|
|
|
|
# Project: BackTunnel – Reverse SSH folder sharing toolkit with Dolphin (KDE) integration
|
|
|
|
|
|
# Repo: https://labs.pmisuite.com/PMISuite/BackTunnel
|
|
|
|
|
|
|
|
|
|
|
|
pkgname=backtunnel
|
2025-09-20 11:16:49 +02:00
|
|
|
|
pkgver=0.0.0
|
2025-09-14 11:42:27 +02:00
|
|
|
|
pkgrel=1
|
2025-09-20 11:16:49 +02:00
|
|
|
|
pkgdesc="BackTunnel – Reverse SSH folder sharing toolkit with Dolphin (KDE) service menus, GUI/TUI wrappers, and profiles"
|
2025-09-14 11:42:27 +02:00
|
|
|
|
arch=('any')
|
|
|
|
|
|
url="https://labs.pmisuite.com/PMISuite/BackTunnel"
|
|
|
|
|
|
license=('GPL3')
|
2025-09-14 18:08:22 +02:00
|
|
|
|
depends=('bash' 'openssh' 'sshfs' 'kdialog' 'konsole' 'coreutils')
|
2025-09-20 11:16:49 +02:00
|
|
|
|
optdepends=(
|
|
|
|
|
|
'qrencode: show QR code for invites'
|
|
|
|
|
|
'bash-completion: tab completion for backtunnel-share/access'
|
|
|
|
|
|
'plasma-desktop: Dolphin (KDE/Plasma) service menus'
|
|
|
|
|
|
)
|
2025-09-14 11:42:27 +02:00
|
|
|
|
makedepends=('git')
|
|
|
|
|
|
install=${pkgname}.install
|
2025-09-14 20:53:26 +02:00
|
|
|
|
backup=('etc/backtunnel/profiles.ini')
|
2025-09-14 18:08:22 +02:00
|
|
|
|
source=("git+https://labs.pmisuite.com/PMISuite/BackTunnel.git")
|
2025-09-14 20:53:26 +02:00
|
|
|
|
sha256sums=('SKIP')
|
2025-09-14 11:42:27 +02:00
|
|
|
|
|
|
|
|
|
|
pkgver() {
|
|
|
|
|
|
cd "${srcdir}/BackTunnel"
|
2025-09-14 18:08:22 +02:00
|
|
|
|
# generate a pkgver like: 0.0.0.r<N>.g<commit>
|
|
|
|
|
|
printf "0.0.0.r%s.g%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
build() {
|
|
|
|
|
|
cd "${srcdir}/BackTunnel"
|
2025-09-14 19:44:46 +02:00
|
|
|
|
: # nothing to build
|
2025-09-14 11:42:27 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
package() {
|
|
|
|
|
|
cd "${srcdir}/BackTunnel"
|
|
|
|
|
|
|
|
|
|
|
|
# Binaries
|
2025-09-14 20:53:26 +02:00
|
|
|
|
install -Dm755 "scripts/backtunnel-share" "${pkgdir}/usr/bin/backtunnel-share"
|
|
|
|
|
|
install -Dm755 "scripts/backtunnel-access" "${pkgdir}/usr/bin/backtunnel-access"
|
|
|
|
|
|
install -Dm755 "scripts/backtunnel-share-gui" "${pkgdir}/usr/bin/backtunnel-share-gui"
|
|
|
|
|
|
install -Dm755 "scripts/backtunnel-access-gui" "${pkgdir}/usr/bin/backtunnel-access-gui"
|
2025-09-19 15:32:01 +02:00
|
|
|
|
install -Dm755 "scripts/backtunnel-open-term" "${pkgdir}/usr/bin/backtunnel-open-term"
|
|
|
|
|
|
install -Dm755 "scripts/backtunnel-share-tui" "${pkgdir}/usr/bin/backtunnel-share-tui"
|
|
|
|
|
|
install -Dm755 "scripts/backtunnel-access-tui" "${pkgdir}/usr/bin/backtunnel-access-tui"
|
2025-09-20 11:16:49 +02:00
|
|
|
|
install -Dm755 "scripts/backtunnel-auth-setup" "${pkgdir}/usr/bin/backtunnel-auth-setup"
|
2025-09-14 19:44:46 +02:00
|
|
|
|
|
|
|
|
|
|
# Optional helper to create per-user config from example
|
|
|
|
|
|
if [[ -f "scripts/backtunnel-init" ]]; then
|
2025-09-14 20:53:26 +02:00
|
|
|
|
install -Dm755 "scripts/backtunnel-init" "${pkgdir}/usr/bin/backtunnel-init"
|
2025-09-14 19:44:46 +02:00
|
|
|
|
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
|
2025-09-14 11:42:27 +02:00
|
|
|
|
|
|
|
|
|
|
# Man page
|
2025-09-14 20:53:26 +02:00
|
|
|
|
install -Dm644 "man/backtunnel.1" "${pkgdir}/usr/share/man/man1/backtunnel.1"
|
2025-09-14 11:42:27 +02:00
|
|
|
|
|
|
|
|
|
|
# Bash completion (install for both command names)
|
2025-09-14 20:53:26 +02:00
|
|
|
|
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"
|
2025-09-14 11:42:27 +02:00
|
|
|
|
|
2025-09-14 19:44:46 +02:00
|
|
|
|
# Dolphin service menus (Plasma 6 path)
|
2025-09-14 20:53:26 +02:00
|
|
|
|
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"
|
2025-09-14 19:44:46 +02:00
|
|
|
|
# Plasma 5 legacy path (harmless if unused)
|
2025-09-14 20:53:26 +02:00
|
|
|
|
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"
|
2025-09-14 19:44:46 +02:00
|
|
|
|
|
|
|
|
|
|
# Optional desktop launcher if present
|
|
|
|
|
|
if [[ -f "desktop/backtunnel.desktop" ]]; then
|
2025-09-14 20:53:26 +02:00
|
|
|
|
install -Dm644 "desktop/backtunnel.desktop" "${pkgdir}/usr/share/applications/backtunnel.desktop"
|
2025-09-14 19:44:46 +02:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Profiles: system default + packaged example/fallback
|
2025-09-14 20:53:26 +02:00
|
|
|
|
install -Dm644 "docs/profiles.ini.example" "${pkgdir}/etc/backtunnel/profiles.ini"
|
|
|
|
|
|
install -Dm644 "docs/profiles.ini.example" "${pkgdir}/usr/share/backtunnel/profiles.ini"
|
2025-09-14 11:42:27 +02:00
|
|
|
|
}
|