summaryrefslogtreecommitdiffstats
path: root/source.mk
blob: 82a5ce098df7cd91d680c52057f387dd4b7ab735 (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
28
29
30
upstream_ver = $$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' | \
	sed 's/^\([0-9a-z.~-][0-9a-z.~-]*\)+sip[1-9][0-9]*.*$$/\1/')
upstream_archive = zlib-$(upstream_ver).tar.gz
upstream_url = http://zlib.net/$(upstream_archive)
source_archive = ../zlib-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.gz
keys = \
	'E3EC F4DF 7EDB E724 A3EC  FBC2 D9A2 7D25 0196 71A7' \
	'5ED4 6A67 21D3 6558 7791  E2AA 783F CD8E 58BC AFBA'

$(source_archive):
	wget -c "$(upstream_url)"
	set -e; if gpg --version >/dev/null 2>&1; then \
		wget -c "$(upstream_url).asc"; \
		if ! [ -e ../keyring.gpg ]; then \
			gpg --no-default-keyring --keyring ../keyring.gpg \
				--keyserver hkp://pool.sks-keyservers.net \
				--recv-keys $(keys); \
		fi; \
		rm -f ../keyring.gpg~; \
		gpg --no-default-keyring --keyring ../keyring.gpg \
			--verify "$(upstream_archive).asc"; \
	fi
	tar -xzf "$(upstream_archive)"
	rm -f "$(upstream_archive)"
	rm -f "zlib-$(upstream_ver)"/doc/rfc*.txt
	tar -czf '$(source_archive)' "zlib-$(upstream_ver)"
	rm -Rf src
	mv "zlib-$(upstream_ver)" src

source: $(source_archive)