summaryrefslogtreecommitdiffstats
path: root/source.mk
blob: 87600da18605b07dee377f9e90d1dcdb7c19c219 (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
upstream_archive = $(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).tar.gz
upstream_url = http://ftp.gnu.org/gnu/$(OPK_SOURCE)/$(upstream_archive)
source_archive = ../$(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.gz

gpg = GNUPGHOME=gnupghome/ gpg --no-default-keyring --keyring ../keyring.gpg
# Key has no signatures but is in the GNU keyring (as downloaded over HTTPS but
# not otherwise verified).
keys = \
	'00E4 2623 2F38 4BF6 D32D  8B18 81C2 4FF1 2FB7 B14B'

$(source_archive):
	wget -c '$(upstream_url)' '$(upstream_url).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 '$(upstream_archive).sig'; then \
		rm -Rf gnupghome/; \
		exit 1; \
	fi
	rm -Rf gnupghome/
	mv '$(upstream_archive)' '$@'

source: $(source_archive)