summaryrefslogtreecommitdiffstats
path: root/source.mk
blob: 303715a1eb75c36bd3ae81c6edd3287d585d9fd9 (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
upstream_version = $$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' | \
	tr '~' '-')
upstream_archive = $(OPK_SOURCE)-$(upstream_version).tar.xz
upstream_url_base = http://files.proteanos.com/pub/$(OPK_SOURCE)
upstream_url = $(upstream_url_base)/$(upstream_version)/$(upstream_archive)
source_archive = ../$(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.xz

gpg = GNUPGHOME=gnupghome/ gpg --no-default-keyring --keyring ../keyring.gpg
keys = \
	'2250 31F0 47FF E516 63ED  516F 1A45 9ECD E4D6 04BE'

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

source: $(source_archive)