From a5c62f5fed9ea180b2bea9cee7660e93a8d94144 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Tue, 08 Dec 2020 03:20:44 -0500 Subject: source.mk: Update, rewrite gpg code, switch to xz --- diff --git a/control b/control index 194cf3b..2e54c6d 100644 --- a/control +++ b/control @@ -1,4 +1,4 @@ Maintainer: Patrick McDermott -Build-Depends: opkbuild (>= 4.0.0), opkhelper-3.0, +Build-Depends: opkbuild (>= 4.0.0), opkhelper-3.0, gpg, dirmngr, config-linux-libre-${Host-Plat}, bc, xz Homepage: https://www.fsfla.org/ikiwiki/selibre/linux-libre/index.en.html diff --git a/source.mk b/source.mk index 819b8ef..514c2eb 100644 --- a/source.mk +++ b/source.mk @@ -1,21 +1,26 @@ upstream_version = $$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' | \ - sed 's/~/-/') -upstream_archive = linux-libre-$(upstream_version).tar.bz2 + sed 's/+/-/') +upstream_archive = linux-libre-$(upstream_version).tar.xz upstream_releases = http://linux-libre.fsfla.org/pub/linux-libre/releases upstream_url = $(upstream_releases)/$(upstream_version)/$(upstream_archive) -source_archive = ../linux-libre-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.bz2 -keys = 7E7D47A7 +source_archive = ../$(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.xz + +gpg = GNUPGHOME=gnupghome/ gpg --no-default-keyring --keyring ../keyring.gpg +keys = \ + '4744 02C8 C582 DAFB E389 C427 BCB7 CF87 7E7D 47A7' $(source_archive): - wget "$(upstream_url)" - set -e; if gpg --version >/dev/null 2>&1; then \ - wget "$(upstream_url).sign"; \ - [ -e ../keyring.gpg ] || \ - gpg --keyring ../keyring.gpg --no-default-keyring \ - --recv-keys $(keys) || true; \ - gpg --verify --keyring ../keyring.gpg \ - "$(upstream_archive).sign"; \ + wget -c "$(upstream_url)" "$(upstream_url).sign" + 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).sign"; 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