build: Use ~/.gnupg-autogen.sh for the release targets

* Makefile.am (sign-release): Use global config vars.
This commit is contained in:
Werner Koch 2020-11-12 11:10:00 +01:00
parent 01a0d8ec1a
commit 27abdac25d
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -20,14 +20,14 @@
## Process this file with automake to produce Makefile.in ## Process this file with automake to produce Makefile.in
# Location of the released tarball archives. Note that this is an # Location of the released tarball archives. This is prefixed by
# internal archive and before uploading this to the public server, # the variable RELEASE_ARCHIVE in ~/.gnupg-autogen.rc. For example:
# manual tests should be run and the git release tat set and pushed. # RELEASE_ARCHIVE=user@host:archive/tarballs
# Adjust as needed. RELEASE_ARCHIVE_SUFFIX = gpgme
RELEASE_ARCHIVE_DIR = wk@vigenere:tarballs/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 # Autoconf flags
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
@ -108,19 +108,31 @@ release:
sign-release: sign-release:
+(set -e; \ +(set -e; \
cd dist; \ 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" ;\ files1="$(RELEASE_NAME).tar.bz2" ;\
files2="$(RELEASE_NAME).tar.bz2.sig \ files2="$(RELEASE_NAME).tar.bz2.sig \
$(RELEASE_NAME).swdb \ $(RELEASE_NAME).swdb \
$(RELEASE_NAME).buildlog" ;\ $(RELEASE_NAME).buildlog" ;\
echo "/* Signing the source tarball ..." ;\ 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;\ cat $(RELEASE_NAME).swdb >swdb.snippet;\
echo >>swdb.snippet ;\ echo >>swdb.snippet ;\
sha1sum $${files1} >>swdb.snippet ;\ sha1sum $${files1} >>swdb.snippet ;\
cat "../$(RELEASE_NAME).buildlog" swdb.snippet \ cat "../$(RELEASE_NAME).buildlog" swdb.snippet \
| gzip >$(RELEASE_NAME).buildlog ;\ | gzip >$(RELEASE_NAME).buildlog ;\
echo "Copying to local archive ..." ;\ echo "Copying to local archive ..." ;\
scp -p $${files1} $${files2} $(RELEASE_ARCHIVE_DIR)/ || true;\ scp -p $${files1} $${files2} $$myarchive/ || true;\
echo "Uploading documentation ..." ;\ echo "Uploading documentation ..." ;\
$(MAKE) -C doc online; \ $(MAKE) -C doc online; \
echo '/*' ;\ echo '/*' ;\