fix: separate packaged and runtime GUI binaries

This commit is contained in:
Kevin Yue committed 2026-08-07 16:38:03 +08:00
1 parent 58738f6fd7
commit c92bdaed1d
15 files changed
+251 -59

No files matched your search

+3 -1
View File
@@ -1,7 +1,9 @@
#!/bin/sh
rm -f \
/var/lib/gpclient/gpgui \
/var/lib/gpclient/scripts/vpnc-script \
/var/lib/gpclient/scripts/vpnc-script.metadata ||
echo "Warning: failed to remove the installed VPN script" >&2
echo "Warning: failed to remove gpclient runtime files" >&2
rmdir /var/lib/gpclient/scripts 2>/dev/null || true
rmdir /var/lib/gpclient 2>/dev/null || true
@@ -3,22 +3,19 @@ post_install() {
update-desktop-database -q
}
pre_upgrade() {
rm -f /usr/bin/gpgui
}
post_upgrade() {
update-mime-database /usr/share/mime
update-desktop-database -q
}
post_remove() {
rm -f /usr/bin/gpgui
rm -f \
/var/lib/gpclient/gpgui \
/var/lib/gpclient/scripts/vpnc-script \
/var/lib/gpclient/scripts/vpnc-script.metadata ||
echo "Warning: failed to remove the installed VPN script" >&2
echo "Warning: failed to remove gpclient runtime files" >&2
rmdir /var/lib/gpclient/scripts 2>/dev/null || true
rmdir /var/lib/gpclient 2>/dev/null || true
update-mime-database /usr/share/mime
update-desktop-database -q
}
+3 -1
View File
@@ -53,6 +53,8 @@ uninstall:
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/gpgui \
$(DESTDIR)/var/lib/gpclient/scripts/vpnc-script.metadata || \
echo "Warning: failed to remove the installed VPN script" >&2
echo "Warning: failed to remove gpclient runtime files" >&2
rmdir $(DESTDIR)/var/lib/gpclient/scripts 2>/dev/null || true
rmdir $(DESTDIR)/var/lib/gpclient 2>/dev/null || true
+4 -1
View File
@@ -3,7 +3,10 @@
root=${PKG_ROOTDIR:-}
rm -f \
"$root/usr/local/libexec/gpclient/gpgui" \
"$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
echo "Warning: failed to remove gpclient runtime files" >&2
rmdir "$root/usr/local/libexec/gpclient" 2>/dev/null || true
rmdir "$root/var/db/gpclient/scripts" 2>/dev/null || true
rmdir "$root/var/db/gpclient" 2>/dev/null || true
+3 -9
View File
@@ -4,18 +4,12 @@ set -e
case "$1" in
purge|remove)
rm -f \
/var/lib/gpclient/gpgui \
/var/lib/gpclient/scripts/vpnc-script \
/var/lib/gpclient/scripts/vpnc-script.metadata ||
echo "Warning: failed to remove the installed VPN script" >&2
echo "Warning: failed to remove gpclient runtime files" >&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
rmdir /var/lib/gpclient 2>/dev/null || true
;;
*)
+3 -1
View File
@@ -1,7 +1,9 @@
post_remove() {
rm -f \
/var/lib/gpclient/gpgui \
/var/lib/gpclient/scripts/vpnc-script \
/var/lib/gpclient/scripts/vpnc-script.metadata ||
echo "Warning: failed to remove the installed VPN script" >&2
echo "Warning: failed to remove gpclient runtime files" >&2
rmdir /var/lib/gpclient/scripts 2>/dev/null || true
rmdir /var/lib/gpclient 2>/dev/null || true
}
@@ -51,12 +51,13 @@ A GUI for GlobalProtect VPN, based on OpenConnect, supports the SSO authenticati
%postun
if [ "$1" -eq 0 ]; then
rm -f %{_bindir}/gpgui
rm -f \
/var/lib/gpclient/gpgui \
/var/lib/gpclient/scripts/vpnc-script \
/var/lib/gpclient/scripts/vpnc-script.metadata ||
echo "Warning: failed to remove the installed VPN script" >&2
echo "Warning: failed to remove gpclient runtime files" >&2
rmdir /var/lib/gpclient/scripts 2>/dev/null || :
rmdir /var/lib/gpclient 2>/dev/null || :
fi
%build