summaryrefslogtreecommitdiffstats
path: root/source.mk
blob: 514c2eb8b8130c0efd67f521ed834e76de55bcf9 (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)' | \
	sed 's/+/-/')
upstream_archive = linux-libre-$(upstream_version).tar.xz
upstream_releases = http://linux-libre.fsfla.org/pub/linux-libre/releases
upstream_url = $(upstream_releases)/$(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 = \
	'4744 02C8 C582 DAFB E389  C427 BCB7 CF87 7E7D 47A7'

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

source: $(source_archive)