summaryrefslogtreecommitdiffstats
path: root/source.mk
blob: 0f558be7f6c8ff82aaa25fefb77f88a8c0ff8336 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
upstream_archive = $(OPK_SOURCE)-$(OPK_SOURCE_VERSION_UPSTREAM).tar.gz
upstream_url = http://ftp.gnu.org/pub/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
keys = \
	'AD17 A21E F8AE D8F1 CC02  DBD9 F7D5 C9BF 765C 61E3'

$(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_archive)'

source: $(source_archive)