From d5a3b97a656f67fdddf013a76d28d64e46ec284c Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 24 Jun 2019 23:24:26 -0400 Subject: source.mk: Rewrite --- diff --git a/control b/control index e3e653e..7742494 100644 --- a/control +++ b/control @@ -1,5 +1,5 @@ Maintainer: "P. J. McDermott" -Build-Depends: opkhelper-3.0, +Build-Depends: opkbuild (>= 4.0.0), opkhelper-3.0, gpg, dirmngr, libgmp-dev, libmpfr-dev, libreadline-dev, libtinfo-dev, libsigsegv-dev, diff --git a/source.mk b/source.mk index ea89f4d..557f36d 100644 --- a/source.mk +++ b/source.mk @@ -1,19 +1,23 @@ -upstream_archive = gawk-$(OPK_SOURCE_VERSION_UPSTREAM).tar.gz -upstream_url = http://ftp.gnu.org/pub/gnu/gawk/$(upstream_archive) -source_archive = ../gawk-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.gz -keys = 937EC0D2 +upstream_archive = $(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).tar.xz +upstream_url = http://ftp.gnu.org/pub/gnu/$(OPK_SOURCE)/$(upstream_archive) +source_archive = ../$(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.xz + +gpg = GNUPGHOME=gnupghome/ gpg --no-default-keyring --keyring ../keyring.gpg +keys = \ + 'D196 7C63 7887 1317 7D86 1ED7 DF59 7815 937E C0D2' $(source_archive): - wget -c '$(upstream_url)' - set -e; if gpg --version >/dev/null 2>&1; then \ - wget -c '$(upstream_url).sig'; \ - [ -e ../keyring.gpg ] || \ - gpg --keyring ../keyring.gpg --no-default-keyring \ - --recv-keys $(keys) || true; \ - rm -f ../keyring.gpg~; \ - gpg --verify --keyring ../keyring.gpg \ - '$(upstream_archive).sig'; \ + wget -c '$(upstream_url)' '$(upstream_url).sig' + 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).sig'; then \ + rm -Rf gnupghome/; \ + exit 1; \ fi - mv '$(upstream_archive)' '$(source_archive)' + rm -Rf gnupghome/ + mv '$(upstream_archive)' '$@' source: $(source_archive) -- cgit v0.9.1