|
|
|
|
@@ -4,52 +4,41 @@
|
|
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
# Install binaries
|
|
|
|
|
echo "📦 Installing BackTunnel binaries to /usr/local/bin..."
|
|
|
|
|
sudo install -m 0755 scripts/backtunnel-share /usr/local/bin/backtunnel-share
|
|
|
|
|
sudo install -m 0755 scripts/backtunnel-access /usr/local/bin/backtunnel-access
|
|
|
|
|
PREFIX=${PREFIX:-/usr}
|
|
|
|
|
BINDIR="$PREFIX/bin"
|
|
|
|
|
MANDIR="$PREFIX/share/man/man1"
|
|
|
|
|
KIO_SM="$PREFIX/share/kio/servicemenus"
|
|
|
|
|
KSVC5="$PREFIX/share/kservices5/ServiceMenus"
|
|
|
|
|
APPDIR="$PREFIX/share/applications"
|
|
|
|
|
BCOMP="$PREFIX/share/bash-completion/completions"
|
|
|
|
|
|
|
|
|
|
# Man page
|
|
|
|
|
echo "📚 Installing man page..."
|
|
|
|
|
sudo install -m 0644 man/backtunnel.1 /usr/local/share/man/man1/backtunnel.1 || true
|
|
|
|
|
sudo mandb || true
|
|
|
|
|
echo "Removing BackTunnel from $PREFIX ..."
|
|
|
|
|
|
|
|
|
|
# Bash completions
|
|
|
|
|
if [[ -d /usr/share/bash-completion/completions ]]; then
|
|
|
|
|
echo "🧠 Installing bash completion ..."
|
|
|
|
|
sudo install -m 0644 completions/backtunnel.bash /usr/share/bash-completion/completions/backtunnel-share || true
|
|
|
|
|
sudo install -m 0644 completions/backtunnel.bash /usr/share/bash-completion/completions/backtunnel-access || true
|
|
|
|
|
elif [[ -d /etc/bash_completion.d ]]; then
|
|
|
|
|
echo "🧠 Installing bash completion ..."
|
|
|
|
|
sudo install -m 0644 completions/backtunnel.bash /etc/bash_completion.d/backtunnel || true
|
|
|
|
|
fi
|
|
|
|
|
rm -f "$BINDIR/backtunnel-share" \
|
|
|
|
|
"$BINDIR/backtunnel-access" \
|
|
|
|
|
"$BINDIR/backtunnel-share-gui" \
|
|
|
|
|
"$BINDIR/backtunnel-access-gui"
|
|
|
|
|
|
|
|
|
|
# Dolphin service menus (Plasma 6)
|
|
|
|
|
if [[ -d /usr/share/kio/servicemenus ]]; then
|
|
|
|
|
echo "🖱️ Installing Dolphin service menus (Plasma 6)..."
|
|
|
|
|
sudo install -m 0644 servicemenus/backtunnel_share.desktop /usr/share/kio/servicemenus/backtunnel_share.desktop || true
|
|
|
|
|
sudo install -m 0644 servicemenus/backtunnel_access.desktop /usr/share/kio/servicemenus/backtunnel_access.desktop || true
|
|
|
|
|
fi
|
|
|
|
|
rm -f "$MANDIR/backtunnel.1"
|
|
|
|
|
|
|
|
|
|
# Dolphin service menus (Plasma 5)
|
|
|
|
|
if [[ -d /usr/share/kservices5/ServiceMenus ]]; then
|
|
|
|
|
echo "🖱️ Installing Dolphin service menus (Plasma 5)..."
|
|
|
|
|
sudo install -m 0644 servicemenus/backtunnel_share.desktop /usr/share/kservices5/ServiceMenus/backtunnel_share.desktop || true
|
|
|
|
|
sudo install -m 0644 servicemenus/backtunnel_access.desktop /usr/share/kservices5/ServiceMenus/backtunnel_access.desktop || true
|
|
|
|
|
fi
|
|
|
|
|
rm -f "$BCOMP/backtunnel-share" \
|
|
|
|
|
"$BCOMP/backtunnel-access"
|
|
|
|
|
|
|
|
|
|
# Desktop launcher (optional)
|
|
|
|
|
if [[ -d /usr/share/applications ]]; then
|
|
|
|
|
echo "🖥️ Installing desktop launcher ..."
|
|
|
|
|
sudo install -m 0644 desktop/backtunnel.desktop /usr/share/applications/backtunnel.desktop || true
|
|
|
|
|
fi
|
|
|
|
|
rm -f "$KIO_SM/backtunnel_share.desktop" \
|
|
|
|
|
"$KIO_SM/backtunnel_access.desktop" \
|
|
|
|
|
"$KSVC5/backtunnel_share.desktop" \
|
|
|
|
|
"$KSVC5/backtunnel_access.desktop"
|
|
|
|
|
|
|
|
|
|
# Refresh desktop DB and KDE service cache (best-effort)
|
|
|
|
|
command -v update-desktop-database >/dev/null 2>&1 && sudo update-desktop-database -q || true
|
|
|
|
|
rm -f "$APPDIR/backtunnel.desktop" || true
|
|
|
|
|
|
|
|
|
|
# Do not remove /usr/share/backtunnel/profiles.ini (packaged example) — leave it.
|
|
|
|
|
|
|
|
|
|
# Refresh caches
|
|
|
|
|
command -v update-desktop-database >/dev/null 2>&1 && update-desktop-database -q || true
|
|
|
|
|
if command -v kbuildsycoca6 >/dev/null 2>&1; then
|
|
|
|
|
kbuildsycoca6 --noincremental >/dev/null 2>&1 || true
|
|
|
|
|
elif command -v kbuildsycoca5 >/dev/null 2>&1; then
|
|
|
|
|
kbuildsycoca5 --noincremental >/dev/null 2>&1 || true
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "✅ BackTunnel installed. You may need to restart your shell and Dolphin."
|
|
|
|
|
echo "BackTunnel removed."
|
|
|
|
|
|