From e1c3db7911ed6d2db0d5d187d01d05fbfbe636a7 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 28 Jun 2019 19:26:23 -0400 Subject: source.mk: Update, rewrite gpg code, switch to xz --- diff --git a/control b/control index 725c199..084303c 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/ 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