X-Git-Url: http://git.onelab.eu/?p=libvirt.git;a=blobdiff_plain;f=Makefile;h=40267f0af6411eed9127109dee12bd2c1d17a187;hp=c6db35c3c3f64b47f286ccaf1d3f0fa165076341;hb=00b892846c76eac71f38fe5e134ee52f3e259e09;hpb=333be24ae08aa2edaa5955a8338c78334618b154 diff --git a/Makefile b/Makefile index c6db35c..40267f0 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,13 @@ WEBFETCH := wget SHA1SUM := sha1sum +# tried to download this on the fly using git archive at git://libvirt.org/libvirt.git +# but it feels like git archive is not supported/allowed there ALL += libvirt -libvirt-URL := ftp://libvirt.org/libvirt/libvirt-0.9.12.tar.gz -libvirt-SHA1SUM := 3743dc4f3e58d5912a98f568c3e854d97d81f216 -libvirt := $(notdir $(libvirt-URL)) +libvirt-URL1 := http://mirror.onelab.eu/third-party/libvirt-1.0.2.tar.gz +libvirt-URL2 := http://planet-lab.org/third-party/libvirt-1.0.2.tar.gz +libvirt-SHA1SUM := ad8063794bb70e7538a3437412dd0c75950b81e2 +libvirt := $(notdir $(libvirt-URL1)) all: $(ALL) .PHONY: all @@ -12,18 +15,20 @@ 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 "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'" ; \ - echo "Local copy: $$$$($(SHA1SUM) $($(1)))" ; \ - echo "In Makefile: $($(1)-SHA1SUM)" ; \ - false ; \ - else \ - ls -l $($(1)) ; \ - 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'" ; \ + echo "Local copy: $$$$($(SHA1SUM) $($(1)))" ; \ + echo "In Makefile: $($(1)-SHA1SUM)" ; \ + false ; \ + else \ + ls -l $($(1)) ; \ + fi endef $(eval $(call download_target,libvirt))