diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-05-31 10:28:08 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-05-31 10:28:08 (EDT) |
commit | 03679b19e030809328414754840c3e3c117e76e9 (patch) | |
tree | 92df00f0a312e08e001d6ec4d5cac8657a1697a2 | |
parent | 722b40c76b6ed593327058026003f14d68d36779 (diff) |
source.mk: Rewrite gpg code
-rw-r--r-- | control | 2 | ||||
-rw-r--r-- | source.mk | 24 |
2 files changed, 15 insertions, 11 deletions
@@ -1,4 +1,4 @@ -Build-Depends: opkhelper-3.0 +Build-Depends: gpg, dirmngr, opkhelper-3.0 Maintainer: "David T. Stanford" <dstanford@daemonbox.net>, "P. J. McDermott" <pj@pehjota.net> Homepage: http://www.gnu.org/software/make/ @@ -1,19 +1,23 @@ upstream_archive = make-$(OPK_SOURCE_VERSION_UPSTREAM).tar.gz upstream_url = http://ftp.gnu.org/gnu/make/$(upstream_archive) source_archive = ../$(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.gz -keys = '3D25 54F0 A153 38AB 9AF1 BB9D 96B0 4715 6338 B6D4' + +gpg = GNUPGHOME=gnupghome/ gpg --no-default-keyring --keyring ../keyring.gpg +keys = \ + '3D25 54F0 A153 38AB 9AF1 BB9D 96B0 4715 6338 B6D4' $(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 + rm -Rf gnupghome/ mv '$(upstream_archive)' '$(source_archive)' source: $(source_archive) |