donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit 6265416ce7cd9aaae4cf05d0b2a403568b9d98be
parent 69ee7c7351e5cc9de6d0de3f25525dd351156d03
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date:   Wed,  3 Sep 2025 10:24:50 +0200

build: add new make target gana-generate for GANA updates. Do not update on bootstrap. Generated files now tracked by git and must be updated manually through make target

Diffstat:
M.gitignore | 1-
MMakefile.am | 3+++
Maclocal.m4 | 13+++++++++++--
Mbootstrap | 4----
Mcontrib/gana-generate.sh | 51+++++++++++++++++++++++++++++++++++++++++++++++----
Asrc/include/donau_signatures.h | 41+++++++++++++++++++++++++++++++++++++++++
6 files changed, 102 insertions(+), 11 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -6,7 +6,6 @@ config.log configure configure~ taler_config.h.in~ -src/include/donau_signatures.h *.md5~ *.unc-backup~ *.orig diff --git a/Makefile.am b/Makefile.am @@ -21,3 +21,6 @@ ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = build-aux/config.rpath \ AUTHORS \ README.1st + +gana-generate: + ./contrib/gana-generate.sh master diff --git a/aclocal.m4 b/aclocal.m4 @@ -68,8 +68,8 @@ m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ -dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) -dnl ---------------------------------- +dnl PKG_PROG_PKG_CONFIG([MIN-VERSION], [ACTION-IF-NOT-FOUND]) +dnl --------------------------------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to @@ -77,6 +77,12 @@ dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. +dnl +dnl If pkg-config is not found or older than specified, it will result +dnl in an empty PKG_CONFIG variable. To avoid widespread issues with +dnl scripts not checking it, ACTION-IF-NOT-FOUND defaults to aborting. +dnl You can specify [PKG_CONFIG=false] as an action instead, which would +dnl result in pkg-config tests failing, but no bogus error messages. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) @@ -97,6 +103,9 @@ if test -n "$PKG_CONFIG"; then AC_MSG_RESULT([no]) PKG_CONFIG="" fi +fi +if test -z "$PKG_CONFIG"; then + m4_default([$2], [AC_MSG_ERROR([pkg-config not found])]) fi[]dnl ])dnl PKG_PROG_PKG_CONFIG diff --git a/bootstrap b/bootstrap @@ -11,10 +11,6 @@ fi echo "$0: Updating submodules" echo | git submodule update --init --force --remote -# Generate based on pinned submodule -./contrib/gana-generate.sh - - # This is more portable than `which' but comes with # the caveat of not(?) properly working on busybox's ash: existence() diff --git a/contrib/gana-generate.sh b/contrib/gana-generate.sh @@ -5,6 +5,26 @@ # Run from exchange/ main directory. set -eu +SRC_ROOT=$PWD + +if [ ! -f $SRC_ROOT/contrib/gana-generate.sh ]; then + echo "Please run this script from the root of the source tree!" + exit 1 +fi + +COMMIT_HASH="" +if [ ! -z $1 ]; then + COMMIT_HASH=$1 +fi + +# This is more portable than `which' but comes with +# the caveat of not(?) properly working on busybox's ash: +existence() +{ + type "$1" >/dev/null 2>&1 +} + + domake () { # $1 -- dir under contrib/ @@ -20,15 +40,38 @@ ensure () # $3 -- dst dir under ./ fn="$1" src="contrib/$2/$fn" + tmp_dst="./$3/$fn.tmp" dst="./$3/$fn" - if ! diff $src $dst > /dev/null + cat $src | uncrustify -l c -c uncrustify.cfg > $tmp_dst + if ! diff $tmp_dst $dst > /dev/null then test ! -f $dst || chmod +w $dst - cp $src $dst + cp $tmp_dst $dst chmod -w $dst + rm $tmp_dst + fi +} + +gana_update() +{ + echo "Updating GANA..." + if ! existence git; then + echo "Script requires git" + exit 1 + fi + if ! existence recfmt; then + echo "Script requires recutils" + exit 1 + fi + cd contrib/gana || exit 1 + if [ ! -z "${COMMIT_HASH}" ]; then + git checkout "${COMMIT_HASH}" || exit 1 + git pull fi + cd $SRC_ROOT + domake sigp + ensure donau_signatures.h sigp src/include } -domake sigp -ensure donau_signatures.h sigp src/include +gana_update diff --git a/src/include/donau_signatures.h b/src/include/donau_signatures.h @@ -0,0 +1,41 @@ +/* + This file is part of DONAU + Copyright (C) 2014-2022 Donau Systems SA + + DONAU is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. + + DONAU is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along with + DONAU; see the file COPYING. If not, see <http://www.gnu.org/licenses/> +*/ +/** + * @file donau_signatures.h + * @brief message formats and signature constants used to define + * the binary formats of signatures in Donau + * + * This file should define the constants and C structs that one needs + * to know to implement Donau clients (wallets or merchants or + * auditor) that need to produce or verify Donau signatures. + */ +#ifndef DONAU_SIGNATURES_H +#define DONAU_SIGNATURES_H + + +/** + * The signature is done by the Donau. The Donau signes over the total amount of the corresponding year, the corresponding year and the donation identifier of a specific donor. The statement confirms that the donor made this total in donations for the given year. + */ +#define DONAU_SIGNATURE_DONAU_DONATION_STATEMENT 1500 + + +/** + * The signature is made by a charity and shows that the charity is in agreement with the donation request which it sends to the Donau. The charity signs over all blinded identifiers and key pairs which it has received from the donor. The signature affirms that the charity wants the donation receipts to be issued on its behalf. + */ +#define DONAU_SIGNATURE_CHARITY_DONATION_CONFIRMATION 1501 + + +#endif