From cd1420beb4fd1ee8e0df13d268d0659185d02fa5 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 23 Jun 2019 17:35:33 -0400 Subject: source.mk: Rewrite/update --- diff --git a/control b/control index 88f6e0b..a009b61 100644 --- a/control +++ b/control @@ -1,3 +1,3 @@ Maintainer: "P. J. McDermott" -Build-Depends: opkhelper-3.0 +Build-Depends: opkhelper-3.0, gpg, dirmngr Homepage: http://invisible-island.net/ncurses/ diff --git a/source.mk b/source.mk index 79bff5e..8357921 100644 --- a/source.mk +++ b/source.mk @@ -1,20 +1,23 @@ -upstream_version = $$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' | \ - sed 's/~/-/') -upstream_archive = ncurses-$(upstream_version).tgz -upstream_url = ftp://invisible-island.net/ncurses/current/$(upstream_archive) -source_archive = ../ncurses-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.gz -keys = F7E48EDB +upstream_archive = $(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).tar.gz +upstream_url = http://invisible-mirror.net/archives/ncurses/$(upstream_archive) +source_archive = ../$(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.gz + +gpg = GNUPGHOME=gnupghome/ gpg --no-default-keyring --keyring ../keyring.gpg +keys = \ + 'C520 48C0 C074 8FEE 227D 47A2 7023 53E0 F7E4 8EDB' $(source_archive): - wget "$(upstream_url)" - set -e; if gpg --version >/dev/null 2>&1; then \ - wget "$(upstream_url).asc"; \ - [ -e ../keyring.gpg ] || \ - gpg --keyring ../keyring.gpg --no-default-keyring \ - --recv-keys $(keys) || true; \ - gpg --verify --keyring ../keyring.gpg \ - "$(upstream_archive).asc"; \ + wget -c '$(upstream_url)' '$(upstream_url).asc' + install -m 0700 -d gnupghome/ + [ -e ../keyring.gpg ] || \ + $(gpg) --keyserver hkp://pool.sks-keyservers.net \ + --recv-keys $(keys); \ + rm -f ../keyring.gpg~; \ + if ! $(gpg) --verify '$(upstream_archive).asc'; then \ + rm -Rf gnupghome/; \ + exit 1; \ fi - mv "$(upstream_archive)" '$(source_archive)' + rm -Rf gnupghome/ + mv '$(upstream_archive)' '$(source_archive)' source: $(source_archive) -- cgit v0.9.1