From 59dee3d76778e7529ad5db0d1d6d476c85830170 Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Mon, 11 Mar 2024 07:55:49 -0400 Subject: [PATCH] Update packaging script --- .github/workflows/publish.yaml | 6 +++++- Makefile | 1 + packaging/deb/control.in | 3 +-- packaging/deb/postrm | 14 ++++++++++++++ packaging/rpm/globalprotect-openconnect.spec.in | 3 +++ 5 files changed, 24 insertions(+), 3 deletions(-) create mode 100755 packaging/deb/postrm diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index efdea7c..711bbdd 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -66,15 +66,19 @@ jobs: cd publish-ppa tar -xf globalprotect-openconnect-*.tar.gz cd globalprotect-openconnect-*/ + make tarball OFFLINE=1 + # Prepare the debian directory with custom files mkdir -p .build/debian sed 's/@RUST@/rust-all(>=1.70)/g' packaging/deb/control.in > .build/debian/control sed 's/@OFFLINE@/1/g' packaging/deb/rules.in > .build/debian/rules + cp packaging/deb/postrm .build/debian/postrm + - name: Publish to PPA uses: yuezk/publish-ppa-package@dev with: - repository: "yuezk/globalprotect-openconnect-snapshot" + repository: "yuezk/globalprotect-openconnect" gpg_private_key: ${{ secrets.PPA_GPG_PRIVATE_KEY }} gpg_passphrase: ${{ secrets.PPA_GPG_PASSPHRASE }} tarball: publish-ppa/globalprotect-openconnect-*/.build/tarball/*.tar.gz diff --git a/Makefile b/Makefile index bc4ef25..59e5cf3 100644 --- a/Makefile +++ b/Makefile @@ -145,6 +145,7 @@ init-debian: clean-debian tarball cp -f packaging/deb/control.in .build/deb/$(PKG)/debian/control cp -f packaging/deb/rules.in .build/deb/$(PKG)/debian/rules + cp -f packaging/deb/postrm .build/deb/$(PKG)/debian/postrm sed -i "s/@OFFLINE@/$(OFFLINE)/g" .build/deb/$(PKG)/debian/rules diff --git a/packaging/deb/control.in b/packaging/deb/control.in index e4ef5f9..27d046d 100644 --- a/packaging/deb/control.in +++ b/packaging/deb/control.in @@ -12,8 +12,7 @@ Build-Depends: debhelper (>= 9), libayatana-appindicator3-1, gnome-keyring, libwebkit2gtk-4.0-dev, - libopenconnect-dev (>= 8.20), - @RUST@ + libopenconnect-dev (>= 8.20),@RUST@ Homepage: https://github.com/yuezk/GlobalProtect-openconnect Package: globalprotect-openconnect diff --git a/packaging/deb/postrm b/packaging/deb/postrm new file mode 100755 index 0000000..ba43a82 --- /dev/null +++ b/packaging/deb/postrm @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + +case "$1" in + purge|remove|upgrade) + # Remove the gpgui binary downloaded at runtime + rm -f /usr/bin/gpgui + ;; + + *) + ;; +esac + +exit 0 diff --git a/packaging/rpm/globalprotect-openconnect.spec.in b/packaging/rpm/globalprotect-openconnect.spec.in index 12a0b0d..61f3023 100644 --- a/packaging/rpm/globalprotect-openconnect.spec.in +++ b/packaging/rpm/globalprotect-openconnect.spec.in @@ -34,6 +34,9 @@ A GUI for GlobalProtect VPN, based on OpenConnect, supports the SSO authenticati %prep %setup +%postun +rm -f %{_bindir}/gpgui + %build # The injected RUSTFLAGS could fail the build unset RUSTFLAGS