Commit c460a74a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

contrib: use Perl shasum if sha512sum is not found

parent 96fce709
...@@ -136,6 +136,14 @@ else ...@@ -136,6 +136,14 @@ else
download = $(error Neither curl nor wget found!) download = $(error Neither curl nor wget found!)
endif endif
ifeq ($(shell sha512sum --version >/dev/null 2>&1 || echo FAIL),)
SHA512SUM = sha512sum
else ifeq ($(shell shasum --version >/dev/null 2>&1 || echo FAIL),)
SHA512SUM = shasum -a 512
else
SHA512SUM = $(error SHA-512 checksumming not found!)
endif
# #
# Common helpers # Common helpers
# #
...@@ -169,10 +177,9 @@ download_git = \ ...@@ -169,10 +177,9 @@ download_git = \
(cd $(dir $@) && \ (cd $(dir $@) && \
tar cvJ $(notdir $(@:.tar.xz=))) > $@ && \ tar cvJ $(notdir $(@:.tar.xz=))) > $@ && \
rm -Rf $(@:.tar.xz=) rm -Rf $(@:.tar.xz=)
checksum = (cd $(TARBALLS) && $(1)sum -c -) < \ checksum = (cd $(TARBALLS) && $(1) --check -) < \
$(SRC)/$(patsubst .sum-%,%,$@)/$(2)SUMS $(SRC)/$(patsubst .sum-%,%,$@)/$(2)SUMS
CHECK_SHA256 = $(call checksum,sha512,SHA512) CHECK_SHA512 = $(call checksum,$(SHA512SUM),SHA512)
CHECK_SHA512 = $(call checksum,sha512,SHA512)
UNPACK = $(RM) -R $@ \ UNPACK = $(RM) -R $@ \
$(foreach f,$(filter %.tar.gz %.tgz,$^), && tar xvzf $(f)) \ $(foreach f,$(filter %.tar.gz %.tgz,$^), && tar xvzf $(f)) \
$(foreach f,$(filter %.tar.bz2,$^), && tar xvjf $(f)) \ $(foreach f,$(filter %.tar.bz2,$^), && tar xvjf $(f)) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment