summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-05-26 12:17:38 (EDT)
committer P. J. McDermott <pjm@nac.net>2013-05-26 12:17:38 (EDT)
commitdfb35e9d6ca731ce43e44e92de93761dcb316018 (patch)
tree8e2d743034d7182e8bd4bfd44cdc94bd382f67bb
parent55b0aa3cd21ff4662d8fa7fdeba61ce992980d64 (diff)
Add "source" target to download and verify source.
-rwxr-xr-xbuild2
-rw-r--r--source.mk20
2 files changed, 22 insertions, 0 deletions
diff --git a/build b/build
index b5578cd..393c0aa 100755
--- a/build
+++ b/build
@@ -1,5 +1,7 @@
#! /usr/bin/make -f
+include ../source.mk
+
nop:
@:
diff --git a/source.mk b/source.mk
new file mode 100644
index 0000000..91e2fd0
--- /dev/null
+++ b/source.mk
@@ -0,0 +1,20 @@
+upstream_archive = busybox-$(OPK_SOURCE_VERSION_UPSTREAM).tar.bz2
+upstream_url = http://www.busybox.net/downloads/$(upstream_archive)
+source_archive = ../busybox-$(OPK_SOURCE_VERSION_UPSTREAM).orig.tar.bz2
+keys = ACC9965B
+
+$(source_archive):
+ wget "$(upstream_url)"
+ set -e; if gpg --version >/dev/null 2>&1; then \
+ wget "$(upstream_url).sign"; \
+ [ -e ../keyring.gpg ] || \
+ gpg --keyring ../keyring.gpg --no-default-keyring \
+ --recv-keys $(keys); \
+ gpg --verify --keyring ../keyring.gpg \
+ "$(upstream_archive).sign"; \
+ sed -n 's/^MD5: //p' "$(upstream_archive).sign" | md5sum -c; \
+ sed -n 's/^SHA1: //p' "$(upstream_archive).sign" | sha1sum -c; \
+ fi
+ mv "$(upstream_archive)" "$(source_archive)"
+
+source: $(source_archive)