From efe25b35a20e6a4b577d9e63e635c7998aa0ac5c Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Fri, 07 Jun 2019 21:44:59 -0400 Subject: source.mk: Update --- diff --git a/.gitignore b/.gitignore index 213a9bf..e09cf63 100644 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,8 @@ *~ Session.vim -# Source archives -*-*.orig.tar.* +# Upstream sources +src/ # Work area tmp/ diff --git a/control b/control index 0d72324..a9ca818 100644 --- a/control +++ b/control @@ -1,3 +1,3 @@ Maintainer: "P. J. McDermott" -Build-Depends: opkhelper-3.0 +Build-Depends: gpg, dirmngr, opkhelper-3.0 Homepage: http://libreboot.org/docs/hcl/gm45_remove_me.html diff --git a/source.mk b/source.mk index 8343782..dfcd282 100644 --- a/source.mk +++ b/source.mk @@ -1,15 +1,31 @@ -upstream_commit = $$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' | \ - sed 's/^.*~git........\.\([0-9a-f]*\).*$$/\1/') -upstream_git_uri = git://git.sv.gnu.org/libreboot.git -source_archive = ../$(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.bz2 +upstream_mirror = http://www.mirrorservice.org/sites/libreboot.org/release +upstream_url_base = $(upstream_mirror)/stable/$(OPK_SOURCE_VERSION_UPSTREAM) +upstream_archive_base = libreboot_r$(OPK_SOURCE_VERSION_UPSTREAM)_src +upstream_archive_file = $(upstream_archive_base).tar.xz -$(source_archive): - git clone '$(upstream_git_uri)' libreboot/ - (cd libreboot/ && git checkout "$(upstream_commit)") - mv libreboot/resources/utilities/ich9deblob/ ich9deblob/ - tar -cjf '$@' ich9deblob/ - rm -Rf src/ - mv ich9deblob/ src/ - rm -Rf libreboot/ +gpg = GNUPGHOME=gnupghome/ gpg --no-default-keyring --keyring ../keyring.gpg +keys = \ + 'CDC9 CAE3 2CB4 B7FC 84FD C804 969A 9795 05E8 C5B2' + +source: + wget -c \ + $(upstream_url_base)/$(upstream_archive_file) \ + $(upstream_url_base)/SHA512SUMS \ + $(upstream_url_base)/SHA512SUMS.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 SHA512SUMS.sig SHA512SUMS; then \ + rm -Rf gnupghome/; \ + exit 1; \ + fi + rm -Rf gnupghome/ + grep -F $(upstream_archive_file) SHA512SUMS >SHA512SUMS_src + sha512sum -c SHA512SUMS_src + tar -xJf $(upstream_archive_file) + mv $(upstream_archive_base)/resources/utilities/ich9deblob/ ../src/ + rm -Rf $(upstream_archive_base)/ source: $(source_archive) -- cgit v0.9.1