mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-18 22:16:18 -05:00
fix: remove installed VPN script on uninstall
This commit is contained in:
11 files changed
+74
-5
No files matched your search
@@ -47,6 +47,7 @@ makedepends="
|
||||
"
|
||||
source="$pkgname-$pkgver.tar.gz"
|
||||
builddir="$srcdir/$pkgname-$pkgver"
|
||||
install="$pkgname.post-deinstall"
|
||||
options="!check"
|
||||
|
||||
build() {
|
||||
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm -f \
|
||||
/var/lib/gpclient/scripts/vpnc-script \
|
||||
/var/lib/gpclient/scripts/vpnc-script.metadata ||
|
||||
echo "Warning: failed to remove the installed VPN script" >&2
|
||||
rmdir /var/lib/gpclient/scripts 2>/dev/null || true
|
||||
@@ -14,6 +14,11 @@ post_upgrade() {
|
||||
|
||||
post_remove() {
|
||||
rm -f /usr/bin/gpgui
|
||||
rm -f \
|
||||
/var/lib/gpclient/scripts/vpnc-script \
|
||||
/var/lib/gpclient/scripts/vpnc-script.metadata ||
|
||||
echo "Warning: failed to remove the installed VPN script" >&2
|
||||
rmdir /var/lib/gpclient/scripts 2>/dev/null || true
|
||||
update-mime-database /usr/share/mime
|
||||
update-desktop-database -q
|
||||
}
|
||||
@@ -51,3 +51,8 @@ uninstall:
|
||||
rm -f $(DESTDIR)/usr/share/icons/hicolor/256x256/apps/gpgui.png
|
||||
rm -f $(DESTDIR)/usr/share/icons/hicolor/256x256@2/apps/gpgui.png
|
||||
rm -f $(DESTDIR)/usr/share/polkit-1/actions/com.yuezk.gpgui.policy
|
||||
|
||||
rm -f $(DESTDIR)/var/lib/gpclient/scripts/vpnc-script \
|
||||
$(DESTDIR)/var/lib/gpclient/scripts/vpnc-script.metadata || \
|
||||
echo "Warning: failed to remove the installed VPN script" >&2
|
||||
rmdir $(DESTDIR)/var/lib/gpclient/scripts 2>/dev/null || true
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
root=${PKG_ROOTDIR:-}
|
||||
|
||||
rm -f \
|
||||
"$root/var/db/gpclient/scripts/vpnc-script" \
|
||||
"$root/var/db/gpclient/scripts/vpnc-script.metadata" ||
|
||||
echo "Warning: failed to remove the installed VPN script" >&2
|
||||
rmdir "$root/var/db/gpclient/scripts" 2>/dev/null || true
|
||||
+12
-1
@@ -2,7 +2,18 @@
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
purge|remove|upgrade)
|
||||
purge|remove)
|
||||
rm -f \
|
||||
/var/lib/gpclient/scripts/vpnc-script \
|
||||
/var/lib/gpclient/scripts/vpnc-script.metadata ||
|
||||
echo "Warning: failed to remove the installed VPN script" >&2
|
||||
rmdir /var/lib/gpclient/scripts 2>/dev/null || true
|
||||
|
||||
# Remove the gpgui binary downloaded at runtime
|
||||
rm -f /usr/bin/gpgui
|
||||
;;
|
||||
|
||||
upgrade)
|
||||
# Remove the gpgui binary downloaded at runtime
|
||||
rm -f /usr/bin/gpgui
|
||||
;;
|
||||
|
||||
@@ -14,6 +14,7 @@ depends=('webkit2gtk-4.1' 'libappindicator-gtk3' 'librsvg' 'libsecret' 'openssl'
|
||||
optdepends=('wmctrl: for window management')
|
||||
|
||||
provides=('globalprotect-openconnect' 'gpclient' 'gpservice' 'gpauth' 'gpgui')
|
||||
install=gp.install
|
||||
|
||||
source=("${_pkgname}-${pkgver}.tar.gz")
|
||||
sha256sums=('SKIP')
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
post_remove() {
|
||||
rm -f \
|
||||
/var/lib/gpclient/scripts/vpnc-script \
|
||||
/var/lib/gpclient/scripts/vpnc-script.metadata ||
|
||||
echo "Warning: failed to remove the installed VPN script" >&2
|
||||
rmdir /var/lib/gpclient/scripts 2>/dev/null || true
|
||||
}
|
||||
@@ -50,6 +50,13 @@ A GUI for GlobalProtect VPN, based on OpenConnect, supports the SSO authenticati
|
||||
|
||||
%postun
|
||||
rm -f %{_bindir}/gpgui
|
||||
if [ "$1" -eq 0 ]; then
|
||||
rm -f \
|
||||
/var/lib/gpclient/scripts/vpnc-script \
|
||||
/var/lib/gpclient/scripts/vpnc-script.metadata ||
|
||||
echo "Warning: failed to remove the installed VPN script" >&2
|
||||
rmdir /var/lib/gpclient/scripts 2>/dev/null || :
|
||||
fi
|
||||
|
||||
%build
|
||||
# The injected RUSTFLAGS could fail the build
|
||||
|
||||
Reference in new issue
Block a user