X-Git-Url: http://git.onelab.eu/?p=iptables.git;a=blobdiff_plain;f=Makefile;h=bd67eb93bacac339316bb97d4aa23d9067f4b2b1;hp=27cde309b91aaba09cfca98f530c591259ba4dcc;hb=HEAD;hpb=9eadba894a15cd5c7d4047d0f2fbd8372b385a90 diff --git a/Makefile b/Makefile index 27cde30..bd67eb9 100644 --- a/Makefile +++ b/Makefile @@ -1,26 +1,21 @@ -# $Id$ -# $URL$ # WEBFETCH := wget SHA1SUM := sha1sum -ALL += iptables ipset -iptables-URL := http://www.netfilter.org/projects/iptables/files/iptables-1.4.10.tar.bz2 -iptables-SHA1SUM := 8190b8c9714a3eec825317e8ac1deeb3d11c6d29 -ipset-URL := http://ipset.netfilter.org/ipset-4.5.tar.bz2 -ipset-SHA1SUM := 696a5cd96459c8fb028f0dfb9927a5c4f183d28b -iptables := $(notdir $(iptables-URL)) -ipset := $(notdir $(ipset-URL)) - -all: $(ALL) -.PHONY: all +ALL += iptables +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-URL1)) ############################## 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'" ; \