From 877a401e734f29745f054ce63a12311e6a70861f Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Mon, 19 Dec 2011 09:34:33 +0100 Subject: [PATCH] dual URL for fetching source - onelab & planet-lab instead of process-one.net --- Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a7f9803..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.6/ejabberd-2.1.6.tar.gz +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-URL)) +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'" ; \ -- 2.43.0