summaryrefslogtreecommitdiffstats
path: root/source.mk
blob: f0146de33c3a33c9f62d94961475cc948567ce79 (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
us_ver = $(OPK_SOURCE_VERSION_UPSTREAM)-stable
us_tar = v$(us_ver).tar.gz
us_sig = wolfssl-$(us_ver).tar.gz.asc
us_url_base = https://github.com/wolfSSL/wolfssl
us_tar_url = $(us_url_base)/archive/$(us_tar)
us_sig_url = $(us_url_base)/releases/download/v$(us_ver)/$(us_sig)
source_archive = ../$(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.gz

gpg = GNUPGHOME=gnupghome/ gpg --no-default-keyring --keyring ../keyring.gpg
keys = \
	'A2A4 8E7B CB96 C5BE CB98  7314 EBC8 0E41 5CA2 9677'

$(source_archive):
	wget -c '$(us_tar_url)' '$(us_sig_url)'
	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 '$(us_sig)' '$(us_tar)'; then \
		rm -Rf gnupghome/; \
		exit 1; \
	fi
	rm -Rf gnupghome/
	mv '$(us_tar)' '$@'

source: $(source_archive)