[vlc-commits] contrib: use Perl shasum if sha512sum is not found
Rémi Denis-Courmont
git at videolan.org
Wed Jul 6 19:01:31 CEST 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul 6 20:00:55 2011 +0300| [c460a74a060ece5577460e747c54b02d299c2c24] | committer: Rémi Denis-Courmont
contrib: use Perl shasum if sha512sum is not found
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c460a74a060ece5577460e747c54b02d299c2c24
---
contrib/src/main.mak | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/contrib/src/main.mak b/contrib/src/main.mak
index f868f45..140b0f3 100644
--- a/contrib/src/main.mak
+++ b/contrib/src/main.mak
@@ -136,6 +136,14 @@ else
download = $(error Neither curl nor wget found!)
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
#
@@ -169,10 +177,9 @@ download_git = \
(cd $(dir $@) && \
tar cvJ $(notdir $(@:.tar.xz=))) > $@ && \
rm -Rf $(@:.tar.xz=)
-checksum = (cd $(TARBALLS) && $(1)sum -c -) < \
+checksum = (cd $(TARBALLS) && $(1) --check -) < \
$(SRC)/$(patsubst .sum-%,%,$@)/$(2)SUMS
-CHECK_SHA256 = $(call checksum,sha512,SHA512)
-CHECK_SHA512 = $(call checksum,sha512,SHA512)
+CHECK_SHA512 = $(call checksum,$(SHA512SUM),SHA512)
UNPACK = $(RM) -R $@ \
$(foreach f,$(filter %.tar.gz %.tgz,$^), && tar xvzf $(f)) \
$(foreach f,$(filter %.tar.bz2,$^), && tar xvjf $(f)) \
More information about the vlc-commits
mailing list