summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-02-09 16:00:08 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-02-09 16:00:08 +0900
commit158ef6d574d6bd975c94e86476cb1631e775a40c (patch)
treeb8b35f4bd31490137410f2b795b252f23ea5ee3e /build-aux
parent723cf5853fa655cec32478e13cd74b5b483fae7f (diff)
downloadgpg2-158ef6d574d6bd975c94e86476cb1631e775a40c.tar.gz
gpg2-158ef6d574d6bd975c94e86476cb1631e775a40c.tar.bz2
gpg2-158ef6d574d6bd975c94e86476cb1631e775a40c.zip
Imported Upstream version 2.1.11upstream/2.1.11
Diffstat (limited to 'build-aux')
-rwxr-xr-xbuild-aux/getswdb.sh20
-rw-r--r--build-aux/speedo.mk42
2 files changed, 59 insertions, 3 deletions
diff --git a/build-aux/getswdb.sh b/build-aux/getswdb.sh
index e7f6fca..4a1730b 100755
--- a/build-aux/getswdb.sh
+++ b/build-aux/getswdb.sh
@@ -37,6 +37,7 @@ Options:
--skip-verify Do not check signatures
--skip-selfcheck Do not check GnuPG version
--find-sha1sum Print the name of the sha1sum utility
+ --find-sha256sum Print the name of the sha256sum utility
--help Print this help.
EOF
exit $1
@@ -49,6 +50,7 @@ skip_download=no
skip_verify=no
skip_selfcheck=no
find_sha1sum=no
+find_sha256sum=no
while test $# -gt 0; do
case "$1" in
# Set up `optarg'.
@@ -76,6 +78,9 @@ while test $# -gt 0; do
--find-sha1sum)
find_sha1sum=yes
;;
+ --find-sha256sum)
+ find_sha256sum=yes
+ ;;
*)
usage 1 1>&2
;;
@@ -96,6 +101,21 @@ if [ ${find_sha1sum} = yes ]; then
exit 1
fi
+# Mac OSX has only a shasum and not sha256sum
+if [ ${find_sha256sum} = yes ]; then
+ for i in 'shasum -a 256' sha256sum ; do
+ tmp=$($i </dev/null 2>/dev/null | cut -d ' ' -f1)
+ tmp2="e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
+ if [ x"$tmp" = x"$tmp2" ]; 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.
diff --git a/build-aux/speedo.mk b/build-aux/speedo.mk
index cd3a66d..5dde0fe 100644
--- a/build-aux/speedo.mk
+++ b/build-aux/speedo.mk
@@ -260,39 +260,51 @@ gnupg_ver := $(shell awk '$$1=="gnupg21_ver" {print $$2}' swdb.lst)
libgpg_error_ver := $(shell awk '$$1=="libgpg_error_ver" {print $$2}' swdb.lst)
libgpg_error_sha1:= $(shell awk '$$1=="libgpg_error_sha1" {print $$2}' swdb.lst)
+libgpg_error_sha2:= $(shell awk '$$1=="libgpg_error_sha2" {print $$2}' swdb.lst)
npth_ver := $(shell awk '$$1=="npth_ver" {print $$2}' swdb.lst)
npth_sha1 := $(shell awk '$$1=="npth_sha1" {print $$2}' swdb.lst)
+npth_sha2 := $(shell awk '$$1=="npth_sha2" {print $$2}' swdb.lst)
libgcrypt_ver := $(shell awk '$$1=="libgcrypt_ver" {print $$2}' swdb.lst)
libgcrypt_sha1 := $(shell awk '$$1=="libgcrypt_sha1" {print $$2}' swdb.lst)
+libgcrypt_sha2 := $(shell awk '$$1=="libgcrypt_sha2" {print $$2}' swdb.lst)
libassuan_ver := $(shell awk '$$1=="libassuan_ver" {print $$2}' swdb.lst)
libassuan_sha1 := $(shell awk '$$1=="libassuan_sha1" {print $$2}' swdb.lst)
+libassuan_sha2 := $(shell awk '$$1=="libassuan_sha2" {print $$2}' swdb.lst)
libksba_ver := $(shell awk '$$1=="libksba_ver" {print $$2}' swdb.lst)
libksba_sha1 := $(shell awk '$$1=="libksba_sha1" {print $$2}' swdb.lst)
+libksba_sha2 := $(shell awk '$$1=="libksba_sha2" {print $$2}' swdb.lst)
gpgme_ver := $(shell awk '$$1=="gpgme_ver" {print $$2}' swdb.lst)
gpgme_sha1 := $(shell awk '$$1=="gpgme_sha1" {print $$2}' swdb.lst)
+gpgme_sha2 := $(shell awk '$$1=="gpgme_sha2" {print $$2}' swdb.lst)
pinentry_ver := $(shell awk '$$1=="pinentry_ver" {print $$2}' swdb.lst)
pinentry_sha1 := $(shell awk '$$1=="pinentry_sha1" {print $$2}' swdb.lst)
+pinentry_sha2 := $(shell awk '$$1=="pinentry_sha2" {print $$2}' swdb.lst)
gpa_ver := $(shell awk '$$1=="gpa_ver" {print $$2}' swdb.lst)
gpa_sha1 := $(shell awk '$$1=="gpa_sha1" {print $$2}' swdb.lst)
+gpa_sha2 := $(shell awk '$$1=="gpa_sha2" {print $$2}' swdb.lst)
gpgex_ver := $(shell awk '$$1=="gpgex_ver" {print $$2}' swdb.lst)
gpgex_sha1 := $(shell awk '$$1=="gpgex_sha1" {print $$2}' swdb.lst)
+gpgex_sha2 := $(shell awk '$$1=="gpgex_sha2" {print $$2}' swdb.lst)
zlib_ver := $(shell awk '$$1=="zlib_ver" {print $$2}' swdb.lst)
zlib_sha1 := $(shell awk '$$1=="zlib_sha1_gz" {print $$2}' swdb.lst)
+zlib_sha2 := $(shell awk '$$1=="zlib_sha2_gz" {print $$2}' swdb.lst)
bzip2_ver := $(shell awk '$$1=="bzip2_ver" {print $$2}' swdb.lst)
bzip2_sha1 := $(shell awk '$$1=="bzip2_sha1_gz" {print $$2}' swdb.lst)
+bzip2_sha2 := $(shell awk '$$1=="bzip2_sha2_gz" {print $$2}' swdb.lst)
adns_ver := $(shell awk '$$1=="adns_ver" {print $$2}' swdb.lst)
adns_sha1 := $(shell awk '$$1=="adns_sha1" {print $$2}' swdb.lst)
+adns_sha2 := $(shell awk '$$1=="adns_sha2" {print $$2}' swdb.lst)
$(info Information from the version database)
$(info GnuPG ..........: $(gnupg_ver) (building $(gnupg_ver_this)))
@@ -628,6 +640,10 @@ SHA1SUM := $(shell $(topsrc)/build-aux/getswdb.sh --find-sha1sum)
ifeq ($(SHA1SUM),false)
$(error The sha1sum tool is missing)
endif
+SHA2SUM := $(shell $(topsrc)/build-aux/getswdb.sh --find-sha256sum)
+ifeq ($(SHA2SUM),false)
+$(error The sha256sum tool is missing)
+endif
BUILD_ISODATE=$(shell date -u +%Y-%m-%d)
@@ -705,6 +721,7 @@ define SETVARS
git="$(call GETVAR,speedo_pkg_$(1)_git)"; \
gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)"; \
tar="$(call GETVAR,speedo_pkg_$(1)_tar)"; \
+ sha2="$(call GETVAR,$(1)_sha2)"; \
sha1="$(call GETVAR,$(1)_sha1)"; \
pkgsdir="$(sdir)/$(1)"; \
if [ "$(1)" = "gnupg" ]; then \
@@ -739,6 +756,7 @@ define SETVARS_W64
git="$(call GETVAR,speedo_pkg_$(1)_git)"; \
gitref="$(call GETVAR,speedo_pkg_$(1)_gitref)"; \
tar="$(call GETVAR,speedo_pkg_$(1)_tar)"; \
+ sha2="$(call GETVAR,$(1)_sha2)"; \
sha1="$(call GETVAR,$(1)_sha1)"; \
pkgsdir="$(sdir)/$(1)"; \
if [ "$(1)" = "gnupg" ]; then \
@@ -814,11 +832,19 @@ $(stampdir)/stamp-$(1)-00-unpack: $(stampdir)/stamp-directories
| $$$${pretar} | tar x$$$${opt}f - ;; \
esac; \
if [ -f tmp.tgz ]; then \
- if [ -n "$$$${sha1}" ]; then \
+ if [ -n "$$$${sha2}" ]; then \
+ tmp=$$$$($(SHA2SUM) <tmp.tgz|cut -d' ' -f1);\
+ if [ "$$$${tmp}" != "$$$${sha2}" ]; then \
+ echo "speedo:"; \
+ echo "speedo: ERROR: SHA-256 checksum mismatch for $(1)";\
+ echo "speedo:"; \
+ exit 1; \
+ fi; \
+ elif [ -n "$$$${sha1}" ]; then \
tmp=$$$$($(SHA1SUM) <tmp.tgz|cut -d' ' -f1);\
if [ "$$$${tmp}" != "$$$${sha1}" ]; then \
echo "speedo:"; \
- echo "speedo: ERROR: checksum mismatch for $(1)";\
+ echo "speedo: ERROR: SHA-1 checksum mismatch for $(1)";\
echo "speedo:"; \
exit 1; \
fi; \
@@ -1128,7 +1154,17 @@ installer-from-source: dist-source
tar xJf "../$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).tar.xz";\
cd $(INST_NAME)-$(INST_VERSION); \
$(MAKE) -f build-aux/speedo.mk this-w32-installer SELFCHECK=0;\
- mv "PLAY/inst/$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).exe" ../.. ;\
+ reldate="$$(date -u +%Y-%m-%d)" ;\
+ exefile="$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).exe" ;\
+ mv "PLAY/inst/$$exefile" ../.. ;\
+ exefile="../../$$exefile" ;\
+ ( pref="#+macro: gnupg21_w32_" ;\
+ echo "$${pref}ver $(INST_VERSION)_$(BUILD_DATESTR)" ;\
+ echo "$${pref}date $${reldate}" ;\
+ echo "$${pref}size $$(wc -c <$$exefile|awk '{print int($$1/1024)}')k";\
+ echo "$${pref}sha1 $$(sha1sum <$$exefile|cut -d' ' -f1)" ;\
+ echo "$${pref}sha2 $$(sha256sum <$$exefile|cut -d' ' -f1)" ;\
+ ) | tee $$exefile.swdb ;\
)
endif