Add make ppa

This commit is contained in:
Kevin Yue
2024-02-23 06:06:59 -05:00
parent 480229b69f
commit 48e22f4f78
4 changed files with 64 additions and 5 deletions

View File

@@ -1,7 +1,15 @@
OFFLINE ?= 0
CARGO ?= cargo
VERSION = $(shell $(CARGO) metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
PKG_NAME = globalprotect-openconnect-$(VERSION)
REVISION ?= 1
PPA_REVISION ?= 1
PKG_NAME = globalprotect-openconnect
PKG = $(PKG_NAME)-$(VERSION)
SERIES ?= $(shell lsb_release -cs)
export DEBEMAIL = k3vinyue@gmail.com
export DEBFULLNAME = Kevin Yue
CARGO_BUILD_ARGS = --release
@@ -24,7 +32,7 @@ cargo-vendor:
tarball: clean clean-tarball build-fe cargo-vendor
rm -rf apps/gpgui-helper/node_modules
tar --transform 's,^,${PKG_NAME}/,' -czf ../${PKG_NAME}.tar.gz * .cargo
tar --transform 's,^,${PKG}/,' -czf ../${PKG}.tar.gz * .cargo
# Extract the vendor tarball to the .vendor directory if it exists
extract-vendor:
@@ -57,7 +65,7 @@ clean:
clean-tarball:
rm -rf vendor.tar.xz
rm -rf ../$(PKG_NAME).tar.gz
rm -rf ../$(PKG).tar.gz
install:
install -Dm755 target/release/gpclient $(DESTDIR)/usr/bin/gpclient
@@ -85,5 +93,27 @@ uninstall:
rm -f $(DESTDIR)/usr/share/icons/hicolor/256x256@2/apps/gpgui.png
rm -f $(DESTDIR)/usr/share/polkit-1/actions/com.yuezk.gpgui.policy
deb:
debmake -e "k3vinyue@gmail.com" -f "Kevin Yue"
init-debian:
rm -rf debian
debmake
cp -f packaging/deb/control debian/control
cp -f packaging/deb/rules debian/rules
rm -f debian/changelog
deb: init-debian
dch --create --distribution unstable --package $(PKG_NAME) --newversion $(VERSION)-$(REVISION) "Bugfix and improvements."
debuild -e PATH -us -uc -b
# Usage: make ppa SERIES=focal
ppa: init-debian
$(eval SERIES_VER = $(shell distro-info --series $(SERIES) -r | cut -d' ' -f1))
@echo "Building for $(SERIES) $(SERIES_VER)"
dch --create --distribution $(SERIES) --package $(PKG_NAME) --newversion $(VERSION)-$(REVISION)ppa$(PPA_REVISION)~ubuntu$(SERIES_VER) "Bugfix and improvements."
echo "y" | debuild -e PATH -S -sa -k"$(GPG_KEY_ID)" -p"gpg --batch --passphrase $(GPG_KEY_PASS) --pinentry-mode loopback"
publish-ppa: ppa
dput ppa:yuezk/globalprotect-openconnect ../*.changes