X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile;h=99c4681dad2ab594900d614483436263109469e0;hb=a0c5578cb645fcf0dfe9724cd8b2c9a924c237c9;hp=855bb56a51e1ab8d39691456f1f101f271298aa7;hpb=03fd643ee5bdb83ece1dff26ef0cb29e593980dc;p=iptables.git diff --git a/Makefile b/Makefile index 855bb56..99c4681 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,21 @@ -# $Id$ -# $URL$ # WEBFETCH := wget SHA1SUM := sha1sum ALL += iptables -iptables-URL := http://www.netfilter.org/projects/iptables/files/iptables-1.4.8.tar.bz2 -iptables-SHA1SUM := 53d756938e6dc748364ca1e1952f28dd9daad6a4 +iptables-URL1 := http://mirror.onelab.eu/third-party/iptables-1.4.12.1.tar.bz2 +iptables-URL2 := http://planet-lab.org/third-party/iptables-1.4.12.1.tar.bz2 +iptables-SHA1SUM := 86022c3b5129ad7105f5087ec1349e99cc5a9728 iptables := $(notdir $(iptables-URL)) -all: $(ALL) -.PHONY: all - ############################## define download_target $(1): $($(1)) -.PHONY: $($(1)) +.PHONY: $(1) $($(1)): - @if [ ! -e "$($(1))" ] ; then echo "$(WEBFETCH) $($(1)-URL)" ; $(WEBFETCH) $($(1)-URL) ; fi + @if [ ! -e "$($(1))" ] ; then \ + { echo Using primary; echo "$(WEBFETCH) $($(1)-URL1)" ; $(WEBFETCH) $($(1)-URL1) ; } || \ + { echo Using secondary; echo "$(WEBFETCH) $($(1)-URL2)" ; $(WEBFETCH) $($(1)-URL2) ; } ; fi @if [ ! -e "$($(1))" ] ; then echo "Could not download source file: $($(1)) does not exist" ; exit 1 ; fi @if test "$$$$($(SHA1SUM) $($(1)) | awk '{print $$$$1}')" != "$($(1)-SHA1SUM)" ; then \ echo "sha1sum of the downloaded $($(1)) does not match the one from 'Makefile'" ; \