X-Git-Url: http://git.onelab.eu/?p=ejabberd.git;a=blobdiff_plain;f=Makefile;h=d1c31217039c06d7f9c4968b7d45fd0f9f6d038e;hp=263879dddd6664b1549371710ec54146f02a1431;hb=HEAD;hpb=464f3529c9b34f83c009ea7ad9924b382027b889 diff --git a/Makefile b/Makefile index 263879d..d1c3121 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,12 @@ -# $Id$ -# $URL$ # WEBFETCH := wget SHA1SUM := sha1sum ALL += ejabberd -ejabberd-URL := http://www.process-one.net/downloads/ejabberd/2.1.3/ejabberd-2.1.3.tar.gz -ejabberd-SHA1SUM := 77fdf18c0bb3b25cf9045e0c833ba4d82f180469 -ejabberd := $(notdir $(ejabberd-URL)) +ejabberd-URL1 := http://mirror.onelab.eu/third-party/ejabberd-2.1.6.tar.gz +ejabberd-URL2 := http://build.planet-lab.org/third-party/ejabberd-2.1.6.tar.gz +ejabberd-SHA1SUM := a1afbfc270f8e4c945bd91f64b7073781590535b +ejabberd := $(notdir $(ejabberd-URL1)) all: $(ALL) .PHONY: all @@ -15,9 +14,11 @@ all: $(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'" ; \