From 27abdac25dcd4ba57e073a5de2f057830e623282 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 12 Nov 2020 11:10:00 +0100 Subject: [PATCH] build: Use ~/.gnupg-autogen.sh for the release targets * Makefile.am (sign-release): Use global config vars. --- Makefile.am | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Makefile.am b/Makefile.am index 1772d69c..8c191b18 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,14 +20,14 @@ ## Process this file with automake to produce Makefile.in -# Location of the released tarball archives. Note that this is an -# internal archive and before uploading this to the public server, -# manual tests should be run and the git release tat set and pushed. -# Adjust as needed. -RELEASE_ARCHIVE_DIR = wk@vigenere:tarballs/gpgme/ +# Location of the released tarball archives. This is prefixed by +# the variable RELEASE_ARCHIVE in ~/.gnupg-autogen.rc. For example: +# RELEASE_ARCHIVE=user@host:archive/tarballs +RELEASE_ARCHIVE_SUFFIX = gpgme +# The variable RELEASE_SIGNKEY in ~/.gnupg-autogen.rc is used +# to specify the key for signing. For example: +# RELEASE_SIGNKEY=D8692123C4065DEA5E0F3AB5249B39D24F25E3B6 -# The key used to sign the released sources. Adjust as needed. -RELEASE_SIGNING_KEY = D8692123C4065DEA5E0F3AB5249B39D24F25E3B6 # Autoconf flags ACLOCAL_AMFLAGS = -I m4 @@ -108,19 +108,31 @@ release: sign-release: +(set -e; \ cd dist; \ + x=$$(grep '^RELEASE_ARCHIVE=' $$HOME/.gnupg-autogen.rc|cut -d= -f2);\ + if [ -z "$$x" ]; then \ + echo "error: RELEASE_ARCHIVE missing in ~/.gnupg-autogen.rc">&2; \ + exit 2;\ + fi;\ + myarchive="$$x/$(RELEASE_ARCHIVE_SUFFIX)";\ + x=$$(grep '^RELEASE_SIGNKEY=' $$HOME/.gnupg-autogen.rc|cut -d= -f2);\ + if [ -z "$$x" ]; then \ + echo "error: RELEASE_SIGNKEY missing in ~/.gnupg-autogen.rc">&2; \ + exit 2;\ + fi;\ + mysignkey="$$x";\ files1="$(RELEASE_NAME).tar.bz2" ;\ files2="$(RELEASE_NAME).tar.bz2.sig \ $(RELEASE_NAME).swdb \ $(RELEASE_NAME).buildlog" ;\ echo "/* Signing the source tarball ..." ;\ - gpg -sbu $(RELEASE_SIGNING_KEY) $(RELEASE_NAME).tar.bz2 ;\ + gpg -sbu $$mysignkey $(RELEASE_NAME).tar.bz2 ;\ cat $(RELEASE_NAME).swdb >swdb.snippet;\ echo >>swdb.snippet ;\ sha1sum $${files1} >>swdb.snippet ;\ cat "../$(RELEASE_NAME).buildlog" swdb.snippet \ | gzip >$(RELEASE_NAME).buildlog ;\ echo "Copying to local archive ..." ;\ - scp -p $${files1} $${files2} $(RELEASE_ARCHIVE_DIR)/ || true;\ + scp -p $${files1} $${files2} $$myarchive/ || true;\ echo "Uploading documentation ..." ;\ $(MAKE) -C doc online; \ echo '/*' ;\