summaryrefslogtreecommitdiffstats
path: root/source.mk
blob: dfcd28274087d164c8aa5898417f12ceb260e865 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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

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)