speedo: Autodetect sha1sum tools.

* build-aux/getswdb.sh: Add option --find-sha1sum.
* build-aux/speedo.mk (check-tools): New phony target.  Not yet used.
(SHA1SUM): New var.  Use it instead of sha1sum.
This commit is contained in:
Werner Koch 2014-09-18 16:00:34 +02:00
parent bc2f5c1d1a
commit 2427bc5bc7
2 changed files with 45 additions and 16 deletions

View File

@ -32,6 +32,7 @@ Usage: $(basename $0) [OPTIONS]
Get the online version of the GnuPG software version database
Options:
--skip-download Assume download has already been done.
--find-sha1sum Print the name of the sha1sum utility
--help Print this help.
EOF
exit $1
@ -41,6 +42,7 @@ EOF
# Parse options
#
skip_download=no
find_sha1sum=no
while test $# -gt 0; do
case "$1" in
# Set up `optarg'.
@ -59,6 +61,9 @@ while test $# -gt 0; do
--skip-download)
skip_download=yes
;;
--find-sha1sum)
find_sha1sum=yes
;;
*)
usage 1 1>&2
;;
@ -66,7 +71,20 @@ while test $# -gt 0; do
shift
done
# Get GnuPG version from VERSIOn file. For a GIT checkout this means
# Mac OSX has only a shasum and not sha1sum
if [ ${find_sha1sum} = yes ]; then
for i in sha1sum shasum ; do
tmp=$($i </dev/null 2>/dev/null | cut -d ' ' -f1)
if [ x"$tmp" = x"da39a3ee5e6b4b0d3255bfef95601890afd80709" ]; then
echo "$i"
exit 0
fi
done
echo "false"
exit 1
fi
# Get GnuPG version from VERSION file. For a GIT checkout this means
# that ./autogen.sh must have been run first. For a regular tarball
# VERSION is always available.
if [ ! -f "$srcdir/../VERSION" ]; then

View File

@ -63,40 +63,40 @@ help:
SPEEDOMAKE := $(MAKE) -f $(SPEEDO_MK) UPD_SWDB=1
native:
native: check-tools
$(SPEEDOMAKE) TARGETOS=native WHAT=release WITH_GUI=0 all
git-native:
git-native: check-tools
$(SPEEDOMAKE) TARGETOS=native WHAT=git WITH_GUI=0 all
this-native:
this-native: check-tools
$(SPEEDOMAKE) TARGETOS=native WHAT=this WITH_GUI=0 all
native-gui:
native-gui: check-tools
$(SPEEDOMAKE) TARGETOS=native WHAT=release WITH_GUI=1 all
git-native-gui:
git-native-gui: check-tools
$(SPEEDOMAKE) TARGETOS=native WHAT=git WITH_GUI=1 all
this-native-gui:
this-native-gui: check-tools
$(SPEEDOMAKE) TARGETOS=native WHAT=this WITH_GUI=1 all
w32-installer:
w32-installer: check-tools
$(SPEEDOMAKE) TARGETOS=w32 WHAT=release WITH_GUI=1 installer
git-w32-installer:
git-w32-installer: check-tools
$(SPEEDOMAKE) TARGETOS=w32 WHAT=git WITH_GUI=1 installer
this-w32-installer:
this-w32-installer: check-tools
$(SPEEDOMAKE) TARGETOS=w32 WHAT=this WITH_GUI=1 installer
w32-source:
w32-source: check-tools
$(SPEEDOMAKE) TARGETOS=w32 WHAT=release WITH_GUI=1 dist-source
git-w32-source:
git-w32-source: check-tools
$(SPEEDOMAKE) TARGETOS=w32 WHAT=git WITH_GUI=1 dist-source
this-w32-source:
this-w32-source: check-tools
$(SPEEDOMAKE) TARGETOS=w32 WHAT=git WITH_GUI=1 dist-source
@ -548,6 +548,12 @@ W32CC = i686-w64-mingw32-gcc
MKDIR=mkdir
MAKENSIS=makensis
SHA1SUM := $(shell $(topsrc)/build-aux/getswdb.sh --find-sha1sum)
ifeq ($(SHA1SUM),false)
$(error The sha1sum tool is missing)
endif
BUILD_ISODATE=$(shell date -u +%Y-%m-%d)
# The next two macros will work only after gnupg has been build.
@ -583,7 +589,6 @@ endif
# The playground area is our scratch area, where we unpack, build and
# install the packages.
$(stampdir)/stamp-directories:
@ -723,7 +728,7 @@ $(stampdir)/stamp-$(1)-00-unpack: $(stampdir)/stamp-directories
esac; \
if [ -f tmp.tgz ]; then \
if [ -n "$$$${sha1}" ]; then \
tmp=$$$$(sha1sum <tmp.tgz|cut -d' ' -f1);\
tmp=$$$$($(SHA1SUM) <tmp.tgz|cut -d' ' -f1);\
if [ "$$$${tmp}" != "$$$${sha1}" ]; then \
echo "speedo:"; \
echo "speedo: ERROR: checksum mismatch for $(1)";\
@ -1014,8 +1019,14 @@ installer: all w32_insthelpers $(w32src)/inst-options.ini $(bdir)/README.txt
$(w32src)/inst.nsi
@echo "Ready: $(idir)/$(INST_NAME)-$(INST_VERSION)"
#
# Check availibility of standard tools
#
check-tools:
#
# Mark phony targets
#
.PHONY: all all-speedo report-speedo clean-stamps clean-speedo installer \
w32_insthelpers
w32_insthelpers check-tools