X-Git-Url: http://git.onelab.eu/?p=ejabberd.git;a=blobdiff_plain;f=Makefile;h=d1c31217039c06d7f9c4968b7d45fd0f9f6d038e;hp=02fb7c4c8c310eeae5c6464a3af1b968b908fe9a;hb=HEAD;hpb=11185a917af0030e505770c016f8c571ac953785 diff --git a/Makefile b/Makefile index 02fb7c4..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'" ; \ @@ -31,9 +32,7 @@ endef $(eval $(call download_target,ejabberd)) -SOURCEFILES := $(shell cat sources 2>/dev/null | awk '{ print gensub("^.*/", "", 1, $$2) }') - -sources: $(ALL) $(SOURCEFILES) +sources: $(ALL) .PHONY: sources ####################