X-Git-Url: http://git.onelab.eu/?p=ejabberd.git;a=blobdiff_plain;f=Makefile;h=d1c31217039c06d7f9c4968b7d45fd0f9f6d038e;hp=f74890f2ac07ec8674550b7ba90175ae7017ffa2;hb=HEAD;hpb=b593521bd8b9af67a521a3a2e9145d76462be2e1 diff --git a/Makefile b/Makefile index f74890f..d1c3121 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,12 @@ -# $Id$ -# $URL$ # WEBFETCH := wget SHA1SUM := sha1sum -ALL += pyaspects -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)) +ALL += ejabberd +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'" ; \ @@ -31,7 +32,7 @@ endef $(eval $(call download_target,ejabberd)) -sources: $(ALL) +sources: $(ALL) .PHONY: sources ####################