From e202555ba20bdee56b4c14ae92f88f7ddec7c535 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 30 Apr 2019 16:29:29 -0400 Subject: source.mk: Rewrite gpg code --- diff --git a/control b/control index 3aaef61..5fe8452 100644 --- a/control +++ b/control @@ -1,3 +1,3 @@ Maintainer: Patrick McDermott -Build-Depends: libz.1-dev, opkhelper-3.0, gettext, dejagnu +Build-Depends: gpg, dirmngr, libz.1-dev, opkhelper-3.0, gettext, dejagnu Homepage: https://www.gnu.org/software/binutils/ diff --git a/source.mk b/source.mk index f7110bc..9987f62 100644 --- a/source.mk +++ b/source.mk @@ -1,19 +1,19 @@ upstream_archive = binutils-$(OPK_SOURCE_VERSION_UPSTREAM).tar.bz2 upstream_url = http://ftp.gnu.org/pub/gnu/binutils/$(upstream_archive) source_archive = ../binutils-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.bz2 + +gpg = GNUPGHOME=gnupghome/ gpg --no-default-keyring --keyring ../keyring.gpg keys = 4AE55E93 $(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'; \ - fi - mv '$(upstream_archive)' '$(source_archive)' + 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~; \ + $(gpg) --verify '$(upstream_archive).sig' && \ + mv '$(upstream_archive)' '$(source_archive)' + rm -Rf gnupghome/ source: $(source_archive) -- cgit v0.9.1