exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 6c5cbfc3c55a6a86b98f3d583c6241fb3713da3c
parent 2a9752eca9dfa19d037fcde4cbcb7ae1ff3b8392
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date:   Sun, 29 Mar 2026 21:51:59 +0200

build: switch build system to meson

Diffstat:
M.gitignore | 3+--
DMakefile.am | 29-----------------------------
AMakefile.in | 49+++++++++++++++++++++++++++++++++++++++++++++++++
Mbootstrap | 86++++++++++++++++++++++++++++++++++++++++----------------------------------------
Aconfigure | 255+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dconfigure.ac | 575-------------------------------------------------------------------------------
Dcontrib/Makefile.am.in | 72------------------------------------------------------------------------
Mcontrib/ci/Containerfile | 2+-
Mcontrib/ci/jobs/000-codespell/job.sh | 2+-
Mcontrib/ci/jobs/002-test/1-build.sh | 11++++++-----
Mcontrib/ci/jobs/002-test/4-test.sh | 7+------
Mcontrib/ci/jobs/100-build-debian-trixie-amd64-gen/Containerfile | 2+-
Mcontrib/ci/jobs/101-deb-package-debian-trixie-amd64-gen/Containerfile | 2+-
Mcontrib/ci/targets/debian/build/build.sh | 24+++++++++++++++---------
Acontrib/meson.build | 129+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dcontrib/typst/Makefile.am | 23-----------------------
Dcontrib/typst/_cover_/Makefile.am | 10----------
Dcontrib/typst/accept-tos/Makefile.am | 10----------
Dcontrib/typst/challenger-postal/Makefile.am | 10----------
Dcontrib/typst/challenger-sms/Makefile.am | 10----------
Dcontrib/typst/common/Makefile.am | 12------------
Acontrib/typst/common/meson.build | 8++++++++
Dcontrib/typst/generic_note/Makefile.am | 10----------
Dcontrib/typst/generic_upload/Makefile.am | 10----------
Acontrib/typst/meson.build | 33+++++++++++++++++++++++++++++++++
Dcontrib/typst/vqf_902_1/Makefile.am | 10----------
Dcontrib/typst/vqf_902_11/Makefile.am | 10----------
Dcontrib/typst/vqf_902_11_customer/Makefile.am | 10----------
Dcontrib/typst/vqf_902_11_officer/Makefile.am | 10----------
Dcontrib/typst/vqf_902_12/Makefile.am | 10----------
Dcontrib/typst/vqf_902_13/Makefile.am | 10----------
Dcontrib/typst/vqf_902_14/Makefile.am | 10----------
Dcontrib/typst/vqf_902_15/Makefile.am | 10----------
Dcontrib/typst/vqf_902_1_customer/Makefile.am | 10----------
Dcontrib/typst/vqf_902_1_officer/Makefile.am | 10----------
Dcontrib/typst/vqf_902_4/Makefile.am | 10----------
Dcontrib/typst/vqf_902_5/Makefile.am | 10----------
Dcontrib/typst/vqf_902_9/Makefile.am | 10----------
Dcontrib/typst/vqf_902_9_customer/Makefile.am | 10----------
Dcontrib/typst/vqf_902_9_officer/Makefile.am | 10----------
Mcontrib/uncrustify_precommit | 2+-
Mdebian/changelog | 24++++++++++++++++++++++++
Mdebian/libtalerexchange-dev.install | 2++
Mdebian/rules | 5+----
Ddoc/Makefile.am | 67-------------------------------------------------------------------
Adoc/doxygen/Makefile | 15+++++++++++++++
Ddoc/doxygen/Makefile.am | 18------------------
Adoc/meson.build | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aflake.lock | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aflake.nix | 122+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ameson-dist-script | 3+++
Ameson.build | 395+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ameson.options | 7+++++++
Apo/meson.build | 1+
Ascripts/doxygen.meson.sh | 18++++++++++++++++++
Dsrc/Makefile.am | 37-------------------------------------
Dsrc/auditor/Makefile.am | 273-------------------------------------------------------------------------------
Asrc/auditor/meson.build | 346+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/auditor/test-auditor.sh | 2+-
Msrc/auditor/test-kyc.sh | 2+-
Msrc/auditor/test-revocation.sh | 2+-
Msrc/auditor/test-sync.sh | 2+-
Dsrc/auditordb/Makefile.am | 204-------------------------------------------------------------------------------
Asrc/auditordb/Makefile.sql | 15+++++++++++++++
Asrc/auditordb/meson.build | 211+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/bank-lib/Makefile.am | 120-------------------------------------------------------------------------------
Asrc/bank-lib/meson.build | 153+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/benchmark/Makefile.am | 74--------------------------------------------------------------------------
Asrc/benchmark/meson.build | 82+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/curl/Makefile.am | 24------------------------
Asrc/curl/meson.build | 27+++++++++++++++++++++++++++
Dsrc/exchange-tools/Makefile.am | 83-------------------------------------------------------------------------------
Asrc/exchange-tools/meson.build | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/exchange/Makefile.am | 259-------------------------------------------------------------------------------
Asrc/exchange/meson.build | 300+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/exchange/test_taler_exchange_httpd.sh | 2+-
Msrc/exchange/test_taler_exchange_httpd_afl.sh | 2+-
Dsrc/exchangedb/Makefile.am | 443-------------------------------------------------------------------------------
Asrc/exchangedb/Makefile.sql | 30++++++++++++++++++++++++++++++
Asrc/exchangedb/meson.build | 430+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/extensions/Makefile.am | 34----------------------------------
Dsrc/extensions/age_restriction/Makefile.am | 32--------------------------------
Asrc/extensions/age_restriction/meson.build | 23+++++++++++++++++++++++
Asrc/extensions/meson.build | 26++++++++++++++++++++++++++
Dsrc/include/Makefile.am | 7-------
Asrc/include/meson.build | 3+++
Dsrc/include/taler/Makefile.am | 41-----------------------------------------
Asrc/include/taler/meson.build | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/include/taler/taler-exchange/Makefile.am | 59-----------------------------------------------------------
Asrc/include/taler/taler-exchange/meson.build | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/json/Makefile.am | 58----------------------------------------------------------
Asrc/json/meson.build | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/json/test_conversion.sh | 2+-
Dsrc/kyclogic/Makefile.am | 184-------------------------------------------------------------------------------
Asrc/kyclogic/meson.build | 199+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/lib/Makefile.am | 131-------------------------------------------------------------------------------
Asrc/lib/meson.build | 149+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/meson.build | 32++++++++++++++++++++++++++++++++
Dsrc/mhd/Makefile.am | 79-------------------------------------------------------------------------------
Asrc/mhd/meson.build | 155+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/mhd/test_typst_1.typ | 2+-
Dsrc/pq/Makefile.am | 42------------------------------------------
Asrc/pq/meson.build | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/sq/Makefile.am | 40----------------------------------------
Asrc/sq/meson.build | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/templating/Makefile.am | 133-------------------------------------------------------------------------------
Msrc/templating/meson.build | 69+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
Dsrc/testing/Makefile.am | 598-------------------------------------------------------------------------------
Asrc/testing/meson.build | 890+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/testing/taler-unified-setup.sh | 2+-
Asrc/testing/test_exchange_api_home/.local/share/taler-auditor/offline-keys/meson.build | 6++++++
Asrc/testing/test_exchange_api_home/.local/share/taler-exchange/offline/meson.build | 6++++++
Dsrc/util/Makefile.am | 196-------------------------------------------------------------------------------
Asrc/util/meson.build | 196+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
114 files changed, 5051 insertions(+), 4248 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1,5 +1,5 @@ *~ -*Makefile.in +**/Makefile.in *Makefile *app.info *.gcno @@ -16,7 +16,6 @@ autom4te.cache autoscan.log compile INSTALL -configure depcomp missing taler_config.h.in diff --git a/Makefile.am b/Makefile.am @@ -1,29 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include - -if DOC_ONLY -if ENABLE_DOC - SUBDIRS = . contrib doc po -else - SUBDIRS = . contrib po -endif -else -if ENABLE_DOC - SUBDIRS = . contrib src doc po -else - SUBDIRS = . contrib src po -endif -endif - -@DX_RULES@ - -TESTS = contrib/check-prebuilt - -ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = build-aux/config.rpath \ - AUTHORS \ - RELEASE.md \ - INSTALL.md - -gana-generate: - ./contrib/gana-generate.sh master diff --git a/Makefile.in b/Makefile.in @@ -0,0 +1,49 @@ +# Build the program in the local tree +.PHONY: all +all: + $(NINJA) -C $(mesonbuilddir) + +# Install the program +.PHONY: install +install: all + $(MESON) install -C $(mesonbuilddir) + +# Remove files created during 'all' +.PHONY: clean +clean: + $(NINJA) -C $(mesonbuilddir) -t clean + +# Remove files created during 'install' +.PHONY: uninstall +uninstall: + $(NINJA) uninstall -C $(mesonbuilddir) + +# Make tarball +.PHONY: dist +dist: + $(MESON) dist -C $(mesonbuilddir) --no-tests --formats gztar + +# Make doxygen +.PHONY: doxygen +doxygen: + $(NINJA) -C $(mesonbuilddir) doxygen + +# Run tests +.PHONY: check +check: + $(MESON) test -C $(mesonbuilddir) + +.PHONY: installcheck +installcheck: + $(MESON) test -C $(mesonbuilddir) --suite=installcheck + +.PHONY: integrationtests +integrationtests: + $(MESON) test -C $(mesonbuilddir) --suite=integrationtests + +format: + $(MESON) fmt -i -r . + #find ./src -name "*.[h,c]" | uncrustify -l c -c contrib/conf/uncrustify.cfg -F - --replace --no-backup + +Makefile: Makefile.in + ./config.status diff --git a/bootstrap b/bootstrap @@ -10,12 +10,12 @@ fi # Make sure that "git pull" et al. also update # submodules to avoid accidental rollbacks. -git config --local submodule.recurse true +git config --local submodule.recurse true || true echo "$0: Updating submodules" # Caution: We do NOT want to fetch the latest version with --remote, # but instead always the one that's recorded in the repository. -echo | git submodule update --init --force +echo | git submodule update --init --force || true ./contrib/check-prebuilt @@ -27,20 +27,20 @@ existence() } # Freeze SQL files that must no longer be edited. -for n in 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 -do - chmod -w src/exchangedb/exchange-$n.sql* - chmod -w src/exchangedb/$n-*.sql &> /dev/null || true -done -for n in 0001 -do - chmod -w src/exchangedb/auditor-triggers-$n.sql* -done -for n in 0001 0002 -do - chmod -w src/auditordb/auditor-$n.sql* - chmod -w src/auditordb/$n-*.sql &> /dev/null || true -done +#for n in 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 +#do +# chmod -w src/exchangedb/exchange-$n.sql* +# chmod -w src/exchangedb/$n-*.sql &> /dev/null || true +#done +#for n in 0001 +#do +# chmod -w src/exchangedb/auditor-triggers-$n.sql* +#done +#for n in 0001 0002 +#do +# chmod -w src/auditordb/auditor-$n.sql* +# chmod -w src/auditordb/$n-*.sql &> /dev/null || true +#done if existence uncrustify; then echo "Installing uncrustify hook and configuration" @@ -54,30 +54,30 @@ fi # Generate Makefile.am in contrib/ -cd contrib -rm -f Makefile.am -echo 'dist_amlspapkgdata_DATA = \' > Makefile.am.ext -find wallet-core/aml-backoffice/ -type f | sort | awk '{print " " $1 " \\" }' >> Makefile.am.ext -# Remove extra '\' at the end of the file -truncate -s -2 Makefile.am.ext - -echo "" >> Makefile.am.ext -echo 'dist_kycspapkgdata_DATA = \' >> Makefile.am.ext -find wallet-core/kyc/ -type f | sort | awk '{print " " $1 " \\" }' >> Makefile.am.ext -# Remove extra '\' at the end of the file -truncate -s -2 Makefile.am.ext - -echo "" >> Makefile.am.ext -echo 'dist_auditorspapkgdata_DATA = \' >> Makefile.am.ext -find wallet-core/auditor-backoffice/ -type f | sort | awk '{print " " $1 " \\" }' >> Makefile.am.ext -# Remove extra '\' at the end of the file -truncate -s -2 Makefile.am.ext - - -cat Makefile.am.in Makefile.am.ext >> Makefile.am -# Prevent accidental editing of the generated Makefile.am -chmod -w Makefile.am -cd .. - -echo "$0: Running autoreconf" -autoreconf -fi +#cd contrib +#rm -f Makefile.am +#echo 'dist_amlspapkgdata_DATA = \' > Makefile.am.ext +#find wallet-core/aml-backoffice/ -type f | sort | awk '{print " " $1 " \\" }' >> Makefile.am.ext +## Remove extra '\' at the end of the file +#truncate -s -2 Makefile.am.ext +# +#echo "" >> Makefile.am.ext +#echo 'dist_kycspapkgdata_DATA = \' >> Makefile.am.ext +#find wallet-core/kyc/ -type f | sort | awk '{print " " $1 " \\" }' >> Makefile.am.ext +## Remove extra '\' at the end of the file +#truncate -s -2 Makefile.am.ext +# +#echo "" >> Makefile.am.ext +#echo 'dist_auditorspapkgdata_DATA = \' >> Makefile.am.ext +#find wallet-core/auditor-backoffice/ -type f | sort | awk '{print " " $1 " \\" }' >> Makefile.am.ext +## Remove extra '\' at the end of the file +#truncate -s -2 Makefile.am.ext +# +# +#cat Makefile.am.in Makefile.am.ext >> Makefile.am +## Prevent accidental editing of the generated Makefile.am +#chmod -w Makefile.am +#cd .. +# +#echo "$0: Running autoreconf" +#autoreconf -fi diff --git a/configure b/configure @@ -0,0 +1,255 @@ +#!/bin/sh + +pkg_name="exchange" +pkg_default_features="" +pkg_optional_features="coverage logging enable-epoll expensivetests only-doc install-rpath" +pkg_optional_dependencies="" + +# DO NOT EDIT BELOW THIS LINE +standard_dirs="prefix exec_prefix bindir sbindir libexecdir sysconfdir sharedstatedir localstatedir runstatedir libdir includedir oldincludedir datarootdir datadir infodir localedir mandir docdir htmldir dvidir pdfdir psdir srcdir mesonbuilddir" +standard_utils="AR AS BISON CC CXX CPP FLEX INSTALL LD LDCONFIG LEX MAKE MAKEINFO RANLIB TEXI2DVI YACC CHGRP CHMOD CHOWN MKNOD RM NINJA MESON" +standard_flags="ARFLAGS BISONFLAGS CFLAGS CXXFLAGS CPPFLAGS FLEXFLAGS INSTALLFLAGS LDFLAGS LDCONFIGFLAGS LFLAGS MAKEFLAGS MAKEINFOFLAGS RANLIBFLAGS TEXI2DVIFLAGS YACCFLAGS CHGRPFLAGS CHMODFLAGS CHOWNFLAGS MKNODFLAGS" +standard_vars="INSTALL_DATA INSTALL_PROGRAM INSTALL_SCRIPT" +generated_comment="# This file was generated by configure. DO NOT edit it directly." + +# Save arguments +cat > config.status <<EOF +#!/bin/sh +$generated_comment +$0 $* +EOF +chmod 755 config.status + +# Parse arguments +oldifs="$IFS" +while [ "$#" -gt "0" ]; do + arg="$1" + shift + argsave="$@" + + IFS="=" + set -- $arg + IFS="$oldifs" + arg="$1" + shift + argparam="$@" + + case "$arg" in + --help|-h) + cat <<-EOF + Usage: $0 [options...] + General options: + + <variable>=<value> Overrides default utils and flags, e.g. CC=gcc + EOF + echo "" + echo "Directory variables:" + for sdir in $standard_dirs; do + echo "--$sdir=<directory>" + done + echo "" + echo "Options specific to $pkg_name:" + for feat in $pkg_optional_features; do + echo "--enable-$feat[=arg]" + done + for feat in $pkg_default_features; do + echo "--disable-$feat" + done + for dep in $pkg_optional_dependencies; do + echo "--with-$dep" + done + + echo + echo Other options will be ignored. Please see the README for additional information. + exit 0 + ;; + --enable-*) + for feat in $pkg_optional_features $pkg_default_features; do + ft=$(echo $feat | tr - _) + if [ "--enable-$feat" = "$arg" ] && [ -z "$argparam" ]; then + eval "enable_$ft=true" + elif [ "--enable-$feat" = "$arg" ]; then + if [ "$argparam" = "yes" ]; then + eval "enable_$ft=\"true\"" + else + eval "enable_$ft=\"$argparam\"" + fi + fi + done + ;; + --disable-*) + argsave="--enable-${arg#--disable-}=false $argsave" + ;; + --with-*) + for dep in $pkg_optional_dependencies; do + if [ "--with-$dep" = "$arg" ] && [ -z "$argparam" ]; then + eval "with_$dep=yes" + elif [ "--with-$dep" = "$arg" ]; then + eval "with_$dep=\"$argparam\"" + fi + done + ;; + --without-*) + argsave="--with-${arg#--without-}=no $argsave" + ;; + --*) + for dir in $standard_dirs; do + [ "--$dir" = "$arg" ] && eval "var_$dir=\"$argparam\"" + done + ;; + *) + for flag in $standard_utils $standard_flags standard_vars; do + [ "$flag" = "$arg" ] && eval "$flag=\"$argparam\"" + done + ;; + esac + + set -- $argsave +done + +# Set default values +for util in $standard_utils; do + case "$util" in + CPP) eval "$util=\"\${${util}:-\\\$(CC) -E}\"" ;; + CXX) eval "$util=\"\${${util}:-g++}\"" ;; + RM) eval "$util=\"\${${util}:-rm -f}\"" ;; + MESON) eval "$util=\"\${${util}:-meson}\"" ;; + NINJA) eval "$util=\"\${${util}:-ninja}\"" ;; + *) eval "$util=\"\${${util}:-${util}}\"" ;; + esac +done +for feat in $pkg_optional_features; do + ft=$(echo $feat | tr - _) + eval "enable_$ft=\${enable_$ft:-false}" +done +for feat in $pkg_default_features; do + eval "enable_$feat=\${enable_$feat:-true}" +done +for feat in $pkg_optional_dependencies; do + eval "with_$feat=\${with_$feat:-no}" +done + +# Find source files +if [ -z "$var_srcdir" ]; then + [ -f ../Makefile.in ] && var_srcdir=.. + [ -f ./Makefile.in ] && var_srcdir=. +fi +if [ -z "$var_srcdir" ]; then + echo "Source files not found. Please specify a directory using --srcdir=..." >&2 + exit 1 +fi + +# Write Makefile +cat > Makefile <<EOF +$generated_comment +SHELL = /bin/sh +VPATH = ${var_srcdir} + +mesonbuilddir = ${var_mesonbuilddir:-build} +srcdir = ${var_srcdir} +prefix = ${var_prefix:-/usr/local} +exec_prefix = ${var_exec_prefix:-\$(prefix)} +bindir = ${var_bindir:-\$(exec_prefix)/bin} +sbindir = ${var_sbindir:-\$(exec_prefix)/sbin} +libexecdir = ${var_libexecdir:-\$(exec_prefix)/libexec} +datarootdir = ${var_datarootdir:-\$(prefix)/share} +datadir = ${var_datadir:-\$(datarootdir)} +sysconfdir = ${var_sysconfdir:-\$(prefix)/etc} +sharedstatedir = ${var_sharedstatedir:-\$(prefix)/com} +localstatedir = ${var_localstatedir:-\$(prefix)/var} +runstatedir = ${var_runstatedir:-\$(localstatedir)/run} +includedir = ${var_includedir:-\$(prefix)/include} +oldincludedir = ${var_oldincludedir:-/usr/include} +docdir = ${var_docdir:-\$(datarootdir)/doc/"$pkg_name"} +infodir = ${var_infodir:-\$(datarootdir)/info} +htmldir = ${var_htmldir:-\$(docdir)} +dvidir = ${var_dvidir:-\$(docdir)} +pdfdir = ${var_pdfdir:-\$(docdir)} +psdir = ${var_psdir:-\$(docdir)} +libdir = ${var_libdir:-\$(exec_prefix)/lib} +lispdir = ${var_lispdir:-\$(datarootdir)/emacs/site-lisp} +localedir = ${var_localedir:-\$(datarootdir)/locale} +mandir = ${var_mandir:-\$(datarootdir)/man} +manext = .1 +EOF + +if [ -d ${var_mesonbuilddir:-build} ]; then + echo "${var_mesonbuilddir:-build} already exists, deleting with" + $RM -r ${var_mesonbuilddir:-build} || exit 1 +fi + +for var in $standard_utils $standard_flags $standard_vars; do + eval "echo \"${var} = \$${var}\" >> Makefile" +done +echo >> Makefile + +mesonfeatopts="" +for feat in $pkg_optional_features $pkg_default_features; do + ft=$(echo $feat | tr - _) + eval "echo \"enable_$ft=\${enable_$ft}\" >> Makefile" + if [ "coverage" = $feat ]; then + mfeat="b_$feat" + else + mfeat=$feat + fi + eval "mesonfeatopts=\"$mesonfeatopts -D$mfeat=\${enable_$ft}\"" +done +for dep in $pkg_optional_dependencies; do + eval "echo \"with_$dep=\${with_$dep}\" >> Makefile" +done +echo >> Makefile + +cat "${var_srcdir}/Makefile.in" >> Makefile + +# Create default targets, if not already present +default_target() { + grep "^$1:" Makefile >/dev/null && return + echo ".PHONY: $1" >> Makefile + echo "$1: $2" >> Makefile + cat >> Makefile + echo >> Makefile +} + +#default_target Makefile <<EOF +# ./config.status +#EOF +for format in html dvi pdf ps; do + default_target "$format" </dev/null + default_target "install-$format" "$format" </dev/null +done +default_target check </dev/null +default_target mostlyclean clean </dev/null +default_target distclean clean <<EOF + \$(RM) Makefile config.status +EOF +default_target maintainer-clean distclean </dev/null +default_target install-strip <<EOF + \$(MAKE) INSTALL_PROGRAM='\$(INSTALL_PROGRAM) -s' \\ + INSTALL_SCRIPT='\$(INSTALL_SCRIPT)' install +EOF + +mesondiropts="" +for dr in $standard_dirs; do + if [ $dr = "srcdir" ]; then + continue + fi + if [ $dr = "mesonbuilddir" ]; then + continue + fi + eval "vn=\${var_$dr}" + if [ ! -z $vn ]; then + eval "mesondiropts=\"$mesondiropts -D$dr=\${var_$dr}\"" + fi +done + +${MESON} setup \ + -Ddefault_library=shared \ + $mesondiropts \ + $mesonfeatopts \ + ${var_mesonbuilddir:-build} \ + ${var_srcdir} + +# Done +echo "Package $pkg_name configured successfully." +echo "Run 'make' to build and 'make install' to install the package" + diff --git a/configure.ac b/configure.ac @@ -1,575 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. -# -# This file is part of TALER -# Copyright (C) 2014-2025 Taler Systems SA -# -# TALER 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. -# -# TALER 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 -# TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/license> -# -# -AC_PREREQ([2.69]) -AC_INIT([taler-exchange],[1.5.6],[taler-bug@gnunet.org]) -AC_CONFIG_AUX_DIR([build-aux]) -AC_CONFIG_SRCDIR([src/util/util.c]) -AC_CONFIG_HEADERS([taler_config.h]) -AC_CANONICAL_TARGET -AC_CANONICAL_HOST -AC_CANONICAL_BUILD -# support for non-recursive builds -AM_INIT_AUTOMAKE([subdir-objects 1.9 tar-pax]) - -# pretty build rules -AM_SILENT_RULES([yes]) - -AC_CONFIG_MACRO_DIR([m4]) -AC_PROG_AWK -AC_PROG_CC -AC_PROG_OBJC -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET -AM_PROG_CC_C_O - -LT_INIT([disable-static dlopen]) - -DX_INIT_DOXYGEN([taler-exchange],,, - DX_PS_FEATURE(OFF), - DX_PDF_FEATURE(OFF), - DX_RTF_FEATURE(OFF), - DX_CHI_FEATURE(OFF), - DX_XML_FEATURE(OFF)) - -AC_MSG_CHECKING([whether to compile documentation ONLY]) -AC_ARG_ENABLE([only-doc], - [AS_HELP_STRING([--enable-only-doc], [only compile Taler documentation])], - [doc_only=${enableval}], - [doc_only=no]) -AC_MSG_RESULT($doc_only) -AM_CONDITIONAL([DOC_ONLY], [test "x$doc_only" = "xyes"]) - -AC_CHECK_PROG([DPKG_ARCH], [dpkg-architecture], [yes], [no]) -if test "x$DPKG_ARCH" = "xyes"; then - MULTIARCH=`dpkg-architecture -qDEB_HOST_MULTIARCH` -else - MULTIARCH="" -fi - -# Not indented, as most of the file falls under this one... -AS_IF([test "x$doc_only" != xyes],[ - -# Force some CFLAGS -CFLAGS="-Wall -Wno-address-of-packed-member $CFLAGS" - -TALER_LIB_LDFLAGS="-export-dynamic -no-undefined" -TALER_PLUGIN_LDFLAGS="-export-dynamic -avoid-version -module -no-undefined" - -AC_SUBST(TALER_LIB_LDFLAGS) -AC_SUBST(TALER_PLUGIN_LDFLAGS) - - -# Checks for header files. -AC_CHECK_HEADERS([stdint.h stdlib.h string.h unistd.h sys/socket.h sys/un.h netinet/in.h netinet/ip.h]) - -AX_PYTHON_MODULE([jinja2],true) - - -# Require minimum libgcrypt version -need_libgcrypt_version=1.6.1 -AC_DEFINE_UNQUOTED([NEED_LIBGCRYPT_VERSION], ["$need_libgcrypt_version"], - [minimum version of libgcrypt required]) -AM_PATH_LIBGCRYPT([$need_libgcrypt_version]) - - - -# should expensive tests be run? -AC_MSG_CHECKING(whether to run expensive tests) -AC_ARG_ENABLE([expensivetests], - [AS_HELP_STRING([--enable-expensivetests], [enable running expensive testcases])], - [enable_expensive=${enableval}], - [enable_expensive=no]) -AC_MSG_RESULT($enable_expensive) -AM_CONDITIONAL([HAVE_EXPENSIVE_TESTS], [test "x$enable_expensive" = "xyes"]) - - -AC_MSG_CHECKING(whether to enable epoll) -AC_ARG_ENABLE([[epoll]], - [AS_HELP_STRING([[--enable-epoll[=ARG]]], [enable epoll support (yes, no, auto) [auto]])], - [enable_epoll=${enableval}], - [enable_epoll='auto'] - ) -AC_MSG_RESULT($enable_epoll) -AM_CONDITIONAL([MHD_HAVE_EPOLL], [test "x$enable_epoll" = "xyes"]) - -AS_IF([test "$enable_epoll" != "no"], - [AX_HAVE_EPOLL - AS_IF([test "${ax_cv_have_epoll}" = "yes"], - [AC_DEFINE([[EPOLL_SUPPORT]],[[1]],[Define to 1 to enable epoll support]) - enable_epoll='yes'], - [AS_IF([test "$enable_epoll" = "yes"], - AC_MSG_ERROR([[Support for epoll was explicitly requested but cannot be enabled on this platform.]])) - enable_epoll='no'])]) - - -AS_IF([test "x$enable_epoll" = "xyes"], - AC_CACHE_CHECK([for epoll_create1()], - [mhd_cv_have_epoll_create1], [ - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[ -#include <sys/epoll.h> - ]], [[ -int fd; -fd = epoll_create1(EPOLL_CLOEXEC);]])], - [mhd_cv_have_epoll_create1=yes], - [mhd_cv_have_epoll_create1=no])]) - AS_IF([test "x$mhd_cv_have_epoll_create1" = "xyes"],[ - AC_DEFINE([[HAVE_EPOLL_CREATE1]], [[1]], [Define if you have epoll_create1 function.])])) - - -# check for libmicrohttpd -AC_MSG_CHECKING([for microhttpd]) -AC_ARG_WITH([microhttpd], - [AS_HELP_STRING([--with-microhttpd=PFX], [base of microhttpd installation])], - [AC_MSG_RESULT([given as $with_microhttpd])], - [AC_MSG_RESULT([not given]) - with_microhttpd=yes]) -AS_CASE([$with_microhttpd], - [yes], [], - [no], [AC_MSG_ERROR([--with-microhttpd is required])], - [LDFLAGS="-L$with_microhttpd/lib/$MULTIARCH -L$with_microhttpd/lib/ $LDFLAGS" - CPPFLAGS="-I$with_microhttpd/include $CPPFLAGS"]) -MHD_VERSION_AT_LEAST([0.9.71]) - - -# check for libmicrohttpd2 -AC_MSG_CHECKING([for microhttpd2]) -AC_ARG_WITH([microhttpd2], - [AS_HELP_STRING([--with-microhttpd2=PFX], [base of libmicrohttpd2 installation])], - [AC_MSG_RESULT([given as $with_microhttpd2])], - [AC_MSG_RESULT([not given]) - with_microhttpd2=yes]) -AS_CASE([$with_microhttpd2], - [yes],[], - [no],[], - [LDFLAGS="-L$with_microhttpd2/lib/$MULTIARCH -L$with_microhttpd2/lib/ $LDFLAGS" - CPPFLAGS="-I$with_microhttpd2/include $CPPFLAGS"]) -MHD2_VERSION_AT_LEAST([1.99.0]) - - -# check for libjansson (Jansson JSON library) -jansson=0 -AC_MSG_CHECKING([for jansson]) -AC_ARG_WITH([jansson], - [AS_HELP_STRING([--with-jansson=PFX], [base of jansson installation])], - [AC_MSG_RESULT([given as $with_jansson])], - [AC_MSG_RESULT([not given]) - with_jansson=yes]) -AS_CASE([$with_jansson], - [yes], [], - [no], [AC_MSG_ERROR([--with-jansson is required])], - [LDFLAGS="-L$with_jansson/lib/$MULTIARCH -L$with_jansson/lib/ $LDFLAGS" - CPPFLAGS="-I$with_jansson/include $CPPFLAGS"]) -AC_CHECK_LIB(jansson,json_dumpb, - [AC_CHECK_HEADER([jansson.h],[jansson=1])]) -AS_IF([test $jansson = 0], - [AC_MSG_ERROR([[ -*** -*** You need libjansson >= 2.10 to build this program. -*** ]])]) - - -# Check for GNUnet's libgnunetutil. -libgnunetutil=0 -AC_MSG_CHECKING([for libgnunetutil]) -AC_ARG_WITH(gnunet, - [AS_HELP_STRING([--with-gnunet=PFX], [base of GNUnet installation])], - [AC_MSG_RESULT([given as $with_gnunet])], - [AC_MSG_RESULT(not given) - with_gnunet=yes]) -AS_CASE([$with_gnunet], - [yes], [], - [no], [AC_MSG_ERROR([--with-gnunet is required])], - [LDFLAGS="-L$with_gnunet/lib/$MULTIARCH -L$with_gnunet/lib/ $LDFLAGS" - CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"]) -AC_CHECK_HEADERS([gnunet/gnunet_util_lib.h], - [AC_CHECK_LIB([gnunetutil], [GNUNET_SCHEDULER_run], libgnunetutil=1)]) -AS_IF([test $libgnunetutil != 1], - [AC_MSG_ERROR([[ -*** -*** You need libgnunetutil >= 0.23.3 to build this program. -*** This library is part of GNUnet, available at -*** https://gnunet.org -*** ]])]) - - -# Check for GNUnet's libgnunetmhd. -libgnunetmhd=0 -AC_MSG_CHECKING([for libgnunetmhd]) -AC_ARG_WITH(gnunet, - [AS_HELP_STRING([--with-gnunet=PFX], [base of GNUnet installation])], - [AC_MSG_RESULT([given as $with_gnunet])], - [AC_MSG_RESULT(not given) - with_gnunet=yes]) -AS_CASE([$with_gnunet], - [yes], [], - [no], [AC_MSG_ERROR([--with-gnunet is required])], - [LDFLAGS="-L$with_gnunet/lib/$MULTIARCH -L$with_gnunet/lib/ $LDFLAGS" - CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"]) -AC_CHECK_HEADERS([gnunet/gnunet_mhd_lib.h], - [AC_CHECK_LIB([gnunetmhd], [GNUNET_MHD_post_parser], [libgnunetmhd=1])]) -AS_IF([test $libgnunetmhd != 1], - [AC_MSG_ERROR([[ -*** -*** You need GNUnet >= 0.23.3 to build this program. -*** You need libgnunetmhd to build this program. -*** Make sure you have libmicrohttpd and libjansson -*** installed while building GNUnet. -*** ]])]) - -# check for gettext -AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION([0.19.8]) - - -# Save before checking libcurl -CFLAGS_SAVE=$CFLAGS -LDFLAGS_SAVE=$LDFLAGS -LIBS_SAVE=$LIBS - -# check for libcurl -LIBCURL_CHECK_CONFIG(,7.34.0,[curl=1],[curl=0]) - -# cURL must support CURLINFO_TLS_SESSION, version >= 7.34 -AS_IF([test "x$curl" = x1],[ - AC_CHECK_HEADER([curl/curl.h], - [AC_CHECK_DECLS(CURLINFO_TLS_SESSION,[curl=1],[curl=0],[[#include <curl/curl.h>]])], - [curl=0]) -]) - -# libcurl should be mutually exclusive -AS_IF([test "$curl" = 1], - AM_CONDITIONAL(HAVE_LIBCURL, true) - AC_DEFINE([HAVE_LIBCURL],[1],[Have libcurl]) - [LIBCURL_LIBS="-lcurl"], - [AC_MSG_ERROR([FATAL: No libcurl])]) - -AC_SUBST([LIBCURL_LIBS]) - -# Check for GNUnet's libgnunetcurl. -libgnunetcurl=0 -AC_MSG_CHECKING([for libgnunetcurl]) -AC_ARG_WITH(gnunet, - [AS_HELP_STRING([--with-gnunet=PFX], [base of GNUnet installation])], - [AC_MSG_RESULT([given as $with_gnunet])], - [AC_MSG_RESULT(not given) - with_gnunet=yes]) -AS_CASE([$with_gnunet], - [yes], [], - [no], [AC_MSG_ERROR([--with-gnunet is required])], - [LDFLAGS="-L$with_gnunet/lib/$MULTIARCH -L$with_gnunet/lib/ $LDFLAGS" - CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"]) -AC_CHECK_HEADERS([gnunet/gnunet_curl_lib.h], - [AC_CHECK_LIB([gnunetcurl], [GNUNET_CURL_get_select_info], libgnunetcurl=1)]) -AS_IF([test $libgnunetcurl != 1], - [AC_MSG_ERROR([[ -*** -*** You need libgnunetcurl to build this program. -*** Make sure you have libcurl installed while -*** building GNUnet. -*** ]])]) - - -# Restore after curl checks messed up these values -CFLAGS=$CFLAGS_SAVE -LDFLAGS=$LDFLAGS_SAVE -LIBS=$LIBS_SAVE - -# test for postgres -AX_LIB_POSTGRESQL([15.0]) -AS_IF([test "x$found_postgresql" = "xyes"], - [SAVE_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$POSTGRES_CPPFLAGS $CPPFLAGS" - AC_CHECK_HEADERS([libpq-fe.h], [postgres=1], [postgres=0])]) -AS_IF([test "x$postgres" != "x1"], - [AC_MSG_ERROR([[ -*** -*** You need libpq(-dev) >= 15.0 to build this program. -*** ]])]) -AM_CONDITIONAL([HAVE_POSTGRESQL], [test "x$postgres" = "x1"]) -AC_DEFINE_UNQUOTED([HAVE_POSTGRESQL], [$postgres], - [Define to 1 if Postgres is available]) - -# Check for GNUnet's libgnunetpq. -libgnunetpq=0 -AC_MSG_CHECKING([for libgnunetpq]) -AC_ARG_WITH(gnunet, - [AS_HELP_STRING([--with-gnunet=PFX], [base of GNUnet installation])], - [AC_MSG_RESULT([given as $with_gnunet])], - [AC_MSG_RESULT(not given) - with_gnunet=yes]) -AS_CASE([$with_gnunet], - [yes], [], - [no], [AC_MSG_ERROR([--with-gnunet is required])], - [LDFLAGS="-L$with_gnunet/lib/$MULTIARCH -L$with_gnunet/lib/ $LDFLAGS" - CPPFLAGS="-I$with_gnunet/include ${CPPFLAGS}"]) -CPPFLAGS="${CPPFLAGS} ${POSTGRESQL_CPPFLAGS}" -AC_CHECK_HEADERS([gnunet/gnunet_pq_lib.h], - [AC_CHECK_LIB([gnunetpq], [GNUNET_PQ_result_spec_blinded_sig], libgnunetpq=1)]) -AS_IF([test $libgnunetpq != 1], - [AC_MSG_ERROR([[ -*** -*** You need libgnunetpq version >= 8:0:3 to build this program. -*** Make sure you have Postgres installed while -*** building GNUnet (and that your GNUnet version is recent!) -*** ]])]) - -CFLAGS_SAVE=$CFLAGS -LDFLAGS_SAVE=$LDFLAGS -LIBS_SAVE="$LIBS" - -# Check for GNUnet's libgnunetsq -libgnunetsq=0 -AC_MSG_CHECKING([for libgnunetsq]) -AC_CHECK_HEADERS([gnunet/gnunet_sq_lib.h], - [AC_CHECK_LIB([gnunetsq], [GNUNET_SQ_result_spec_string], libgnunetsq=1)]) - - - -CFLAGS=$CFLAGS_SAVE -LDFLAGS=$LDFLAGS_SAVE -LIBS=$LIBS_SAVE - -# test for sqlite -sqlite=false -AC_MSG_CHECKING(for SQLite) -AC_ARG_WITH(sqlite, - [ --with-sqlite=PFX base of SQLite installation], - [AC_MSG_RESULT("$with_sqlite") - AS_CASE([$with_sqlite], - [no],[], - [yes],[ - AC_CHECK_HEADERS(sqlite3.h, - sqlite=true)], - [ - LDFLAGS="-L$with_sqlite/lib/$MULTIARCH -L$with_sqlite/lib/ $LDFLAGS" - CPPFLAGS="-I$with_sqlite/include $CPPFLAGS" - AC_CHECK_HEADERS(sqlite3.h, - EXT_LIB_PATH="-L$with_sqlite/lib/$MULTIARCH -L$with_sqlite/lib/ $EXT_LIB_PATH" - SQLITE_LDFLAGS="-L$with_sqlite/lib/$MULTIARCH -L$with_sqlite/lib/" - SQLITE_CPPFLAGS="-I$with_sqlite/include" - sqlite=true) - LDFLAGS=$SAVE_LDFLAGS - CPPFLAGS=$SAVE_CPPFLAGS - ]) - ], - [AC_MSG_RESULT([--with-sqlite not specified]) - AC_CHECK_HEADERS(sqlite3.h, sqlite=true)]) -AM_CONDITIONAL(HAVE_SQLITE, [test x$sqlite = xtrue] && [test $libgnunetsq = 1]) -AC_SUBST(SQLITE_CPPFLAGS) -AC_SUBST(SQLITE_LDFLAGS) - -# check for libtalertwistertesting -talertwister=0 -AC_MSG_CHECKING([for talertwister]) -AC_ARG_WITH([twister], - [AS_HELP_STRING([--with-twister=PFX], [base of libtalertwister])], - [AC_MSG_RESULT([given as $with_twister])], - [AC_MSG_RESULT([not given]) - with_twister=yes]) -AS_CASE([$with_twister], - [yes], [], - [no], [AC_MSG_WARN([no twister-testing will be compiled])], - [LDFLAGS="-L$with_twister/lib/$MULTIARCH -L$with_twister/lib/ $LDFLAGS" - CPPFLAGS="-I$with_twister/include $CPPFLAGS"]) - -AC_CHECK_HEADERS([taler/taler_twister_service.h], - [AC_CHECK_LIB([talertwister], [TALER_TWISTER_connect], talertwister=1)]) -AM_CONDITIONAL(HAVE_TWISTER, test x$talertwister = x1) - -# should developer logic be compiled (not-for-production code)? -AC_MSG_CHECKING(whether to compile developer logic) -AC_ARG_ENABLE([developer-mode], - [AS_HELP_STRING([--enable-developer-mode], [enable compiling developer code])], - [enable_developer=${enableval}], - [enable_developer=yes]) -AC_MSG_RESULT($enable_developer) -AM_CONDITIONAL([HAVE_DEVELOPER], [test "x$enable_developer" = "xyes"]) -enable_dev=1 -AS_IF([test "x$enableval" = "xno"], [enable_dev=0]) -# developer-logic requires a more recent MHD than usual. -AC_CHECK_DECL([MHD_OPTION_NOTIFY_CONNECTION],,[enable_dev=0],[[#include <microhttpd.h>]]) -AC_DEFINE_UNQUOTED([HAVE_DEVELOPER],[$enable_dev],[1 if developer logic is enabled, 0 otherwise]) - -AC_PATH_PROG([JQ], [jq], [no]) -if test "$JQ" = "no"; then - AC_MSG_ERROR([jq is required but not found. Please install jq.]) -fi - - - -# Adam shostack suggests the following for Windows: -# -D_FORTIFY_SOURCE=2 -fstack-protector-all -AC_ARG_ENABLE(gcc-hardening, - AS_HELP_STRING(--enable-gcc-hardening, enable compiler security checks), -[AS_IF([test x$enableval = xyes],[ - CFLAGS="$CFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all" - CFLAGS="$CFLAGS -fwrapv -fPIE -Wstack-protector" - CFLAGS="$CFLAGS --param ssp-buffer-size=1" - LDFLAGS="$LDFLAGS -pie"])]) - - -# Linker hardening options -# Currently these options are ELF specific - you can't use this with MacOSX -AC_ARG_ENABLE(linker-hardening, - AS_HELP_STRING(--enable-linker-hardening, enable linker security fixups), - [AS_IF([test x$enableval = xyes],[LDFLAGS="$LDFLAGS -z relro -z now"])]) - - -AC_ARG_ENABLE(sanitizer, - AS_HELP_STRING(--enable-sanitizer, enable Address Sanitizer and Undefined Behavior Sanitizer), -[AS_IF([test x$enableval = xyes],[ - LDFLAGS="$CFLAGS -fsanitize=address,undefined -fno-omit-frame-pointer" - ])]) - -# logging -extra_logging=0 -AC_ARG_ENABLE([logging], - AS_HELP_STRING([--enable-logging@<:@=value@:>@],[Enable logging calls. Possible values: yes,no,verbose ('yes' is the default)]), - [AS_IF([test "x$enableval" = "xyes"], [], - [test "x$enableval" = "xno"], [AC_DEFINE([GNUNET_CULL_LOGGING],[],[Define to cull all logging calls])], - [test "x$enableval" = "xverbose"], [extra_logging=1] - [test "x$enableval" = "xveryverbose"], [extra_logging=2]) - ], []) -AC_DEFINE_UNQUOTED([GNUNET_EXTRA_LOGGING],[$extra_logging],[1 if extra logging is enabled, 2 for very verbose extra logging, 0 otherwise]) - -# gcov compilation -AC_MSG_CHECKING(whether to compile with support for code coverage analysis) -AC_ARG_ENABLE([coverage], - AS_HELP_STRING([--enable-coverage], - [compile the library with code coverage support]), - [use_gcov=${enableval}], - [use_gcov=no]) -AC_MSG_RESULT($use_gcov) -AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"]) - -# version info -AC_PATH_PROG(gitcommand, git) -AC_MSG_CHECKING(for source being under a VCS) -git_version= -AS_IF([test ! "X$gitcommand" = "X"], -[ - git_version=$(cd $srcdir ; git rev-list -n 1 --abbrev-commit HEAD 2>/dev/null) -]) -AS_IF([test "X$git_version" = "X"], - [ - vcs_name="no" - vcs_version="\"release\"" - ], - [ - vcs_name="yes, git-svn" - vcs_version="\"git-$git_version\"" - ]) -AC_MSG_RESULT($vcs_name) - -AC_MSG_CHECKING(VCS version) -AC_MSG_RESULT($vcs_version) -AC_DEFINE_UNQUOTED(VCS_VERSION, [$vcs_version], [VCS revision/hash or tarball version]) - - -# Checks for typedefs, structures, and compiler characteristics. -AC_TYPE_PID_T -AC_TYPE_SIZE_T -AC_TYPE_UINT16_T -AC_TYPE_UINT32_T -AC_TYPE_UINT64_T -AC_TYPE_INTMAX_T -AC_TYPE_UINTMAX_T - -# Checks for library functions. -AC_CHECK_FUNCS([strdup]) - - -AC_ARG_ENABLE([[doc]], - [AS_HELP_STRING([[--disable-doc]], [do not build any documentation])], , - [enable_doc=yes]) -test "x$enable_doc" = "xno" || enable_doc=yes -AM_CONDITIONAL([ENABLE_DOC], [test "x$enable_doc" = "xyes"]) - -],[ # This is the big test "$doc_only" on top of the file! - -AM_CONDITIONAL([HAVE_MHD2], [false]) -# logic if doc_only is set, make sure conditionals are still defined -AM_CONDITIONAL([HAVE_EXPENSIVE_TESTS], [false]) -AM_CONDITIONAL([MHD_HAVE_EPOLL], [false]) -AM_CONDITIONAL([HAVE_POSTGRESQL], [false]) -AM_CONDITIONAL([HAVE_SQLITE], [false]) -AM_CONDITIONAL([HAVE_LIBCURL], [false]) -AM_CONDITIONAL([HAVE_DEVELOPER], [false]) -AM_CONDITIONAL([USE_COVERAGE], [false]) -AM_CONDITIONAL([ENABLE_DOC], [true]) -AM_CONDITIONAL([HAVE_TWISTER], [false]) - -# end of 'doc_only' -]) - -AC_CONFIG_FILES([Makefile - contrib/Makefile - contrib/typst/Makefile - contrib/typst/_cover_/Makefile - contrib/typst/common/Makefile - contrib/typst/accept-tos/Makefile - contrib/typst/challenger-postal/Makefile - contrib/typst/challenger-sms/Makefile - contrib/typst/generic_note/Makefile - contrib/typst/generic_upload/Makefile - contrib/typst/vqf_902_1/Makefile - contrib/typst/vqf_902_1_customer/Makefile - contrib/typst/vqf_902_1_officer/Makefile - contrib/typst/vqf_902_4/Makefile - contrib/typst/vqf_902_5/Makefile - contrib/typst/vqf_902_9/Makefile - contrib/typst/vqf_902_9_customer/Makefile - contrib/typst/vqf_902_9_officer/Makefile - contrib/typst/vqf_902_11/Makefile - contrib/typst/vqf_902_11_customer/Makefile - contrib/typst/vqf_902_11_officer/Makefile - contrib/typst/vqf_902_12/Makefile - contrib/typst/vqf_902_13/Makefile - contrib/typst/vqf_902_14/Makefile - contrib/typst/vqf_902_15/Makefile - doc/Makefile - doc/doxygen/Makefile - po/Makefile.in - src/Makefile - src/auditor/Makefile - src/auditordb/Makefile - src/bank-lib/Makefile - src/curl/Makefile - src/exchange/Makefile - src/exchangedb/Makefile - src/exchange-tools/Makefile - src/extensions/Makefile - src/extensions/age_restriction/Makefile - src/lib/Makefile - src/kyclogic/Makefile - src/testing/Makefile - src/benchmark/Makefile - src/include/Makefile - src/include/taler/Makefile - src/include/taler/taler-exchange/Makefile - src/json/Makefile - src/mhd/Makefile - src/pq/Makefile - src/sq/Makefile - src/templating/Makefile - src/util/Makefile - ]) -AC_OUTPUT diff --git a/contrib/Makefile.am.in b/contrib/Makefile.am.in @@ -1,72 +0,0 @@ -# This file is in the public domain. - -SUBDIRS = . typst - -tmplpkgdatadir = $(datadir)/taler-exchange/templates/ -dist_tmplpkgdata_DATA = \ - kycaid-invalid-request.en.must \ - kyc-proof-already-done.en.must \ - kyc-proof-bad-request.en.must \ - kyc-proof-endpoint-unknown.en.must \ - kyc-proof-internal-error.en.must \ - kyc-proof-target-unknown.en.must \ - oauth2-authentication-failure.en.must \ - oauth2-authorization-failure.en.must \ - oauth2-authorization-failure-malformed.en.must \ - oauth2-bad-request.en.must \ - oauth2-conversion-failure.en.must \ - oauth2-provider-failure.en.must \ - persona-exchange-unauthorized.en.must \ - persona-load-failure.en.must \ - persona-exchange-unpaid.en.must \ - persona-logic-failure.en.must \ - persona-invalid-response.en.must \ - persona-network-timeout.en.must \ - persona-kyc-failed.en.must \ - persona-provider-failure.en.must - -termsdir=$(datadir)/taler-exchange/terms/ -terms_DATA = \ - exchange-pp-v0.de.rst \ - exchange-pp-v0.en.rst \ - exchange-pp-v0.fr.rst \ - exchange-tos-bfh-v0.en.rst \ - exchange-tos-netzbon-v0.de.rst \ - exchange-tos-netzbon-v0.fr.rst \ - exchange-tos-tops-v0.de.rst \ - exchange-tos-tops-v0.en.rst \ - exchange-tos-tops-v0.fr.rst \ - exchange-tos-v0.en.rst - -bin_SCRIPTS = \ - taler-auditor-dbconfig \ - taler-exchange-dbconfig \ - taler-terms-generator - - -EXTRA_DIST = \ - $(bin_SCRIPTS) \ - aml-spa.lock \ - auditor-spa.lock \ - kyc-spa.lock \ - check-prebuilt \ - gana-generate.sh \ - gana/gnu-taler-error-codes/registry.rec \ - gana/gnu-taler-error-codes/Makefile \ - $(terms_DATA) \ - $(rdata_DATA) \ - coverage.sh \ - gnunet.tag \ - microhttpd.tag \ - packages - -# These are for the various single-page-apps -# imported from the wallet-core.git -# prebuilt branch. These MUST be present, they will -# be used by code generated by 'bootstrap'! - -amlspapkgdatadir = $(prefix)/share/taler-exchange/aml-spa/ - -auditorspapkgdatadir = $(prefix)/share/taler-auditor/spa/ - -kycspapkgdatadir = $(prefix)/share/taler-exchange/kyc-spa/ diff --git a/contrib/ci/Containerfile b/contrib/ci/Containerfile @@ -5,7 +5,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -yqq && \ apt-get install -yqq \ - autoconf \ + meson \ autopoint \ curl \ bash \ diff --git a/contrib/ci/jobs/000-codespell/job.sh b/contrib/ci/jobs/000-codespell/job.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -exuo pipefail job_dir=$(dirname "${BASH_SOURCE[0]}") diff --git a/contrib/ci/jobs/002-test/1-build.sh b/contrib/ci/jobs/002-test/1-build.sh @@ -13,9 +13,10 @@ apt-get upgrade -yqq nump=$(grep processor /proc/cpuinfo | wc -l) make clean make -j$(( $nump / 2 )) -cd src/templating/ -./run-original-tests.sh -make clean -cd - -make -j$(( $nump / 2 )) +# FIXME disabled during meson transition +#cd src/templating/ +#./run-original-tests.sh +#make clean +#cd - +#make -j$(( $nump / 2 )) diff --git a/contrib/ci/jobs/002-test/4-test.sh b/contrib/ci/jobs/002-test/4-test.sh @@ -19,15 +19,10 @@ check_command() print_logs() { set +e - for i in src/*/test-suite.log + for i in build/meson-logs/testlog.txt do echo "Printing ${i}" cat "$i" - for FAILURE in $(grep '^FAIL:' ${i} | cut -d' ' -f2) - do - echo "Printing $(dirname $i)/${FAILURE}.log" - cat "$(dirname $i)/${FAILURE}.log" - done done } diff --git a/contrib/ci/jobs/100-build-debian-trixie-amd64-gen/Containerfile b/contrib/ci/jobs/100-build-debian-trixie-amd64-gen/Containerfile @@ -4,7 +4,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -yqq && \ apt-get install -yqq \ - autoconf \ + meson \ autopoint \ curl \ bash \ diff --git a/contrib/ci/jobs/101-deb-package-debian-trixie-amd64-gen/Containerfile b/contrib/ci/jobs/101-deb-package-debian-trixie-amd64-gen/Containerfile @@ -4,7 +4,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -yqq && \ apt-get install -yqq \ - autoconf \ + meson \ autopoint \ curl \ bash \ diff --git a/contrib/ci/targets/debian/build/build.sh b/contrib/ci/targets/debian/build/build.sh @@ -4,12 +4,18 @@ set -exuo pipefail apt-get update apt-get upgrade -yqq -./bootstrap -./configure CFLAGS="-ggdb -O0" \ - --enable-logging=verbose \ - --enable-converage \ - --disable-doc - -nump=$(grep processor /proc/cpuinfo | wc -l) -make -j$(( $nump / 2 )) -make +build_command() { + ./bootstrap + ./configure CFLAGS="-ggdb -O0" \ + --enable-logging=verbose \ + --enable-converage \ + --disable-doc + + nump=$(grep processor /proc/cpuinfo | wc -l) + make -j$(( $nump / 2 )) +} + +if ! build_command; then + cat build/meson-logs/meson-log.txt + exit 1 +fi diff --git a/contrib/meson.build b/contrib/meson.build @@ -0,0 +1,129 @@ +# This file is in the public domain. + +subdir('typst') + +contrib_tmplpkgdata_DATA = [ + 'kycaid-invalid-request.en.must', + 'kyc-proof-already-done.en.must', + 'kyc-proof-bad-request.en.must', + 'kyc-proof-endpoint-unknown.en.must', + 'kyc-proof-internal-error.en.must', + 'kyc-proof-target-unknown.en.must', + 'oauth2-authentication-failure.en.must', + 'oauth2-authorization-failure.en.must', + 'oauth2-authorization-failure-malformed.en.must', + 'oauth2-bad-request.en.must', + 'oauth2-conversion-failure.en.must', + 'oauth2-provider-failure.en.must', + 'persona-exchange-unauthorized.en.must', + 'persona-load-failure.en.must', + 'persona-exchange-unpaid.en.must', + 'persona-logic-failure.en.must', + 'persona-invalid-response.en.must', + 'persona-network-timeout.en.must', + 'persona-kyc-failed.en.must', + 'persona-provider-failure.en.must', +] + +install_data( + sources: contrib_tmplpkgdata_DATA, + install_dir: get_option('datadir') / 'taler-exchange' / 'templates', +) + + +contrib_terms_DATA = [ + 'exchange-pp-v0.de.rst', + 'exchange-pp-v0.en.rst', + 'exchange-pp-v0.fr.rst', + 'exchange-tos-bfh-v0.en.rst', + 'exchange-tos-netzbon-v0.de.rst', + 'exchange-tos-netzbon-v0.fr.rst', + 'exchange-tos-tops-v0.de.rst', + 'exchange-tos-tops-v0.en.rst', + 'exchange-tos-tops-v0.fr.rst', + 'exchange-tos-v0.en.rst', +] + +install_data( + sources: contrib_terms_DATA, + install_dir: get_option('datadir') / 'taler-exchange' / 'terms', +) + +contrib_bin_SCRIPTS = [ + 'taler-auditor-dbconfig', + 'taler-exchange-dbconfig', + 'taler-terms-generator', +] + +foreach f : contrib_bin_SCRIPTS + configure_file( + input: f, + output: f, + configuration: cdata, + install: true, + install_dir: get_option('bindir'), + ) +endforeach + + + +# These are for the various single-page-apps +# imported from the wallet-core.git +# prebuilt branch. These MUST be present, they will +# be used by code generated by 'bootstrap'! + +dist_amlspapkgdata_DATA = [ + 'wallet-core/aml-backoffice/bof', + 'wallet-core/aml-backoffice/build-metadata.json', + 'wallet-core/aml-backoffice/forms.json', + 'wallet-core/aml-backoffice/index.css', + 'wallet-core/aml-backoffice/index.css.map', + 'wallet-core/aml-backoffice/index.html', + 'wallet-core/aml-backoffice/index.js', + 'wallet-core/aml-backoffice/index.js.map', + 'wallet-core/aml-backoffice/version.txt', +] +install_data( + sources: dist_amlspapkgdata_DATA, + install_dir: get_option('datadir') / 'taler-exchange' / 'aml-spa', +) + +dist_kycspapkgdata_DATA = [ + 'wallet-core/kyc/bof', + 'wallet-core/kyc/build-metadata.json', + 'wallet-core/kyc/forms.json', + 'wallet-core/kyc/index.css', + 'wallet-core/kyc/index.css.map', + 'wallet-core/kyc/index.html', + 'wallet-core/kyc/index.js', + 'wallet-core/kyc/index.js.map', + 'wallet-core/kyc/version.txt', +] +install_data( + sources: dist_kycspapkgdata_DATA, + install_dir: get_option('datadir') / 'taler-exchange' / 'kyc-spa', +) + +dist_auditorspapkgdata_DATA = [ + 'wallet-core/auditor-backoffice/bof', + 'wallet-core/auditor-backoffice/build-metadata.json', + 'wallet-core/auditor-backoffice/index.css', + 'wallet-core/auditor-backoffice/index.css.map', + 'wallet-core/auditor-backoffice/index.html', + 'wallet-core/auditor-backoffice/index.js', + 'wallet-core/auditor-backoffice/index.js.map', + 'wallet-core/auditor-backoffice/languageicon-LWKRUH5D.svg', + 'wallet-core/auditor-backoffice/logo-2021-VSZSJ4QZ.svg', + 'wallet-core/auditor-backoffice/materialdesignicons-webfont-4.9.95-7W2GKO6O.woff2', + 'wallet-core/auditor-backoffice/materialdesignicons-webfont-4.9.95-GELXKCZG.ttf', + 'wallet-core/auditor-backoffice/materialdesignicons-webfont-4.9.95-HENMUVWG.eot', + 'wallet-core/auditor-backoffice/materialdesignicons-webfont-4.9.95-WP2MXZKI.woff', + 'wallet-core/auditor-backoffice/version.txt', + 'wallet-core/auditor-backoffice/XRXV3I6Li01BKofINeaE-34D53UZZ.ttf', +] +install_data( + sources: dist_auditorspapkgdata_DATA, + install_dir: get_option('datadir') / 'taler-auditor' / 'spa', +) + + diff --git a/contrib/typst/Makefile.am b/contrib/typst/Makefile.am @@ -1,23 +0,0 @@ -SUBDIRS = . \ - _cover_ \ - common \ - accept-tos \ - challenger-postal \ - challenger-sms \ - generic_note \ - generic_upload \ - vqf_902_1 \ - vqf_902_1_customer \ - vqf_902_1_officer \ - vqf_902_4 \ - vqf_902_5 \ - vqf_902_9 \ - vqf_902_9_customer \ - vqf_902_9_officer \ - vqf_902_11 \ - vqf_902_11_customer \ - vqf_902_11_officer \ - vqf_902_12 \ - vqf_902_13 \ - vqf_902_14 \ - vqf_902_15 diff --git a/contrib/typst/_cover_/Makefile.am b/contrib/typst/_cover_/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/_cover_/0.0.0/ -typstpackage_DATA = \ - _cover_.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/accept-tos/Makefile.am b/contrib/typst/accept-tos/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/accept-tos/0.0.0/ -typstpackage_DATA = \ - accept-tos.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/challenger-postal/Makefile.am b/contrib/typst/challenger-postal/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/challenger-postal/0.0.0/ -typstpackage_DATA = \ - challenger-postal.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/challenger-sms/Makefile.am b/contrib/typst/challenger-sms/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/challenger-sms/0.0.0/ -typstpackage_DATA = \ - challenger-sms.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/common/Makefile.am b/contrib/typst/common/Makefile.am @@ -1,12 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/common/0.0.0/ -typstpackage_DATA = \ - lib.typ \ - pointing_finger.svg \ - taler-logo.svg \ - typst.toml \ - vss_vqf_verein.png - -EXTRA_DIST = \ - $(typstpackage_DATA) diff --git a/contrib/typst/common/meson.build b/contrib/typst/common/meson.build @@ -0,0 +1,8 @@ +install_data( + 'lib.typ', + 'pointing_finger.svg', + 'taler-logo.svg', + 'typst.toml', + 'vss_vqf_verein.png', + install_dir: get_option('datadir') / 'taler-exchange' / 'typst' / 'packages' / 'taler-exchange' / 'common' / '0.0.0', +) diff --git a/contrib/typst/generic_note/Makefile.am b/contrib/typst/generic_note/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/generic_note/0.0.0/ -typstpackage_DATA = \ - generic_note.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/generic_upload/Makefile.am b/contrib/typst/generic_upload/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/generic_upload/0.0.0/ -typstpackage_DATA = \ - generic_upload.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/meson.build b/contrib/typst/meson.build @@ -0,0 +1,33 @@ +typst_folders = [ + '_cover_', + 'accept-tos', + 'challenger-postal', + 'challenger-sms', + 'generic_note', + 'generic_upload', + 'vqf_902_1', + 'vqf_902_1_customer', + 'vqf_902_1_officer', + 'vqf_902_4', + 'vqf_902_5', + 'vqf_902_9', + 'vqf_902_9_customer', + 'vqf_902_9_officer', + 'vqf_902_11', + 'vqf_902_11_customer', + 'vqf_902_11_officer', + 'vqf_902_12', + 'vqf_902_13', + 'vqf_902_14', + 'vqf_902_15', +] + +foreach f : typst_folders + install_data( + f / '@0@.typ'.format(f), + f / 'typst.toml', + install_dir: get_option('datadir') / 'taler-exchange' / 'typst' / 'packages' / 'taler-exchange' / f / '0.0.0', + ) +endforeach + +subdir('common') diff --git a/contrib/typst/vqf_902_1/Makefile.am b/contrib/typst/vqf_902_1/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_1/0.0.0/ -typstpackage_DATA = \ - vqf_902_1.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/vqf_902_11/Makefile.am b/contrib/typst/vqf_902_11/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_11/0.0.0/ -typstpackage_DATA = \ - vqf_902_11.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/vqf_902_11_customer/Makefile.am b/contrib/typst/vqf_902_11_customer/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_11_customer/0.0.0/ -typstpackage_DATA = \ - vqf_902_11_customer.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/vqf_902_11_officer/Makefile.am b/contrib/typst/vqf_902_11_officer/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_11_officer/0.0.0/ -typstpackage_DATA = \ - vqf_902_11_officer.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/vqf_902_12/Makefile.am b/contrib/typst/vqf_902_12/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_12/0.0.0/ -typstpackage_DATA = \ - vqf_902_12.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/vqf_902_13/Makefile.am b/contrib/typst/vqf_902_13/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_13/0.0.0/ -typstpackage_DATA = \ - vqf_902_13.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/vqf_902_14/Makefile.am b/contrib/typst/vqf_902_14/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_14/0.0.0/ -typstpackage_DATA = \ - vqf_902_14.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/vqf_902_15/Makefile.am b/contrib/typst/vqf_902_15/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_15/0.0.0/ -typstpackage_DATA = \ - vqf_902_15.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/vqf_902_1_customer/Makefile.am b/contrib/typst/vqf_902_1_customer/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_1_customer/0.0.0/ -typstpackage_DATA = \ - vqf_902_1_customer.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/vqf_902_1_officer/Makefile.am b/contrib/typst/vqf_902_1_officer/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_1_officer/0.0.0/ -typstpackage_DATA = \ - vqf_902_1_officer.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/vqf_902_4/Makefile.am b/contrib/typst/vqf_902_4/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_4/0.0.0/ -typstpackage_DATA = \ - vqf_902_4.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/vqf_902_5/Makefile.am b/contrib/typst/vqf_902_5/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_5/0.0.0/ -typstpackage_DATA = \ - vqf_902_5.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/vqf_902_9/Makefile.am b/contrib/typst/vqf_902_9/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_9/0.0.0/ -typstpackage_DATA = \ - vqf_902_9.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/vqf_902_9_customer/Makefile.am b/contrib/typst/vqf_902_9_customer/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_9_customer/0.0.0/ -typstpackage_DATA = \ - vqf_902_9_customer.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/typst/vqf_902_9_officer/Makefile.am b/contrib/typst/vqf_902_9_officer/Makefile.am @@ -1,10 +0,0 @@ -SUBDIRS = . - -typstpackagedir = $(datadir)/taler-exchange/typst/packages/taler-exchange/vqf_902_9_officer/0.0.0/ -typstpackage_DATA = \ - vqf_902_9_officer.typ \ - typst.toml - -EXTRA_DIST = \ - template/main.typ \ - $(typstpackage_DATA) diff --git a/contrib/uncrustify_precommit b/contrib/uncrustify_precommit @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # use as .git/hooks/pre-commit exec 1>&2 diff --git a/debian/changelog b/debian/changelog @@ -1,3 +1,27 @@ +taler-exchange (1.5.7) UNRELEASED; urgency=medium + + [ Christian Grothoff ] + * fix specification inconsistencies + * fix bug + * fix minor inconsistencies with spec + * fix specification inconsistencies + * fix bug + * fix minor inconsistencies with spec + * fix specification inconsistencies + * fix bug + * fix minor inconsistencies with spec + * fix specification inconsistencies + * fix bug + * fix minor inconsistencies with spec + * fix specification inconsistencies + * fix bug + * fix minor inconsistencies with spec + * fix specification inconsistencies + * fix bug + * fix minor inconsistencies with spec + + -- root <none> Thu, 09 Apr 2026 11:38:58 +0000 + taler-exchange (1.5.6) unstable; urgency=low * Release 1.5.6. diff --git a/debian/libtalerexchange-dev.install b/debian/libtalerexchange-dev.install @@ -15,6 +15,8 @@ usr/share/man/man1/taler-exchange-benchmark* usr/share/man/man1/taler-fakebank-run* usr/share/man/man1/taler-unified-setup* +# Pkgconfig +usr/lib/*/pkgconfig/taler*.pc # Headers usr/include/taler/* diff --git a/debian/rules b/debian/rules @@ -5,14 +5,11 @@ SHELL := sh -e include /usr/share/dpkg/architecture.mk %: - dh ${@} + dh ${@} --buildsystem=meson override_dh_builddeb: dh_builddeb -- -Zgzip -override_dh_auto_configure-arch: - dh_auto_configure -- --disable-rpath --with-microhttpd=yes $(shell dpkg-buildflags --export=configure) - override_dh_auto_configure-indep: override_dh_auto_build-indep: diff --git a/doc/Makefile.am b/doc/Makefile.am @@ -1,67 +0,0 @@ -# This Makefile.am is in the public domain - -SUBDIRS = . doxygen - -AM_MAKEINFOHTMLFLAGS = $(TEXINFO_HTMLFLAGS) - -infoimagedir = $(infodir)/images - -man_MANS = \ - prebuilt/man/taler-aggregator-benchmark.1 \ - prebuilt/man/taler-auditor-config.1 \ - prebuilt/man/taler-auditor-dbinit.1 \ - prebuilt/man/taler-auditor-httpd.1 \ - prebuilt/man/taler-auditor-offline.1 \ - prebuilt/man/taler-auditor-sync.1 \ - prebuilt/man/taler-bank-benchmark.1 \ - prebuilt/man/taler-exchange.conf.5 \ - prebuilt/man/taler-exchange-aggregator.1 \ - prebuilt/man/taler-exchange-benchmark.1 \ - prebuilt/man/taler-exchange-closer.1 \ - prebuilt/man/taler-exchange-config.1 \ - prebuilt/man/taler-exchange-dbconfig.1 \ - prebuilt/man/taler-exchange-dbinit.1 \ - prebuilt/man/taler-exchange-drain.1 \ - prebuilt/man/taler-exchange-expire.1 \ - prebuilt/man/taler-exchange-httpd.1 \ - prebuilt/man/taler-exchange-kyc-aml-pep-trigger.1 \ - prebuilt/man/taler-exchange-kyc-tester.1 \ - prebuilt/man/taler-exchange-kyc-trigger.1 \ - prebuilt/man/taler-exchange-offline.1 \ - prebuilt/man/taler-exchange-router.1 \ - prebuilt/man/taler-exchange-sanctionscheck.1 \ - prebuilt/man/taler-exchange-secmod-cs.1 \ - prebuilt/man/taler-exchange-secmod-eddsa.1 \ - prebuilt/man/taler-exchange-secmod-rsa.1 \ - prebuilt/man/taler-exchange-transfer.1 \ - prebuilt/man/taler-exchange-wire-gateway-client.1 \ - prebuilt/man/taler-exchange-wirewatch.1 \ - prebuilt/man/taler-fakebank-run.1 \ - prebuilt/man/taler-helper-auditor-aggregation.1 \ - prebuilt/man/taler-helper-auditor-coins.1 \ - prebuilt/man/taler-helper-auditor-deposits.1\ - prebuilt/man/taler-helper-auditor-purses.1 \ - prebuilt/man/taler-helper-auditor-reserves.1\ - prebuilt/man/taler-helper-auditor-wire-credit.1 \ - prebuilt/man/taler-helper-auditor-wire-debit.1 \ - prebuilt/man/taler-terms-generator.1 \ - prebuilt/man/taler-unified-setup.1 - -info_TEXINFOS = \ - prebuilt/texinfo/taler-auditor.texi \ - prebuilt/texinfo/taler-developer-manual.texi \ - prebuilt/texinfo/taler-exchange.texi - -install-info-local: - $(MKDIR_P) "$(DESTDIR)$(infodir)/taler-auditor-figures" || exit 1; \ - $(MKDIR_P) "$(DESTDIR)$(infodir)/taler-exchange-figures" || exit 1; \ - $(INSTALL_DATA) '$(srcdir)/prebuilt/texinfo/taler-auditor-figures/auditor-db.png' '$(srcdir)/prebuilt/texinfo/taler-auditor-figures/replication.png' "$(DESTDIR)$(infodir)/taler-auditor-figures" || exit 1; - $(INSTALL_DATA) '$(srcdir)/prebuilt/texinfo/taler-exchange-figures/exchange-db.png' "$(DESTDIR)$(infodir)/taler-exchange-figures" || exit 1; - -EXTRA_DIST = \ - $(man_MANS) \ - doxygen/taler.doxy \ - $(info_TEXINFOS) \ - prebuilt/texinfo/taler-auditor-figures/auditor-db.png \ - prebuilt/texinfo/taler-auditor-figures/replication.png \ - prebuilt/texinfo/taler-exchange-figures/exchange-db.png diff --git a/doc/doxygen/Makefile b/doc/doxygen/Makefile @@ -0,0 +1,15 @@ +# This Makefile.am is in the public domain +all: + echo -e \ +"Generate documentation:\n" \ +"\tmake full - full documentation with dependency graphs (slow)\n" \ +"\tmake fast - fast mode without dependency graphs" + +full: taler.doxy + doxygen $< + +fast: taler.doxy + sed 's/\(HAVE_DOT.*=\).*/\1 NO/' $< | doxygen - + +clean: + rm -rf html diff --git a/doc/doxygen/Makefile.am b/doc/doxygen/Makefile.am @@ -1,18 +0,0 @@ -# This Makefile.am is in the public domain -all: - @echo -e \ -"Generate documentation:\n" \ -"\tmake full - full documentation with dependency graphs (slow)\n" \ -"\tmake fast - fast mode without dependency graphs" - -full: taler.doxy - doxygen $< - -fast: taler.doxy - sed 's/\(HAVE_DOT.*=\).*/\1 NO/' $< | doxygen - - -clean: - rm -rf html - -EXTRA_DIST = \ - taler.doxy diff --git a/doc/meson.build b/doc/meson.build @@ -0,0 +1,65 @@ +# This build file is in the public domain +subdir('prebuilt') + +install_man( + [ + 'prebuilt' / 'man' / 'taler-aggregator-benchmark.1', + 'prebuilt' / 'man' / 'taler-auditor-config.1', + 'prebuilt' / 'man' / 'taler-auditor-dbinit.1', + 'prebuilt' / 'man' / 'taler-auditor-httpd.1', + 'prebuilt' / 'man' / 'taler-auditor-offline.1', + 'prebuilt' / 'man' / 'taler-auditor-sync.1', + 'prebuilt' / 'man' / 'taler-bank-benchmark.1', + 'prebuilt' / 'man' / 'taler-exchange.conf.5', + 'prebuilt' / 'man' / 'taler-exchange-aggregator.1', + 'prebuilt' / 'man' / 'taler-exchange-benchmark.1', + 'prebuilt' / 'man' / 'taler-exchange-closer.1', + 'prebuilt' / 'man' / 'taler-exchange-config.1', + 'prebuilt' / 'man' / 'taler-exchange-dbconfig.1', + 'prebuilt' / 'man' / 'taler-exchange-dbinit.1', + 'prebuilt' / 'man' / 'taler-exchange-drain.1', + 'prebuilt' / 'man' / 'taler-exchange-expire.1', + 'prebuilt' / 'man' / 'taler-exchange-httpd.1', + 'prebuilt' / 'man' / 'taler-exchange-kyc-aml-pep-trigger.1', + 'prebuilt' / 'man' / 'taler-exchange-kyc-tester.1', + 'prebuilt' / 'man' / 'taler-exchange-kyc-trigger.1', + 'prebuilt' / 'man' / 'taler-exchange-offline.1', + 'prebuilt' / 'man' / 'taler-exchange-router.1', + 'prebuilt' / 'man' / 'taler-exchange-sanctionscheck.1', + 'prebuilt' / 'man' / 'taler-exchange-secmod-cs.1', + 'prebuilt' / 'man' / 'taler-exchange-secmod-eddsa.1', + 'prebuilt' / 'man' / 'taler-exchange-secmod-rsa.1', + 'prebuilt' / 'man' / 'taler-exchange-transfer.1', + 'prebuilt' / 'man' / 'taler-exchange-wire-gateway-client.1', + 'prebuilt' / 'man' / 'taler-exchange-wirewatch.1', + 'prebuilt' / 'man' / 'taler-fakebank-run.1', + 'prebuilt' / 'man' / 'taler-helper-auditor-aggregation.1', + 'prebuilt' / 'man' / 'taler-helper-auditor-coins.1', + 'prebuilt' / 'man' / 'taler-helper-auditor-deposits.1', + 'prebuilt' / 'man' / 'taler-helper-auditor-purses.1', + 'prebuilt' / 'man' / 'taler-helper-auditor-reserves.1', + 'prebuilt' / 'man' / 'taler-helper-auditor-wire-credit.1', + 'prebuilt' / 'man' / 'taler-helper-auditor-wire-debit.1', + 'prebuilt' / 'man' / 'taler-terms-generator.1', + 'prebuilt' / 'man' / 'taler-unified-setup.1', + ], +) + +install_emptydir(docdir / 'html') + +install_emptydir(get_option('infodir') / 'taler-auditor-figures') + +install_emptydir(get_option('infodir') / 'taler-exchange-figures') + + +install_data( + 'prebuilt' / 'texinfo' / 'taler-auditor-figures' / 'auditor-db.png', + 'prebuilt' / 'texinfo' / 'taler-auditor-figures' / 'replication.png', + install_dir: get_option('infodir') / 'taler-auditor-figures', +) + +install_data( + 'prebuilt' / 'texinfo' / 'taler-exchange-figures' / 'exchange-db.png', + install_dir: get_option('infodir') / 'taler-exchange-figures', +) + diff --git a/flake.lock b/flake.lock @@ -0,0 +1,94 @@ +{ + "nodes": { + "gnunet": { + "inputs": { + "nixpkgs": "nixpkgs", + "systems": "systems" + }, + "locked": { + "lastModified": 1774899416, + "narHash": "sha256-YcGma1gX/t76xDv9DW71nKkWFhzXYz3NkN/WEceHbZM=", + "ref": "refs/heads/master", + "rev": "7c6b613e37e301b0e81fb94af5878d00c98e5b75", + "revCount": 33194, + "submodules": true, + "type": "git", + "url": "https://git.gnunet.org/gnunet" + }, + "original": { + "rev": "7c6b613e37e301b0e81fb94af5878d00c98e5b75", + "type": "git", + "url": "https://git.gnunet.org/gnunet" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1774799055, + "narHash": "sha256-Tsq9BCz0q47ej1uFF39m4tuhcwru/ls6vCCJzutEpaw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "107cba9eb4a8d8c9f8e9e61266d78d340867913a", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "release-25.11", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1774799055, + "narHash": "sha256-Tsq9BCz0q47ej1uFF39m4tuhcwru/ls6vCCJzutEpaw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "107cba9eb4a8d8c9f8e9e61266d78d340867913a", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "release-25.11", + "type": "indirect" + } + }, + "root": { + "inputs": { + "gnunet": "gnunet", + "nixpkgs": "nixpkgs_2", + "systems": "systems_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix @@ -0,0 +1,122 @@ +{ + inputs = { + nixpkgs.url = "nixpkgs/release-25.11"; + systems.url = "github:nix-systems/default"; + gnunet.url = "git+https://git.gnunet.org/gnunet?rev=7c6b613e37e301b0e81fb94af5878d00c98e5b75"; + self.submodules = true; + }; + + outputs = { self, nixpkgs, gnunet, systems, ... } @ inputs: + let + supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; + forEachSystem = nixpkgs.lib.genAttrs supportedSystems; + nixpkgsFor = forEachSystem (system: import nixpkgs { inherit system; }); + in + { + # This defines (installable) package derivations + # For use in flakes that use this flake as input in order + # to specify/use this package from git as a dependency + packages = forEachSystem (system: + let + pkgs = nixpkgsFor.${system}; + gnunetpkgs = gnunet.packages.${system}; + in { + gnunet = pkgs.stdenv.mkDerivation { + name = "exchange"; + src = ./.; + nativeBuildInputs = [ + pkgs.gnumake + pkgs.automake + pkgs.autoconf + pkgs.pkg-config + pkgs.python3 + pkgs.texinfo + ]; + buildInputs = [ + pkgs.libtool + pkgs.jansson + pkgs.git + pkgs.gettext + pkgs.postgresql + (pkgs.python3.withPackages (python-pkgs: [ + python-pkgs.jinja2 + ])) + pkgs.libmicrohttpd + pkgs.libsodium + pkgs.libgcrypt + pkgs.libunistring + pkgs.curlWithGnuTls + pkgs.jq + gnunetpkgs.gnunet + ]; + preConfigure = '' + patchShebangs --build contrib/check-prebuilt + ./bootstrap + ''; + }; + } + ); + defaultPackage = forEachSystem (system: self.packages.${system}.gnunet); + # This defines a development shell in which you can compile + # (and use) exchange + devShells = forEachSystem + (system: + let + pkgs = nixpkgsFor.${system}; + gnunetpkgs = gnunet.packages.${system}; + in + { + default = pkgs.mkShell { + packages = [ + pkgs.gcc + pkgs.meson + pkgs.ninja + pkgs.gnumake + pkgs.automake + pkgs.autoconf + pkgs.texinfo + pkgs.pkg-config + pkgs.libtool + pkgs.jansson + pkgs.git + pkgs.gettext + pkgs.postgresql + (pkgs.python3.withPackages (python-pkgs: [ + python-pkgs.jinja2 + ])) + pkgs.libmicrohttpd + pkgs.libsodium + pkgs.libgcrypt + pkgs.libunistring + pkgs.curlWithGnuTls + pkgs.jq + gnunetpkgs.gnunet + pkgs.codespell + pkgs.clang-tools + pkgs.uncrustify + pkgs.typst # optional + pkgs.pdftk # optional + pkgs.doxygen + ]; + + shellHook = '' + echo "taler-exchange environment loaded." + export CC=gcc + export CFLAGS="-O" + mkdir -p default + export PGHOST=localhost + export PGPORT=5432 + export PGUSER=$USER + export PGDATABASE=talercheck + export PGDATA="$PWD/default/.pg" + echo $PWD + [ ! -d $PGDATA ] && PGHOST="$PGDATA" pg_ctl initdb -o "-U $PGUSER" + + pg_ctl -o "-p $PGPORT -k $PGDATA" start && createdb talercheck && { + trap 'pg_ctl stop && rm -r $PGDATA' EXIT + } + ''; + }; + }); + }; +} diff --git a/meson-dist-script b/meson-dist-script @@ -0,0 +1,3 @@ +#!/bin/sh + +./scripts/doxygen.meson.sh diff --git a/meson.build b/meson.build @@ -0,0 +1,395 @@ +project( + 'taler-exchange', + 'c', + license: 'AGPLv3', + meson_version: '>=1.1.0', + version: '1.5.6', +) + +cc = meson.get_compiler('c') +incdir = include_directories('src/include') + +# Used to populate gnunet_private_config.h +private_config = configuration_data() + +pkgcfgdir = get_option('datadir') / 'taler-exchange' / 'config.d' +docdir = get_option('datadir') / 'doc' / 'taler-exchange' + +if get_option('install-rpath') + rpath_option = get_option('prefix') / get_option('libdir') +else + rpath_option = '' +endif + +install_emptydir(docdir) +install_data('README', 'COPYING', install_dir: docdir) + +gnunet_user = false +dpkg_architecture_bin = find_program( + 'dpkg-architecture', + '/usr/bin/getent', + required: false, +) +if dpkg_architecture_bin.found() + private_config.set( + 'MULTIARCH', + dpkg_architecture_bin.full_path() + ' -qDEB_HOST_MULTIARCH', + ) +endif + +TALER_PLUGIN_LDFLAGS = [ + '-export-dynamic', + '-avoid-version', + '-module', + '--no-undefined', +] + +if not get_option('only-doc') + add_project_arguments( + '-Wall', + '-Wno-address-of-packed-member', + language: 'c', + ) + taler_lib_ldflags = '-export-dynamic -no-undefined' + + check_headers = [ + 'stdint.h', + 'stdlib.h', + 'string.h', + 'unistd.h', + 'sys/socket.h', + 'sys/un.h', + 'netinet/in.h', + 'netinet/ip.h', + ] + + foreach h : check_headers + if cc.check_header(h) + define = 'HAVE_' + h.underscorify().to_upper() + message(define) + private_config.set(define, 1) + endif + endforeach + + + py_mod = import('python') + py3 = py_mod.find_installation('python3') + run_command( + py3.full_path(), + '-c', + 'import jinja2', + capture: false, + check: true, + ) + + private_config.set10('HAVE_EXPENSIVE_TESTS', get_option('expensivetests')) + + have_epoll = false + if get_option('enable-epoll') != 'no' + have_epoll = cc.has_header('sys/epoll.h') + endif + private_config.set10('EPOLL_SUPPORT', have_epoll) + if have_epoll + private_config.set10( + 'HAVE_EPOLL_CREATE1', + cc.has_header_symbol('sys/epoll.h', 'epoll_create1'), + ) + elif get_option('enable-epoll') == 'yes' + error( + 'Support for epoll was explicitly requested but cannot be enabled on this platform.', + ) + endif + + mhd_dep = dependency('libmicrohttpd', required: false) + if not mhd_dep.found() + mhd_dep = cc.find_library('microhttpd', required: true) + endif + + mhd2_dep = dependency('libmicrohttpd2', required: false) + if not mhd2_dep.found() + mhd_dep2 = cc.find_library('microhttpd2', required: false) + endif + + json_dep = dependency('jansson', required: false) + if not json_dep.found() + json_dep = cc.find_library('jansson', required: true) + endif + + gcrypt_dep = dependency('libgcrypt', required: false) + if not gcrypt_dep.found() + gcrypt_dep = cc.find_library('gcrypt', required: true) + endif + + private_config.set_quoted('NEED_LIBGCRYPT_VERSION', '1.6.0') + #add_project_arguments('-DNEED_LIBGCRYPT_VERSION="1.6.0"', language: 'c') + + gnunetutil_dep = dependency('gnunetutil', required: false) + if not gnunetutil_dep.found() + gnunetutil_dep = cc.find_library('gnunetutil', required: true) + endif + + gnunetjson_dep = dependency('gnunetjson', required: false) + if not gnunetjson_dep.found() + gnunetjson_dep = cc.find_library('gnunetjson', required: true) + endif + cc.has_header_symbol( + 'gnunet/gnunet_json_lib.h', + 'GNUNET_JSON_spec_string', + dependencies: [gnunetjson_dep], + required: true, + ) + + gnunetmhd_dep = dependency('gnunetmhd', required: false) + if not gnunetmhd_dep.found() + gnunetmhd_dep = cc.find_library('gnunetmhd', required: true) + endif + cc.has_header_symbol( + 'gnunet/gnunet_mhd_lib.h', + 'GNUNET_MHD_post_parser', + dependencies: [gnunetmhd_dep], + required: true, + ) + + sodium_dep = dependency('libsodium', required: false, version: '>=1.0.18') + if not sodium_dep.found() + sodium_dep = cc.find_library('sodium', required: true) + sodium_version_check = '''#include <sodium.h> + int main(int argc, char **argv) { + #if !((SODIUM_LIBRARY_VERSION_MAJOR > 10) || \ + ((SODIUM_LIBRARY_VERSION_MAJOR == 10) && \ + (SODIUM_LIBRARY_VERSION_MINOR >= 3))) + #error "libsodium version >= 1.0.18 required" + #endif + return 0 + } + ''' + if not cc.compiles( + sodium_version_check, + name: 'sodium version check', + dependencies: sodium_dep, + ) + error('libsodium version >=1.0.18 required') + endif + endif + unistr_dep = dependency('libunistring', required: false) + if not unistr_dep.found() + unistr_dep = cc.find_library('unistring', required: true) + endif + zlib_dep = dependency('zlib', required: false) + if not zlib_dep.found() + zlib_dep = cc.find_library('zlib', required: true) + endif + m_dep = cc.find_library('m', required: false) + if m_dep.found() + private_config.set('HAVE_LIBM', 1) + endif + + + # Gettext + i18n = import('i18n') + + gettext_package = 'taler-exchange' + add_project_arguments('-DGETTEXT_PACKAGE=' + gettext_package, language: 'c') + #todo subdir('po') + + curl_dep = dependency('libcurl', version: '>=7.34.0', required: false) + if not curl_dep.found() + curl_dep = cc.find_library('curl', required: true) + curl_version_check = '''#include <curl/curl.h> + int main(int argc, char **argv) { + #if LIBCURL_VERSION_NUM < 0x073400 + #error "cURL version >= 7.34.0 required" + #endif + return 0; + } + ''' + if not cc.compiles( + curl_version_check, + name: 'cURL version check', + dependencies: curl_dep, + ) + error('cURL version >=7.34.0 required') + endif + endif + + gnunetcurl_dep = dependency('gnunetcurl', required: false) + if not gnunetcurl_dep.found() + gnunetcurl_dep = cc.find_library('gnunetcurl', required: true) + endif + cc.has_header_symbol( + 'gnunet/gnunet_curl_lib.h', + 'GNUNET_CURL_get_select_info', + dependencies: [gnunetcurl_dep], + required: true, + ) + + pq_dep = dependency('libpq', required: false) + if not pq_dep.found() + pq_dep = cc.find_library('pq', required: true) + endif + + gnunetpq_dep = dependency('gnunetpq', required: false) + if not gnunetpq_dep.found() + gnunetpq_dep = cc.find_library('gnunetpq', required: true) + endif + cc.has_header_symbol( + 'gnunet/gnunet_pq_lib.h', + 'GNUNET_PQ_result_spec_blinded_sig', + required: true, + dependencies: [pq_dep, gnunetpq_dep], + ) + + gnunetsq_dep = dependency('gnunetsq', required: false) + if not gnunetsq_dep.found() + gnunetsq_dep = cc.find_library('gnunetsq', required: true) + endif + have_gnunetsq = cc.has_header_symbol( + 'gnunet/gnunet_sq_lib.h', + 'GNUNET_PQ_result_spec_string', + dependencies: [gnunetsq_dep], + required: false, + ) + + sqlite_dep = dependency('sqlite3', version: '>=3.35.0', required: false) + # FIXME for fallbacks, we need to manually check version + if not sqlite_dep.found() + sqlite_dep = cc.find_library('sqlite3', required: false) + sqlite_version_check = '''#include <sqlite3.h> + int main(int argc, char **argv) { + #if SQLITE_VERSION_NUMBER < 3035000 + #error "SQLite version >= 3.35.0 required" + #endif + return 0; + } + ''' + if not cc.compiles( + sqlite_version_check, + name: 'sqlite version check', + dependencies: sqlite_dep, + ) + error('Sqlite version >= 3.35.0 requried') + endif + endif + + private_config.set10('HAVE_SQLITE', have_gnunetsq and sqlite_dep.found()) + + # todo talertwister optional + twister_dep = cc.find_library('talertwister', required: false) + if twister_dep.found() + private_config.set10( + 'HAVE_TWISTER', + cc.has_header_symbol( + 'taler/taler_twister_service.h', + 'TALER_TWISTER_connect', + dependencies: [twister_dep], + ), + ) + endif + + logging_opt = get_option('logging') + logging_verbosity = 0 + + if logging_opt == 'yes' + logging_verbosity = 1 + endif + if logging_opt == 'no' + add_project_arguments('-DGNUNET_CULL_LOGGING=1', language: 'c') + endif + if logging_opt == 'verbose' + logging_verbosity = 2 + endif + if logging_opt == 'veryverbose' + logging_verbosity = 3 + endif + + #add_project_arguments('-DGNUNET_EXTRA_LOGGING=@0@'.format(logging_verbosity), language: 'c') + + + # todo gcov has meson builtin + + # Used to populate configuration file and script templates + + + libltversions = [ + ['libtalerutil', '12:0:2'], + ['libtalerjson', '6:0:2'], + ['libtalerextensions', '0:0:0'], + ['libtalercurl', '0:1:0'], + ['libtalerpq', '0:1:0'], + ['libtalersq', '0:0:0'], + ['libtalermhd', '8:0:1'], + ['libtalermhd2', '0:0:0'], + ['libtalertemplating', '1:1:1'], + ['libtalerbank', '5:0:1'], + ['libtalerkyclogic', '3:0:0'], + ['libtalerexchangedb', '1:1:0'], + ['libtalerauditordb', '0:1:0'], + ['libtalerexchange', '20:0:0'], + ['libtalerauditor', '0:0:0'], + ['libtalertesting', '4:0:0'], + ['libtalertwistertesting', '0:1:0'], + ] + + solibversions = {} + + foreach libversion : libltversions + ltversion = libversion[1].split(':') + current = ltversion[0].to_int() + revision = ltversion[1].to_int() + age = ltversion[2].to_int() + soversion_str = '@0@'.format(current - age) + ltversion_str = '@0@.@1@.@2@'.format(current - age, age, revision) + solibversions = solibversions + { + libversion[0]: { + 'soversion': soversion_str, + 'version': ltversion_str, + }, + } + endforeach + + private_config.set_quoted('PACKAGE_VERSION', meson.project_version()) + # Compatibility. Used in source. + private_config.set_quoted('VERSION', meson.project_version()) + private_config.set_quoted('VCS_VERSION', 'mesonbuild') + private_config.set_quoted('PACKAGE_BUGREPORT', 'taler@gnu.org') + configure_file( + output: 'taler_config.h', + configuration: private_config, + ) + configuration_inc = include_directories('.') + + cdata = configuration_data() + cdata.merge_from(private_config) + add_project_arguments('-DHAVE_CONFIG_H', language: 'c') + + pkg = import('pkgconfig') + subdir('contrib') + subdir('src') + if not get_option('disable-doc') + subdir('doc') + endif + subdir('po') + + taler_prefix = get_option('prefix') / get_option('libdir') + + add_test_setup( + 'default', + env: ['TALER_EXCHANGE_PREFIX=' + taler_prefix], + exclude_suites: ['perf', 'installcheck', 'integrationtests'], + is_default: true, + ) +else + subdir('contrib') + if not get_option('disable-doc') + subdir('doc') + endif + subdir('po') +endif + +run_target( + 'doxygen', + command: 'scripts/doxygen.meson.sh', + env: {'PACKAGE_VERSION': meson.project_version()}, +) +#meson.add_dist_script('meson-dist-script') + diff --git a/meson.options b/meson.options @@ -0,0 +1,7 @@ +# Build options +option('enable-epoll', type : 'string', value : 'auto', description: 'enable epoll support (yes, no, auto) [auto]') +option('expensivetests', type : 'boolean', value : false, description: 'whether to run expensive tests') +option('only-doc', type : 'boolean', value : false, description: 'whether to compile documentation ONLY') +option('disable-doc', type : 'boolean', value : false, description: 'whether to disable documentation') +option('install-rpath', type : 'boolean', value : false, description: 'Add rpath to installed binaries if set') +option('logging', type : 'string', value: 'yes', description: 'Log setting. Can be set to "yes" (logging, default), "no" (no logging), "verbose" (extra logging"), "veryverbose" (even more logging)') diff --git a/po/meson.build b/po/meson.build @@ -0,0 +1 @@ +i18n.gettext(gettext_package, preset: 'glib') diff --git a/scripts/doxygen.meson.sh b/scripts/doxygen.meson.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +# 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 +} + +if ! existence doxygen; then + echo "Doxygen not found" + exit 1 +fi +cd "${MESON_SOURCE_ROOT}/doc/doxygen" +echo "PROJECT_NUMBER = ${PACKAGE_VERSION}" > version.doxy +make all + +echo "Doxygen files generated into ${MESON_SOURCE_ROOT}/doc/doxygen!" diff --git a/src/Makefile.am b/src/Makefile.am @@ -1,37 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include -if HAVE_POSTGRESQL - PQ_DIR = pq -endif -if HAVE_SQLITE - SQ_DIR = sq -endif - -pkgcfgdir = $(prefix)/share/taler-exchange/config.d/ -pkgcfg_DATA = \ - taler-exchange.conf - -EXTRA_DIST = \ - $(pkgcfg_DATA) - -SUBDIRS = \ - include \ - util \ - json \ - extensions \ - curl \ - $(PQ_DIR) \ - $(SQ_DIR) \ - mhd \ - templating \ - bank-lib \ - kyclogic \ - exchangedb \ - exchange \ - auditordb \ - auditor \ - lib \ - exchange-tools \ - extensions/age_restriction \ - testing \ - benchmark diff --git a/src/auditor/Makefile.am b/src/auditor/Makefile.am @@ -1,273 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -pkgcfgdir = $(prefix)/share/taler-auditor/config.d/ - -pkgcfg_DATA = \ - auditor.conf - -clean-local: - rm -rf revocation-tmp-* - -bin_PROGRAMS = \ - taler-auditor-dbinit \ - taler-auditor-httpd \ - taler-auditor-sync \ - taler-helper-auditor-aggregation \ - taler-helper-auditor-coins \ - taler-helper-auditor-deposits \ - taler-helper-auditor-purses \ - taler-helper-auditor-reserves \ - taler-helper-auditor-transfer \ - taler-helper-auditor-wire-credit \ - taler-helper-auditor-wire-debit - -bin_SCRIPTS = \ - taler-helper-auditor-render.py - -lib_LTLIBRARIES = \ - libauditorreport.la - -libauditorreport_la_SOURCES = \ - report-lib.c report-lib.h -libauditorreport_la_LIBADD = \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/pq/libtalerpq.la \ - $(top_builddir)/src/auditordb/libtalerauditordb.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -taler_auditor_dbinit_SOURCES = \ - taler-auditor-dbinit.c -taler_auditor_dbinit_LDADD = \ - $(top_builddir)/src/auditordb/libtalerauditordb.la \ - $(top_builddir)/src/pq/libtalerpq.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetutil \ - $(LIBGCRYPT_LIBS) \ - $(XLIB) -taler_auditor_dbinit_CPPFLAGS = \ - -I$(top_srcdir)/src/include \ - -I$(top_srcdir)/src/pq/ \ - $(POSTGRESQL_CPPFLAGS) - -taler_helper_auditor_coins_SOURCES = \ - taler-helper-auditor-coins.c -taler_helper_auditor_coins_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/auditordb/libtalerauditordb.la \ - libauditorreport.la \ - -ljansson \ - -lgnunetjson \ - -lgnunetutil \ - $(XLIB) - -taler_helper_auditor_aggregation_SOURCES = \ - taler-helper-auditor-aggregation.c -taler_helper_auditor_aggregation_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/auditordb/libtalerauditordb.la \ - libauditorreport.la \ - -ljansson \ - -lgnunetjson \ - -lgnunetutil \ - $(XLIB) - -taler_helper_auditor_deposits_SOURCES = \ - taler-helper-auditor-deposits.c -taler_helper_auditor_deposits_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/auditordb/libtalerauditordb.la \ - libauditorreport.la \ - -ljansson \ - -lgnunetjson \ - -lgnunetutil \ - $(XLIB) - -taler_helper_auditor_purses_SOURCES = \ - taler-helper-auditor-purses.c -taler_helper_auditor_purses_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/auditordb/libtalerauditordb.la \ - libauditorreport.la \ - -ljansson \ - -lgnunetjson \ - -lgnunetutil \ - $(XLIB) - -taler_helper_auditor_reserves_SOURCES = \ - taler-helper-auditor-reserves.c -taler_helper_auditor_reserves_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/auditordb/libtalerauditordb.la \ - libauditorreport.la \ - -ljansson \ - -lgnunetjson \ - -lgnunetutil \ - $(XLIB) - -taler_helper_auditor_transfer_SOURCES = \ - taler-helper-auditor-transfer.c -taler_helper_auditor_transfer_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/auditordb/libtalerauditordb.la \ - libauditorreport.la \ - -ljansson \ - -lgnunetjson \ - -lgnunetutil \ - $(XLIB) - -taler_helper_auditor_wire_credit_SOURCES = \ - taler-helper-auditor-wire-credit.c -taler_helper_auditor_wire_credit_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/auditordb/libtalerauditordb.la \ - libauditorreport.la \ - -ljansson \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - $(XLIB) - -taler_helper_auditor_wire_debit_SOURCES = \ - taler-helper-auditor-wire-debit.c -taler_helper_auditor_wire_debit_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/auditordb/libtalerauditordb.la \ - libauditorreport.la \ - -ljansson \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - $(XLIB) - -# MARK: CRUD - -taler_auditor_httpd_SOURCES = \ - taler-auditor-httpd.c taler-auditor-httpd.h \ - taler-auditor-httpd_spa.c taler-auditor-httpd_spa.h \ - taler-auditor-httpd_put-deposit-confirmation.c taler-auditor-httpd_put-deposit-confirmation.h \ - taler-auditor-httpd_get-monitoring-deposit-confirmations.c taler-auditor-httpd_get-monitoring-deposit-confirmations.h \ - taler-auditor-httpd_get-monitoring-amount-arithmetic-inconsistency.c taler-auditor-httpd_get-monitoring-amount-arithmetic-inconsistency.h \ - taler-auditor-httpd_get-monitoring-coin-inconsistency.c taler-auditor-httpd_get-monitoring-coin-inconsistency.h \ - taler-auditor-httpd_get-monitoring-row-inconsistency.c taler-auditor-httpd_get-monitoring-row-inconsistency.h \ - taler-auditor-httpd_get-monitoring-emergency.c taler-auditor-httpd_get-monitoring-emergency.h \ - taler-auditor-httpd_get-monitoring-emergency-by-count.c taler-auditor-httpd_get-monitoring-emergency-by-count.h \ - taler-auditor-httpd_get-monitoring-denomination-key-validity-withdraw-inconsistency.c taler-auditor-httpd_get-monitoring-denomination-key-validity-withdraw-inconsistency.h \ - taler-auditor-httpd_get-monitoring-purse-not-closed-inconsistencies.c taler-auditor-httpd_get-monitoring-purse-not-closed-inconsistencies.h \ - taler-auditor-httpd_get-monitoring-reserve-balance-insufficient-inconsistency.c taler-auditor-httpd_get-monitoring-reserve-balance-insufficient-inconsistency.h \ - taler-auditor-httpd_patch-generic-suppressed.c taler-auditor-httpd_patch-generic-suppressed.h \ - taler-auditor-httpd_delete-generic.c taler-auditor-httpd_delete-generic.h \ - taler-auditor-httpd_get-monitoring-bad-sig-losses.c taler-auditor-httpd_get-monitoring-bad-sig-losses.h \ - taler-auditor-httpd_get-monitoring-closure-lags.c taler-auditor-httpd_get-monitoring-closure-lags.h \ - taler-auditor-httpd_get-monitoring-progress.c taler-auditor-httpd_get-monitoring-progress.h \ - taler-auditor-httpd_get-monitoring-early-aggregation.c taler-auditor-httpd_get-monitoring-early-aggregation.h \ - taler-auditor-httpd_get-monitoring-pending-deposits.c taler-auditor-httpd_get-monitoring-pending-deposits.h \ - taler-auditor-httpd_get-monitoring-reserve-in-inconsistency.c taler-auditor-httpd_get-monitoring-reserve-in-inconsistency.h \ - taler-auditor-httpd_get-monitoring-reserve-not-closed-inconsistency.c taler-auditor-httpd_get-monitoring-reserve-not-closed-inconsistency.h \ - taler-auditor-httpd_get-monitoring-denominations-without-sigs.c taler-auditor-httpd_get-monitoring-denominations-without-sigs.h \ - taler-auditor-httpd_get-monitoring-misattribution-in-inconsistency.c taler-auditor-httpd_get-monitoring-misattribution-in-inconsistency.h \ - taler-auditor-httpd_get-monitoring-reserves.c taler-auditor-httpd_get-monitoring-reserves.h \ - taler-auditor-httpd_get-monitoring-purses.c taler-auditor-httpd_get-monitoring-purses.h \ - taler-auditor-httpd_get-monitoring-historic-denomination-revenue.c taler-auditor-httpd_get-monitoring-historic-denomination-revenue.h \ - taler-auditor-httpd_get-monitoring-denomination-pending.c taler-auditor-httpd_get-monitoring-denomination-pending.h \ - taler-auditor-httpd_get-monitoring-historic-reserve-summary.c taler-auditor-httpd_get-monitoring-historic-reserve-summary.h \ - taler-auditor-httpd_get-monitoring-wire-format-inconsistency.c taler-auditor-httpd_get-monitoring-wire-format-inconsistency.h \ - taler-auditor-httpd_get-monitoring-wire-out-inconsistency.c taler-auditor-httpd_get-monitoring-wire-out-inconsistency.h \ - taler-auditor-httpd_get-monitoring-reserve-balance-summary-wrong-inconsistency.c taler-auditor-httpd_get-monitoring-reserve-balance-summary-wrong-inconsistency.h \ - taler-auditor-httpd_get-monitoring-row-minor-inconsistencies.c taler-auditor-httpd_get-monitoring-row-minor-inconsistencies.h \ - taler-auditor-httpd_get-monitoring-fee-time-inconsistency.c taler-auditor-httpd_get-monitoring-fee-time-inconsistency.h \ - taler-auditor-httpd_get-monitoring-balances.c taler-auditor-httpd_get-monitoring-balances.h \ - taler-auditor-httpd_mhd.c taler-auditor-httpd_mhd.h -taler_auditor_httpd_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/mhd/libtalermhd.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/auditordb/libtalerauditordb.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - -lmicrohttpd \ - -ljansson \ - -lgnunetjson \ - -lgnunetutil \ - -lz \ - $(XLIB) - -taler_auditor_sync_SOURCES = \ - taler-auditor-sync.c -taler_auditor_sync_LDADD = \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/pq/libtalerpq.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetjson \ - -lgnunetutil \ - $(LIBGCRYPT_LIBS) \ - $(XLIB) -taler_auditor_sync_CPPFLAGS = \ - -I$(top_srcdir)/src/include \ - -I$(top_srcdir)/src/pq/ \ - $(POSTGRESQL_CPPFLAGS) - - -check_SCRIPTS = \ - test-auditor.sh \ - test-kyc.sh \ - test-revocation.sh \ - test-sync.sh - -AM_TESTS_ENVIRONMENT=export TALER_EXCHANGE_PREFIX=$${TALER_EXCHANGE_PREFIX:-@libdir@};export PATH=$${TALER_EXCHANGE_PREFIX:-@prefix@}/bin:$$PATH;export TALER_AUDITOR_PREFIX=$${TALER_AUDITOR_PREFIX:-@libdir@}; - -TESTS = \ - test-sync.sh -# test-auditor.sh -- blocked on stable coin selection option in wallet... - -EXTRA_DIST = \ - taler-helper-auditor-render.py \ - auditor.conf \ - setup.sh \ - test-sync-in.conf \ - test-sync-out.conf \ - generate-auditor-basedb.sh \ - generate-auditor-basedb.conf \ - generate-kyc-basedb.conf \ - generate-revoke-basedb.sh \ - $(check_SCRIPTS) diff --git a/src/auditor/meson.build b/src/auditor/meson.build @@ -0,0 +1,346 @@ +# This build file is in the public domain + +install_data('auditor.conf', install_dir: pkgcfgadir) + +install_data('taler-helper-auditor-render.py', install_dir: get_option('bindir')) + + +libauditorreport = library( + 'auditorreport', + ['report-lib.c'], + soversion: '0.0.0', + version: '0.0.0', + install_rpath: rpath_option, + dependencies: [ + libtalerpq_dep, + libtalerauditordb_dep, + libtalerexchangedb_dep, + libtalerutil_dep, + gnunetutil_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libauditorreport_dep = declare_dependency(link_with: libauditorreport) + +executable( + 'taler-auditor-dbinit', + ['taler-auditor-dbinit.c'], + dependencies: [ + libtalerutil_dep, + libtalerpq_dep, + libtalerauditordb_dep, + gnunetutil_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + +executable( + 'taler-helper-auditor-coins', + ['taler-helper-auditor-coins.c'], + dependencies: [ + libtalerutil_dep, + libtalerbank_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerauditordb_dep, + libauditorreport_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-helper-auditor-aggregation', + ['taler-helper-auditor-aggregation.c'], + dependencies: [ + libtalerutil_dep, + libtalerbank_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerauditordb_dep, + libauditorreport_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-helper-auditor-deposits', + ['taler-helper-auditor-deposits.c'], + dependencies: [ + libtalerutil_dep, + libtalerbank_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerauditordb_dep, + libauditorreport_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-helper-auditor-purses', + ['taler-helper-auditor-purses.c'], + dependencies: [ + libtalerutil_dep, + libtalerbank_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerauditordb_dep, + libauditorreport_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-helper-auditor-reserves', + ['taler-helper-auditor-reserves.c'], + dependencies: [ + libtalerutil_dep, + libtalerbank_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerauditordb_dep, + libauditorreport_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-helper-auditor-transfer', + ['taler-helper-auditor-transfer.c'], + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerauditordb_dep, + libauditorreport_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-helper-auditor-wire-credit', + ['taler-helper-auditor-wire-credit.c'], + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalerbank_dep, + libtalerexchangedb_dep, + libtalerauditordb_dep, + libauditorreport_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + json_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-helper-auditor-wire-debit', + ['taler-helper-auditor-wire-debit.c'], + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalerbank_dep, + libtalerexchangedb_dep, + libtalerauditordb_dep, + libauditorreport_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + json_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +# MARK: CRUD + +taler_auditor_httpd_SOURCES = [ + 'taler-auditor-httpd.c', + 'taler-auditor-httpd_spa.c', + 'taler-auditor-httpd_put-deposit-confirmation.c', + 'taler-auditor-httpd_get-monitoring-deposit-confirmations.c', + 'taler-auditor-httpd_get-monitoring-amount-arithmetic-inconsistency.c', + 'taler-auditor-httpd_get-monitoring-coin-inconsistency.c', + 'taler-auditor-httpd_get-monitoring-row-inconsistency.c', + 'taler-auditor-httpd_get-monitoring-emergency.c', + 'taler-auditor-httpd_get-monitoring-emergency-by-count.c', + 'taler-auditor-httpd_get-monitoring-denomination-key-validity-withdraw-inconsistency.c', + 'taler-auditor-httpd_get-monitoring-purse-not-closed-inconsistencies.c', + 'taler-auditor-httpd_get-monitoring-reserve-balance-insufficient-inconsistency.c', + 'taler-auditor-httpd_patch-generic-suppressed.c', + 'taler-auditor-httpd_delete-generic.c', + 'taler-auditor-httpd_get-monitoring-bad-sig-losses.c', + 'taler-auditor-httpd_get-monitoring-closure-lags.c', + 'taler-auditor-httpd_get-monitoring-progress.c', + 'taler-auditor-httpd_get-monitoring-early-aggregation.c', + 'taler-auditor-httpd_get-monitoring-pending-deposits.c', + 'taler-auditor-httpd_get-monitoring-reserve-in-inconsistency.c', + 'taler-auditor-httpd_get-monitoring-reserve-not-closed-inconsistency.c', + 'taler-auditor-httpd_get-monitoring-denominations-without-sigs.c', + 'taler-auditor-httpd_get-monitoring-misattribution-in-inconsistency.c', + 'taler-auditor-httpd_get-monitoring-reserves.c', + 'taler-auditor-httpd_get-monitoring-purses.c', + 'taler-auditor-httpd_get-monitoring-historic-denomination-revenue.c', + 'taler-auditor-httpd_get-monitoring-denomination-pending.c', + 'taler-auditor-httpd_get-monitoring-historic-reserve-summary.c', + 'taler-auditor-httpd_get-monitoring-wire-format-inconsistency.c', + 'taler-auditor-httpd_get-monitoring-wire-out-inconsistency.c', + 'taler-auditor-httpd_get-monitoring-reserve-balance-summary-wrong-inconsistency.c', + 'taler-auditor-httpd_get-monitoring-row-minor-inconsistencies.c', + 'taler-auditor-httpd_get-monitoring-fee-time-inconsistency.c', + 'taler-auditor-httpd_get-monitoring-balances.c', + 'taler-auditor-httpd_mhd.c', +] + +executable( + 'taler-auditor-httpd', + taler_auditor_httpd_SOURCES, + dependencies: [ + libtalermhd_dep, + libtalerutil_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerauditordb_dep, + gnunetutil_dep, + gnunetjson_dep, + zlib_dep, + mhd_dep, + json_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-auditor-sync', + ['taler-auditor-sync.c'], + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerpq_dep, + gnunetutil_dep, + gnunetjson_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +#TESTS = \ +# test-sync.sh +# test-auditor.sh -- blocked on stable coin selection option in wallet... + +#test_auditor = configure_file( +# input: 'test-auditor.sh', +# output: 'test-auditor.sh', +# copy: true, +#) +#test( +# 'test-auditor', +# test_auditor, +# workdir: meson.current_build_dir(), +# suite: ['auditor', 'installcheck'], +#) +#test_kyc = configure_file( +# input: 'test-kyc.sh', +# output: 'test-kyc.sh', +# copy: true, +#) +#test( +# 'test-kyc', +# test_kyc, +# workdir: meson.current_build_dir(), +# suite: ['auditor', 'installcheck'], +#) +#test_revocation = configure_file( +# input: 'test-revocation.sh', +# output: 'test-revocation.sh', +# copy: true, +#) +#test( +# 'test-revocation', +# test_revocation, +# workdir: meson.current_build_dir(), +# suite: ['auditor', 'installcheck'], +#) +test_sync = configure_file( + input: 'test-sync.sh', + output: 'test-sync.sh', + copy: true, +) +test( + 'test-sync', + test_sync, + workdir: meson.current_build_dir(), + suite: ['auditor', 'installcheck'], +) + +EXTRA_DIST = [ + 'taler-helper-auditor-render.py', + 'auditor.conf', + 'setup.sh', + 'test-sync-in.conf', + 'test-sync-out.conf', + 'generate-auditor-basedb.sh', + 'generate-auditor-basedb.conf', + 'generate-kyc-basedb.conf', + 'generate-revoke-basedb.sh', +] + +foreach f : EXTRA_DIST + configure_file(input: f, output: f, copy: true) + +endforeach diff --git a/src/auditor/test-auditor.sh b/src/auditor/test-auditor.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # This file is part of TALER # Copyright (C) 2014-2025 Taler Systems SA diff --git a/src/auditor/test-kyc.sh b/src/auditor/test-kyc.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # This file is part of TALER # Copyright (C) 2014-2023 Taler Systems SA diff --git a/src/auditor/test-revocation.sh b/src/auditor/test-revocation.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # This file is part of TALER # Copyright (C) 2014-2022 Taler Systems SA diff --git a/src/auditor/test-sync.sh b/src/auditor/test-sync.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # This file is part of TALER # Copyright (C) 2014-2023 Taler Systems SA diff --git a/src/auditordb/Makefile.am b/src/auditordb/Makefile.am @@ -1,204 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/pq/ $(POSTGRESQL_CPPFLAGS) - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -pkgcfgdir = $(prefix)/share/taler-auditor/config.d/ - -pkgcfg_DATA = \ - auditordb-postgres.conf - -sqldir = $(prefix)/share/taler-auditor/sql/ - -sqlinputs = \ - 0002-*.sql \ - auditor-0002.sql.in \ - auditor_do_*.sql \ - procedures.sql.in - -sql_DATA = \ - versioning.sql \ - auditor-0001.sql \ - auditor-0002.sql \ - drop.sql \ - restart.sql \ - procedures.sql - -CLEANFILES = \ - auditor-0002.sql - -procedures.sql: procedures.sql.in auditor_do_*.sql - chmod +w $@ 2> /dev/null || true - gcc -E -P -undef - < procedures.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ - chmod ugo-w $@ - -auditor-0002.sql: auditor-0002.sql.in 0002-*.sql - chmod +w $@ 2> /dev/null || true - gcc -E -P -undef - < auditor-0002.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ - chmod ugo-w $@ - - -EXTRA_DIST = \ - auditordb-postgres.conf \ - test-auditor-db-postgres.conf \ - $(sqlinputs) \ - $(sql_DATA) \ - pg_template.h pg_template.c \ - pg_template.sh - -plugindir = $(libdir)/taler-auditor - -if HAVE_POSTGRESQL -plugin_LTLIBRARIES = \ - libtaler_plugin_auditordb_postgres.la -endif - -libtaler_plugin_auditordb_postgres_la_SOURCES = \ - pg_del_denomination_balance.h pg_del_denomination_balance.c \ - pg_del_reserve_info.c pg_del_reserve_info.h \ - pg_delete_auditor_closure_lag.h pg_delete_auditor_closure_lag.c \ - pg_delete_early_aggregation.h pg_delete_early_aggregation.c \ - pg_delete_generic.c pg_delete_generic.h \ - pg_delete_pending_deposit.c pg_delete_pending_deposit.h \ - pg_delete_purse_info.c pg_delete_purse_info.h \ - pg_delete_reserve_in_inconsistency.h pg_delete_reserve_in_inconsistency.c \ - pg_delete_wire_out_inconsistency_if_matching.c pg_delete_wire_out_inconsistency_if_matching.h \ - pg_get_amount_arithmetic_inconsistency.c pg_get_amount_arithmetic_inconsistency.h \ - pg_get_auditor_closure_lags.c pg_get_auditor_closure_lags.h \ - pg_get_auditor_progress.c pg_get_auditor_progress.h \ - pg_get_bad_sig_losses.c pg_get_bad_sig_losses.h \ - pg_get_balance.c pg_get_balance.h \ - pg_get_balances.c pg_get_balances.h \ - pg_get_coin_inconsistency.c pg_get_coin_inconsistency.h \ - pg_get_denomination_balance.c pg_get_denomination_balance.h \ - pg_get_denomination_key_validity_withdraw_inconsistency.c pg_get_denomination_key_validity_withdraw_inconsistency.h \ - pg_get_denomination_pending.c pg_get_denomination_pending.h \ - pg_get_denominations_without_sigs.c pg_get_denominations_without_sigs.h \ - pg_get_deposit_confirmations.c pg_get_deposit_confirmations.h \ - pg_get_emergency.c pg_get_emergency.h \ - pg_get_emergency_by_count.c pg_get_emergency_by_count.h \ - pg_get_exchange_signkeys.c pg_get_exchange_signkeys.h \ - pg_get_fee_time_inconsistency.c pg_get_fee_time_inconsistency.h \ - pg_get_misattribution_in_inconsistency.c pg_get_misattribution_in_inconsistency.h \ - pg_get_progress_points.h pg_get_progress_points.c \ - pg_get_purse_info.c pg_get_purse_info.h \ - pg_get_purse_not_closed_inconsistencies.c pg_get_purse_not_closed_inconsistencies.h \ - pg_get_purses.c pg_get_purses.h \ - pg_get_reserve_balance_insufficient_inconsistency.c pg_get_reserve_balance_insufficient_inconsistency.h \ - pg_get_reserve_balance_summary_wrong_inconsistency.c pg_get_reserve_balance_summary_wrong_inconsistency.h \ - pg_get_reserve_in_inconsistency.c pg_get_reserve_in_inconsistency.h \ - pg_get_reserve_info.c pg_get_reserve_info.h \ - pg_get_reserve_not_closed_inconsistency.c pg_get_reserve_not_closed_inconsistency.h \ - pg_get_reserves.c pg_get_reserves.h \ - pg_get_row_inconsistency.c pg_get_row_inconsistency.h \ - pg_get_row_minor_inconsistencies.c pg_get_row_minor_inconsistencies.h \ - pg_get_wire_fee_summary.c pg_get_wire_fee_summary.h \ - pg_get_wire_format_inconsistency.c pg_get_wire_format_inconsistency.h \ - pg_get_wire_out_inconsistency.c pg_get_wire_out_inconsistency.h \ - pg_helper.h pg_helper.c \ - pg_insert_amount_arithmetic_inconsistency.c pg_insert_amount_arithmetic_inconsistency.h \ - pg_insert_auditor_closure_lags.c pg_insert_auditor_closure_lags.h \ - pg_insert_auditor_progress.c pg_insert_auditor_progress.h \ - pg_insert_bad_sig_losses.c pg_insert_bad_sig_losses.h \ - pg_insert_balance.c pg_insert_balance.h \ - pg_insert_coin_inconsistency.c pg_insert_coin_inconsistency.h \ - pg_insert_denomination_balance.c pg_insert_denomination_balance.h \ - pg_insert_denomination_key_validity_withdraw_inconsistency.c pg_insert_denomination_key_validity_withdraw_inconsistency.h \ - pg_insert_denomination_pending.c pg_insert_denomination_pending.h \ - pg_insert_denominations_without_sigs.c pg_insert_denominations_without_sigs.h \ - pg_insert_deposit_confirmation.c pg_insert_deposit_confirmation.h \ - pg_insert_early_aggregation.h pg_insert_early_aggregation.c \ - pg_insert_emergency.c pg_insert_emergency.h \ - pg_insert_emergency_by_count.c pg_insert_emergency_by_count.h \ - pg_insert_exchange_signkey.c pg_insert_exchange_signkey.h \ - pg_insert_fee_time_inconsistency.c pg_insert_fee_time_inconsistency.h \ - pg_insert_historic_denom_revenue.c pg_insert_historic_denom_revenue.h \ - pg_insert_historic_reserve_revenue.c pg_insert_historic_reserve_revenue.h \ - pg_insert_misattribution_in_inconsistency.c pg_insert_misattribution_in_inconsistency.h \ - pg_insert_pending_deposit.c pg_insert_pending_deposit.h \ - pg_insert_purse_info.c pg_insert_purse_info.h \ - pg_insert_purse_not_closed_inconsistencies.c pg_insert_purse_not_closed_inconsistencies.h \ - pg_insert_reserve_balance_insufficient_inconsistency.c pg_insert_reserve_balance_insufficient_inconsistency.h \ - pg_insert_reserve_balance_summary_wrong_inconsistency.c pg_insert_reserve_balance_summary_wrong_inconsistency.h \ - pg_insert_reserve_in_inconsistency.c pg_insert_reserve_in_inconsistency.h \ - pg_insert_reserve_info.c pg_insert_reserve_info.h \ - pg_insert_reserve_not_closed_inconsistency.c pg_insert_reserve_not_closed_inconsistency.h \ - pg_insert_row_inconsistency.c pg_insert_row_inconsistency.h \ - pg_insert_row_minor_inconsistencies.c pg_insert_row_minor_inconsistencies.h \ - pg_insert_wire_format_inconsistency.c pg_insert_wire_format_inconsistency.h \ - pg_insert_wire_out_inconsistency.c pg_insert_wire_out_inconsistency.h \ - pg_lookup_reserve_in_inconsistency.c pg_lookup_reserve_in_inconsistency.h \ - pg_select_early_aggregations.h pg_select_early_aggregations.c \ - pg_select_historic_denom_revenue.c pg_select_historic_denom_revenue.h \ - pg_select_historic_reserve_revenue.c pg_select_historic_reserve_revenue.h \ - pg_select_pending_deposits.c pg_select_pending_deposits.h \ - pg_select_purse_expired.c pg_select_purse_expired.h \ - pg_select_reserve_in_inconsistency.c pg_select_reserve_in_inconsistency.h \ - pg_update_auditor_progress.c pg_update_auditor_progress.h \ - pg_update_balance.c pg_update_balance.h \ - pg_update_denomination_balance.c pg_update_denomination_balance.h \ - pg_update_generic_suppressed.c pg_update_generic_suppressed.h \ - pg_update_purse_info.c pg_update_purse_info.h \ - pg_update_reserve_info.c pg_update_reserve_info.h \ - pg_update_wire_fee_summary.c pg_update_wire_fee_summary.h \ - plugin_auditordb_postgres.c - -libtaler_plugin_auditordb_postgres_la_LDFLAGS = \ - $(TALER_PLUGIN_LDFLAGS) -libtaler_plugin_auditordb_postgres_la_LIBADD = \ - $(LTLIBINTL) \ - $(top_builddir)/src/pq/libtalerpq.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetpq \ - -lgnunetutil \ - -lpq \ - $(XLIB) - -lib_LTLIBRARIES = \ - libtalerauditordb.la - -libtalerauditordb_la_SOURCES = \ - auditordb_plugin.c -libtalerauditordb_la_LIBADD = \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetutil $(XLIB) -libtalerauditordb_la_LDFLAGS = \ - $(POSTGRESQL_LDFLAGS) \ - -version-info 0:1:0 \ - -no-undefined - - -#EXTRA_test_auditordb_postgres_DEPENDENCIES = \ -# libtaler_plugin_auditordb_postgres.la - - -check_PROGRAMS = \ - test_auditordb_checkpoints-postgres \ - test_auditordb-postgres - -AM_TESTS_ENVIRONMENT=export TALER_EXCHANGE_PREFIX=$${TALER_EXCHANGE_PREFIX:-@libdir@};export PATH=$${TALER_EXCHANGE_PREFIX:-@prefix@}/bin:$$PATH;export TALER_AUDITOR_PREFIX=$${TALER_AUDITOR_PREFIX:-@libdir@}; - -TESTS = \ - test_auditordb_checkpoints-postgres \ - test_auditordb-postgres - -test_auditordb_checkpoints_postgres_SOURCES = \ - test_auditordb_checkpoints.c -test_auditordb_checkpoints_postgres_LDADD = \ - libtalerauditordb.la \ - $(top_srcdir)/src/pq/libtalerpq.la \ - $(top_srcdir)/src/util/libtalerutil.la \ - -lgnunetutil \ - $(XLIB) - -test_auditordb_postgres_SOURCES = \ - test_auditordb.c -test_auditordb_postgres_LDADD = \ - libtalerauditordb.la \ - $(top_srcdir)/src/pq/libtalerpq.la \ - $(top_srcdir)/src/util/libtalerutil.la \ - -lgnunetutil \ - $(XLIB) diff --git a/src/auditordb/Makefile.sql b/src/auditordb/Makefile.sql @@ -0,0 +1,15 @@ +CLEANFILES = \ + procedures.sql \ + auditor-0002.sql + +procedures.sql: procedures.sql.in auditor_do_*.sql + gcc -E -P -undef - < procedures.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ + +auditor-0002.sql: auditor-0002.sql.in 0002-*.sql + gcc -E -P -undef - < auditor-0002.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ + + +all: ${CLEANFILES} + +clean: + rm ${CLEANFILES} diff --git a/src/auditordb/meson.build b/src/auditordb/meson.build @@ -0,0 +1,211 @@ +# This Makefile.am is in the public domain + +install_data('auditordb-postgres.conf', install_dir: pkgcfgdir) + +sqldir = get_option('datadir') / 'taler-auditor' / 'sql' + +# FIXME possibly provide this output in the tgz through dist script +run_command('make', '-f', 'Makefile.sql', 'all', check: true) + +sqlfiles = [ + 'versioning.sql', + 'auditor-0001.sql', + 'auditor-0002.sql', + 'drop.sql', + 'restart.sql', + 'procedures.sql', +] +install_data(sources: sqlfiles, install_dir: sqldir) + +# This makes meson copy the files into the build directory for testing +foreach f : sqlfiles + configure_file(input: f, output: f, copy: true) +endforeach + +configure_file( + input: 'test-auditor-db-postgres.conf', + output: 'test-auditor-db-postgres.conf', + copy: true, +) + +aud_plugindir = get_option('libdir') / 'taler-auditor' + +if pq_dep.found() + + libtaler_plugin_auditordb_postgres_la_SOURCES = [ + 'pg_del_denomination_balance.c', + 'pg_del_reserve_info.c', + 'pg_delete_auditor_closure_lag.c', + 'pg_delete_early_aggregation.c', + 'pg_delete_generic.c', + 'pg_delete_pending_deposit.c', + 'pg_delete_purse_info.c', + 'pg_delete_reserve_in_inconsistency.c', + 'pg_delete_wire_out_inconsistency_if_matching.c', + 'pg_get_amount_arithmetic_inconsistency.c', + 'pg_get_auditor_closure_lags.c', + 'pg_get_auditor_progress.c', + 'pg_get_bad_sig_losses.c', + 'pg_get_balance.c', + 'pg_get_balances.c', + 'pg_get_coin_inconsistency.c', + 'pg_get_denomination_balance.c', + 'pg_get_denomination_key_validity_withdraw_inconsistency.c', + 'pg_get_denomination_pending.c', + 'pg_get_denominations_without_sigs.c', + 'pg_get_deposit_confirmations.c', + 'pg_get_emergency.c', + 'pg_get_emergency_by_count.c', + 'pg_get_exchange_signkeys.c', + 'pg_get_fee_time_inconsistency.c', + 'pg_get_misattribution_in_inconsistency.c', + 'pg_get_progress_points.c', + 'pg_get_purse_info.c', + 'pg_get_purse_not_closed_inconsistencies.c', + 'pg_get_purses.c', + 'pg_get_reserve_balance_insufficient_inconsistency.c', + 'pg_get_reserve_balance_summary_wrong_inconsistency.c', + 'pg_get_reserve_in_inconsistency.c', + 'pg_get_reserve_info.c', + 'pg_get_reserve_not_closed_inconsistency.c', + 'pg_get_reserves.c', + 'pg_get_row_inconsistency.c', + 'pg_get_row_minor_inconsistencies.c', + 'pg_get_wire_fee_summary.c', + 'pg_get_wire_format_inconsistency.c', + 'pg_get_wire_out_inconsistency.c', + 'pg_helper.c', + 'pg_insert_amount_arithmetic_inconsistency.c', + 'pg_insert_auditor_closure_lags.c', + 'pg_insert_auditor_progress.c', + 'pg_insert_bad_sig_losses.c', + 'pg_insert_balance.c', + 'pg_insert_coin_inconsistency.c', + 'pg_insert_denomination_balance.c', + 'pg_insert_denomination_key_validity_withdraw_inconsistency.c', + 'pg_insert_denomination_pending.c', + 'pg_insert_denominations_without_sigs.c', + 'pg_insert_deposit_confirmation.c', + 'pg_insert_early_aggregation.c', + 'pg_insert_emergency.c', + 'pg_insert_emergency_by_count.c', + 'pg_insert_exchange_signkey.c', + 'pg_insert_fee_time_inconsistency.c', + 'pg_insert_historic_denom_revenue.c', + 'pg_insert_historic_reserve_revenue.c', + 'pg_insert_misattribution_in_inconsistency.c', + 'pg_insert_pending_deposit.c', + 'pg_insert_purse_info.c', + 'pg_insert_purse_not_closed_inconsistencies.c', + 'pg_insert_reserve_balance_insufficient_inconsistency.c', + 'pg_insert_reserve_balance_summary_wrong_inconsistency.c', + 'pg_insert_reserve_in_inconsistency.c', + 'pg_insert_reserve_info.c', + 'pg_insert_reserve_not_closed_inconsistency.c', + 'pg_insert_row_inconsistency.c', + 'pg_insert_row_minor_inconsistencies.c', + 'pg_insert_wire_format_inconsistency.c', + 'pg_insert_wire_out_inconsistency.c', + 'pg_lookup_reserve_in_inconsistency.c', + 'pg_select_early_aggregations.c', + 'pg_select_historic_denom_revenue.c', + 'pg_select_historic_reserve_revenue.c', + 'pg_select_pending_deposits.c', + 'pg_select_purse_expired.c', + 'pg_select_reserve_in_inconsistency.c', + 'pg_update_auditor_progress.c', + 'pg_update_balance.c', + 'pg_update_denomination_balance.c', + 'pg_update_generic_suppressed.c', + 'pg_update_purse_info.c', + 'pg_update_reserve_info.c', + 'pg_update_wire_fee_summary.c', + 'plugin_auditordb_postgres.c', + ] + + shared_module( + 'taler_plugin_auditordb_postgres', + libtaler_plugin_auditordb_postgres_la_SOURCES, + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + libtalerpq_dep, + gnunetpq_dep, + gnunetutil_dep, + pq_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: aud_plugindir, + ) +endif + +libtalerauditordb = library( + 'talerauditordb', + ['auditordb_plugin.c'], + soversion: solibversions['libtalerauditordb']['soversion'], + version: solibversions['libtalerauditordb']['soversion'], + install_rpath: rpath_option, + dependencies: [libtalerutil_dep, gnunetutil_dep], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalerauditordb_dep = declare_dependency(link_with: libtalerauditordb) +pkg.generate( + libtalerauditordb, + url: 'https://taler.net', + description: 'GNU Taler auditor DB library', +) + + + +#EXTRA_test_auditordb_postgres_DEPENDENCIES = \ +# libtaler_plugin_auditordb_postgres.la + + +test_auditordb_checkpoints = executable( + 'test_auditordb_checkpoints-postgres', + ['test_auditordb_checkpoints.c'], + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + libtalerpq_dep, + gnunetutil_dep, + libtalerauditordb_dep, + ], + include_directories: [incdir, configuration_inc], + install: false, +) +test( + 'test_auditordb_checkpoints-postgres', + test_auditordb_checkpoints, + workdir: meson.current_build_dir(), + suite: ['auditordb'], + is_parallel: false, +) + + +test_auditordb = executable( + 'test_auditordb-postgres', + ['test_auditordb.c'], + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + libtalerpq_dep, + gnunetutil_dep, + libtalerauditordb_dep, + ], + include_directories: [incdir, configuration_inc], + install: false, +) +test( + 'test_auditordb-postgres', + test_auditordb, + workdir: meson.current_build_dir(), + suite: ['auditordb'], + is_parallel: false, +) + + diff --git a/src/bank-lib/Makefile.am b/src/bank-lib/Makefile.am @@ -1,120 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -bin_PROGRAMS = \ - taler-exchange-wire-gateway-client \ - taler-fakebank-run - -taler_fakebank_run_SOURCES = \ - taler-fakebank-run.c -taler_fakebank_run_LDADD = \ - libtalerfakebank.la \ - $(top_builddir)/src/mhd/libtalermhd.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetutil - -taler_exchange_wire_gateway_client_SOURCES = \ - taler-exchange-wire-gateway-client.c -taler_exchange_wire_gateway_client_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/json/libtalerjson.la \ - libtalerbank.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson $(XLIB) - -lib_LTLIBRARIES = \ - libtalerbank.la \ - libtalerfakebank.la - -libtalerbank_la_LDFLAGS = \ - -version-info 5:0:1 \ - -no-undefined -libtalerbank_la_SOURCES = \ - bank_api_account_token.c \ - bank_api_admin_add_incoming.c \ - bank_api_admin_add_kycauth.c \ - bank_api_common.c bank_api_common.h \ - bank_api_credit.c \ - bank_api_debit.c \ - bank_api_helper.c \ - bank_api_registration.c \ - bank_api_transfer.c \ - bank_api_parse.c -libtalerbank_la_LIBADD = \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/curl/libtalercurl.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetcurl \ - -lgnunetjson \ - -lgnunetmhd \ - -lgnunetutil \ - -ljansson \ - -lcurl \ - $(XLIB) - -libtalerfakebank_la_LDFLAGS = \ - -version-info 0:0:0 \ - -no-undefined -libtalerfakebank_la_SOURCES = \ - fakebank.c fakebank.h \ - fakebank_api_check.c \ - fakebank_common_lookup.c fakebank_common_lookup.h \ - fakebank_common_lp.c fakebank_common_lp.h \ - fakebank_common_make_admin_transfer.c fakebank_common_make_admin_transfer.h \ - fakebank_common_parser.c fakebank_common_parser.h \ - fakebank_common_transact.c fakebank_common_transact.h \ - fakebank_stop.c \ - fakebank_bank.c fakebank_bank.h \ - fakebank_bank_accounts_withdrawals.c fakebank_bank_accounts_withdrawals.h \ - fakebank_bank_get_accounts.c fakebank_bank_get_accounts.h \ - fakebank_bank_get_withdrawals.c fakebank_bank_get_withdrawals.h \ - fakebank_bank_get_root.c fakebank_bank_get_root.h \ - fakebank_bank_post_accounts_token.c fakebank_bank_post_accounts_token.h \ - fakebank_bank_post_accounts_withdrawals.c fakebank_bank_post_accounts_withdrawals.h \ - fakebank_bank_post_withdrawals_id_op.c fakebank_bank_post_withdrawals_id_op.h \ - fakebank_bank_testing_register.c fakebank_bank_testing_register.h \ - fakebank_tbr.c fakebank_tbr.h \ - fakebank_tbr_get_history.c fakebank_tbr_get_history.h \ - fakebank_tbr_get_root.c fakebank_tbr_get_root.h \ - fakebank_tbi.c fakebank_tbi.h \ - fakebank_tbi_get_withdrawal_operation.c fakebank_tbi_get_withdrawal_operation.h \ - fakebank_tbi_post_withdrawal_operation.c fakebank_tbi_post_withdrawal_operation.h \ - fakebank_twg.c fakebank_twg.h \ - fakebank_twg_admin_add_incoming.c fakebank_twg_admin_add_incoming.h \ - fakebank_twg_admin_add_kycauth.c fakebank_twg_admin_add_kycauth.h \ - fakebank_twg_get_root.c fakebank_twg_get_root.h \ - fakebank_twg_get_transfers.c fakebank_twg_get_transfers.h \ - fakebank_twg_get_transfers_id.c \ - fakebank_twg_history.c fakebank_twg_history.h \ - fakebank_twg_transfer.c fakebank_twg_transfer.h -libtalerfakebank_la_LIBADD = \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/mhd/libtalermhd.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetmhd \ - -lgnunetjson \ - -lgnunetutil \ - -ljansson \ - -lcurl \ - -lmicrohttpd \ - -lpthread \ - $(XLIB) - -check_SCRIPTS = \ - test_bank.sh - -AM_TESTS_ENVIRONMENT=export TALER_EXCHANGE_PREFIX=$${TALER_EXCHANGE_PREFIX:-@libdir@};export PATH=$${TALER_EXCHANGE_PREFIX:-@prefix@}/bin:$$PATH;export TALER_AUDITOR_PREFIX=$${TALER_AUDITOR_PREFIX:-@libdir@};export TALER_BANK_PREFIX=$${TALER_BANK_PREFIX:-@libdir@}; - -TESTS = \ - $(check_SCRIPTS) - -EXTRA_DIST = \ - $(check_SCRIPTS) \ - test_bank.conf diff --git a/src/bank-lib/meson.build b/src/bank-lib/meson.build @@ -0,0 +1,153 @@ +# This build file is in the public domain + +libtalerbank = library( + 'talerbank', + [ + 'bank_api_account_token.c', + 'bank_api_admin_add_incoming.c', + 'bank_api_admin_add_kycauth.c', + 'bank_api_common.c', + 'bank_api_credit.c', + 'bank_api_debit.c', + 'bank_api_helper.c', + 'bank_api_registration.c', + 'bank_api_transfer.c', + 'bank_api_parse.c', + ], + soversion: solibversions['libtalerbank']['soversion'], + version: solibversions['libtalerbank']['soversion'], + install_rpath: rpath_option, + dependencies: [ + libtalerjson_dep, + libtalercurl_dep, + libtalerutil_dep, + gnunetmhd_dep, + gnunetcurl_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + curl_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalerbank_dep = declare_dependency(link_with: libtalerbank) +pkg.generate( + libtalerbank, + url: 'https://taler.net', + description: 'GNU Taler bank library', +) + + +libtalerfakebank = library( + 'talerfakebank', + [ + 'fakebank.c', + 'fakebank_api_check.c', + 'fakebank_common_lookup.c', + 'fakebank_common_lp.c', + 'fakebank_common_make_admin_transfer.c', + 'fakebank_common_parser.c', + 'fakebank_common_transact.c', + 'fakebank_stop.c', + 'fakebank_bank.c', + 'fakebank_bank_accounts_withdrawals.c', + 'fakebank_bank_get_accounts.c', + 'fakebank_bank_get_withdrawals.c', + 'fakebank_bank_get_root.c', + 'fakebank_bank_post_accounts_token.c', + 'fakebank_bank_post_accounts_withdrawals.c', + 'fakebank_bank_post_withdrawals_id_op.c', + 'fakebank_bank_testing_register.c', + 'fakebank_tbr.c', + 'fakebank_tbr_get_history.c', + 'fakebank_tbr_get_root.c', + 'fakebank_tbi.c', + 'fakebank_tbi_get_withdrawal_operation.c', + 'fakebank_tbi_post_withdrawal_operation.c', + 'fakebank_twg.c', + 'fakebank_twg_admin_add_incoming.c', + 'fakebank_twg_admin_add_kycauth.c', + 'fakebank_twg_get_root.c', + 'fakebank_twg_get_transfers.c', + 'fakebank_twg_get_transfers_id.c', + 'fakebank_twg_history.c', + 'fakebank_twg_transfer.c', + ], + soversion: '0.0.0', + version: '0.0.0', + install_rpath: rpath_option, + dependencies: [ + libtalerjson_dep, + libtalermhd_dep, + libtalerutil_dep, + gnunetmhd_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + mhd_dep, + curl_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalerfakebank_dep = declare_dependency(link_with: libtalerfakebank) +pkg.generate( + libtalerfakebank, + url: 'https://taler.net', + description: 'GNU Taler FAKE bank library', +) + +executable( + 'taler-fakebank-run', + ['taler-fakebank-run.c'], + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + libtalermhd_dep, + libtalerfakebank_dep, + gnunetutil_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('bindir'), +) + +executable( + 'taler-exchange-wire-gateway-client', + ['taler-exchange-wire-gateway-client.c'], + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalerbank_dep, + gnunetutil_dep, + gnunetcurl_dep, + json_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('bindir'), +) + +configure_file(input: 'test_bank.conf', output: 'test_bank.conf', copy: true) + + +test_bank = configure_file( + input: 'test_bank.sh', + output: 'test_bank.sh', + copy: true, +) + +test( + 'test_bank', + test_bank, + suite: ['bank-api'], + workdir: meson.current_build_dir(), + is_parallel: false, +) diff --git a/src/benchmark/Makefile.am b/src/benchmark/Makefile.am @@ -1,74 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include - -clean-blobs: - rm -fr exchange_benchmark_home/.local/share/taler/auditor*/ exchange_benchmark_home/.local/share/taler/exchange/wirefees/ exchange_benchmark_home/.local/share/taler/exchange/live-keys/ auditor.in - - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -bin_PROGRAMS = \ - taler-aggregator-benchmark \ - taler-bank-benchmark \ - taler-exchange-benchmark - - -taler_aggregator_benchmark_SOURCES = \ - taler-aggregator-benchmark.c -taler_aggregator_benchmark_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetjson \ - -ljansson \ - -lgnunetutil \ - $(XLIB) - -taler_bank_benchmark_SOURCES = \ - taler-bank-benchmark.c -taler_bank_benchmark_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/testing/libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/extensions/libtalerextensions.la \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -taler_exchange_benchmark_SOURCES = \ - taler-exchange-benchmark.c -taler_exchange_benchmark_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/testing/libtalertesting.la \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/extensions/libtalerextensions.la \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -EXTRA_DIST = \ - benchmark-common.conf \ - benchmark-cs.conf \ - benchmark-rsa.conf \ - bank-benchmark-cs.conf \ - bank-benchmark-rsa.conf \ - coins-cs.conf \ - coins-rsa.conf diff --git a/src/benchmark/meson.build b/src/benchmark/meson.build @@ -0,0 +1,82 @@ +# This Makefile.am is in the public domain + +#clean-blobs: +# rm -fr exchange_benchmark_home/.local/share/taler/auditor*/ exchange_benchmark_home/.local/share/taler/exchange/wirefees/ exchange_benchmark_home/.local/share/taler/exchange/live-keys/ auditor.in + + +executable( + 'taler-aggregator-benchmark', + ['taler-aggregator-benchmark.c'], + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + gnunetutil_dep, + gnunetjson_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-bank-benchmark', + ['taler-bank-benchmark.c'], + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalertesting_dep, + libtalerexchange_dep, + libtalerfakebank_dep, + libtalerbank_dep, + libtalerextensions_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-exchange-benchmark', + ['taler-exchange-benchmark.c'], + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalertesting_dep, + libtalerexchange_dep, + libtalerfakebank_dep, + libtalerbank_dep, + libtalerextensions_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +EXTRA_DIST = [ + 'benchmark-common.conf', + 'benchmark-cs.conf', + 'benchmark-rsa.conf', + 'bank-benchmark-cs.conf', + 'bank-benchmark-rsa.conf', + 'coins-cs.conf', + 'coins-rsa.conf', +] + +foreach f : EXTRA_DIST + configure_file(input: f, output: f, copy: true) +endforeach diff --git a/src/curl/Makefile.am b/src/curl/Makefile.am @@ -1,24 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -lib_LTLIBRARIES = \ - libtalercurl.la - -libtalercurl_la_LDFLAGS = \ - -version-info 0:1:0 \ - -no-undefined -libtalercurl_la_SOURCES = \ - curl.c -libtalercurl_la_LIBADD = \ - -lgnunetcurl \ - -lgnunetutil \ - -lcurl \ - -ljansson \ - -lz \ - -lm \ - $(XLIB) diff --git a/src/curl/meson.build b/src/curl/meson.build @@ -0,0 +1,27 @@ +libtalercurl_src = ['curl.c'] + +libtalercurl = library( + 'talercurl', + libtalercurl_src, + soversion: solibversions['libtalercurl']['soversion'], + version: solibversions['libtalercurl']['soversion'], + install_rpath: rpath_option, + dependencies: [ + gnunetutil_dep, + gnunetcurl_dep, + json_dep, + curl_dep, + m_dep, + zlib_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalercurl_dep = declare_dependency(link_with: libtalercurl) +pkg.generate( + libtalercurl, + url: 'https://taler.net', + description: 'GNU Taler curl wrapper library', +) diff --git a/src/exchange-tools/Makefile.am b/src/exchange-tools/Makefile.am @@ -1,83 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include - -pkgcfgdir = $(prefix)/share/taler-exchange/config.d/ - -pkgcfg_DATA = \ - coins.conf \ - exchange-offline.conf - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -bin_PROGRAMS = \ - taler-auditor-offline \ - taler-exchange-kyc-trigger \ - taler-exchange-offline \ - taler-exchange-dbinit - -taler_exchange_offline_SOURCES = \ - taler-exchange-offline.c -taler_exchange_offline_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/extensions/libtalerextensions.la \ - -lgnunetjson \ - -lgnunetcurl \ - -ljansson \ - -lgnunetutil \ - $(XLIB) - -taler_exchange_kyc_trigger_SOURCES = \ - taler-exchange-kyc-trigger.c -taler_exchange_kyc_trigger_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetjson \ - -lgnunetcurl \ - -ljansson \ - -lgnunetutil \ - $(XLIB) - -taler_auditor_offline_SOURCES = \ - taler-auditor-offline.c -taler_auditor_offline_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/extensions/libtalerextensions.la \ - -lgnunetjson \ - -lgnunetcurl \ - -ljansson \ - -lgnunetutil \ - $(XLIB) - -taler_exchange_dbinit_SOURCES = \ - taler-exchange-dbinit.c -taler_exchange_dbinit_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/pq/libtalerpq.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - -lgnunetutil \ - $(XLIB) -taler_exchange_dbinit_CPPFLAGS = \ - -I$(top_srcdir)/src/include \ - -I$(top_srcdir)/src/pq/ \ - $(POSTGRESQL_CPPFLAGS) - - -# Testcases - -AM_TESTS_ENVIRONMENT=export TALER_EXCHANGE_PREFIX=$${TALER_EXCHANGE_PREFIX:-@libdir@};export PATH=$${TALER_EXCHANGE_PREFIX:-@prefix@}/bin:$$PATH; - -# Distribution - -EXTRA_DIST = \ - $(pkgcfg_DATA) diff --git a/src/exchange-tools/meson.build b/src/exchange-tools/meson.build @@ -0,0 +1,72 @@ +# This build file is in the public domain + +install_data('coins.conf', 'exchange-offline.conf', install_dir: pkgcfgedir) + +executable( + 'taler-exchange-offline', + ['taler-exchange-offline.c'], + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalerexchange_dep, + libtalerextensions_dep, + gnunetjson_dep, + gnunetutil_dep, + gnunetcurl_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-exchange-kyc-trigger', + ['taler-exchange-kyc-trigger.c'], + dependencies: [ + libtalerutil_dep, + libtalerexchange_dep, + gnunetjson_dep, + gnunetutil_dep, + gnunetcurl_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-auditor-offline', + ['taler-auditor-offline.c'], + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalerexchange_dep, + libtalerextensions_dep, + gnunetjson_dep, + gnunetutil_dep, + gnunetcurl_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-exchange-dbinit', + ['taler-exchange-dbinit.c'], + dependencies: [ + libtalerutil_dep, + libtalerpq_dep, + libtalerexchangedb_dep, + gnunetutil_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) diff --git a/src/exchange/Makefile.am b/src/exchange/Makefile.am @@ -1,259 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = \ - -I$(top_srcdir)/src/include \ - $(LIBGCRYPT_CFLAGS) \ - $(POSTGRESQL_CPPFLAGS) - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -pkgcfgadir = $(prefix)/share/taler-auditor/config.d/ -pkgcfgedir = $(prefix)/share/taler-exchange/config.d/ - -# Auditor also needs to access the exchange config, so we install -# the exchange configuration for it here as well! -pkgcfga_DATA = \ - exchange.conf - -pkgcfge_DATA = \ - exchange.conf - -# Programs -bin_SCRIPTS = \ - taler-exchange-kyc-aml-pep-trigger.sh - -bin_PROGRAMS = \ - taler-exchange-aggregator \ - taler-exchange-closer \ - taler-exchange-drain \ - taler-exchange-expire \ - taler-exchange-httpd \ - taler-exchange-router \ - taler-exchange-sanctionscheck \ - taler-exchange-transfer \ - taler-exchange-wirewatch - -taler_exchange_aggregator_SOURCES = \ - taler-exchange-aggregator.c -taler_exchange_aggregator_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/kyclogic/libtalerkyclogic.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - - -taler_exchange_closer_SOURCES = \ - taler-exchange-closer.c -taler_exchange_closer_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - -ljansson \ - -lgnunetcurl \ - -lgnunetutil \ - $(XLIB) - -taler_exchange_drain_SOURCES = \ - taler-exchange-drain.c -taler_exchange_drain_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - -ljansson \ - -lgnunetcurl \ - -lgnunetutil \ - $(XLIB) - -taler_exchange_expire_SOURCES = \ - taler-exchange-expire.c -taler_exchange_expire_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - -ljansson \ - -lgnunetcurl \ - -lgnunetutil \ - $(XLIB) - -taler_exchange_router_SOURCES = \ - taler-exchange-router.c -taler_exchange_router_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - -ljansson \ - -lgnunetcurl \ - -lgnunetutil \ - $(XLIB) - -taler_exchange_sanctionscheck_SOURCES = \ - taler-exchange-sanctionscheck.c -taler_exchange_sanctionscheck_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/kyclogic/libtalerkyclogic.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - -lgnunetjson \ - -ljansson \ - -lgnunetutil \ - -lm \ - $(XLIB) - -taler_exchange_transfer_SOURCES = \ - taler-exchange-transfer.c -taler_exchange_transfer_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - -ljansson \ - -lgnunetcurl \ - -lgnunetutil \ - $(XLIB) - -taler_exchange_wirewatch_SOURCES = \ - taler-exchange-wirewatch.c -taler_exchange_wirewatch_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - -ljansson \ - -lgnunetcurl \ - -lgnunetutil \ - $(XLIB) - - -taler_exchange_httpd_SOURCES = \ - taler-exchange-httpd.c taler-exchange-httpd.h \ - taler-exchange-httpd_get-aml-OFFICER_PUB-accounts.c taler-exchange-httpd_get-aml-OFFICER_PUB-accounts.h \ - taler-exchange-httpd_get-aml-OFFICER_PUB-attributes-H_NORMALIZED_PAYTO.c taler-exchange-httpd_get-aml-OFFICER_PUB-attributes-H_NORMALIZED_PAYTO.h \ - taler-exchange-httpd_post-aml-OFFICER_PUB-decision.c taler-exchange-httpd_post-aml-OFFICER_PUB-decision.h \ - taler-exchange-httpd_get-aml-OFFICER_PUB-decisions.c \ - taler-exchange-httpd_get-aml-OFFICER_PUB-legitimizations.c taler-exchange-httpd_get-aml-OFFICER_PUB-legitimizations.h \ - taler-exchange-httpd_get-aml-OFFICER_PUB-kyc-statistics-NAMES.c taler-exchange-httpd_get-aml-OFFICER_PUB-kyc-statistics-NAMES.h \ - taler-exchange-httpd_get-aml-OFFICER_PUB-measures.c taler-exchange-httpd_get-aml-OFFICER_PUB-measures.h \ - taler-exchange-httpd_get-aml-OFFICER_PUB-transfers.c taler-exchange-httpd_get-aml-OFFICER_PUB-transfers.h \ - taler-exchange-httpd_post-auditors-AUDITOR_PUB-H_DENOM_PUB.c taler-exchange-httpd_post-auditors-AUDITOR_PUB-H_DENOM_PUB.h \ - taler-exchange-httpd_post-batch-deposit.c taler-exchange-httpd_post-batch-deposit.h \ - taler-exchange-httpd_post-blinding-prepare.c taler-exchange-httpd_post-blinding-prepare.h \ - taler-exchange-httpd_get-coins-COIN_PUB-history.c taler-exchange-httpd_get-coins-COIN_PUB-history.h \ - taler-exchange-httpd_common_deposit.c taler-exchange-httpd_common_deposit.h \ - taler-exchange-httpd_common_kyc.c taler-exchange-httpd_common_kyc.h \ - taler-exchange-httpd_get-config.c taler-exchange-httpd_get-config.h \ - taler-exchange-httpd_get-contracts-CONTRACT_PUB.c taler-exchange-httpd_get-contracts-CONTRACT_PUB.h \ - taler-exchange-httpd_db.c taler-exchange-httpd_db.h \ - taler-exchange-httpd_get-deposits.c taler-exchange-httpd_get-deposits.h \ - taler-exchange-httpd_extensions.c taler-exchange-httpd_extensions.h \ - taler-exchange-httpd_get-keys.c taler-exchange-httpd_get-keys.h \ - taler-exchange-httpd_get-kyc-check-H_NORMALIZED_PAYTO.c taler-exchange-httpd_get-kyc-check-H_NORMALIZED_PAYTO.h \ - taler-exchange-httpd_get-kyc-info-ACCESS_TOKEN.c taler-exchange-httpd_get-kyc-info-ACCESS_TOKEN.h \ - taler-exchange-httpd_get-kyc-proof-PROVIDER_NAME.c taler-exchange-httpd_get-kyc-proof-PROVIDER_NAME.h \ - taler-exchange-httpd_post-kyc-start-ID.c taler-exchange-httpd_post-kyc-start-ID.h \ - taler-exchange-httpd_post-kyc-upload-ID.c taler-exchange-httpd_post-kyc-upload-ID.h \ - taler-exchange-httpd_post-kyc-wallet.c taler-exchange-httpd_post-kyc-wallet.h \ - taler-exchange-httpd_kyc-webhook.c taler-exchange-httpd_kyc-webhook.h \ - taler-exchange-httpd_management.h \ - taler-exchange-httpd_post-management-aml-officers.c \ - taler-exchange-httpd_post-management-auditors.c \ - taler-exchange-httpd_post-management-auditors-AUDITOR_PUB-disable.c \ - taler-exchange-httpd_post-management-denominations-H_DENOM_PUB-revoke.c \ - taler-exchange-httpd_post-management-drain.c \ - taler-exchange-httpd_post-management-extensions.c \ - taler-exchange-httpd_post-management-global-fees.c \ - taler-exchange-httpd_post-management-partners.c \ - taler-exchange-httpd_post-management-keys.c \ - taler-exchange-httpd_post-management-signkeys-EXCHANGE_PUB-revoke.c \ - taler-exchange-httpd_post-management-wire.c \ - taler-exchange-httpd_post-management-wire-disable.c \ - taler-exchange-httpd_post-management-wire-fee.c \ - taler-exchange-httpd_post-melt.c taler-exchange-httpd_post-melt.h \ - taler-exchange-httpd_get-metrics.c taler-exchange-httpd_get-metrics.h \ - taler-exchange-httpd_mhd.c taler-exchange-httpd_mhd.h \ - taler-exchange-httpd_post-purses-PURSE_PUB-create.c taler-exchange-httpd_post-purses-PURSE_PUB-create.h \ - taler-exchange-httpd_post-purses-PURSE_PUB-deposit.c taler-exchange-httpd_post-purses-PURSE_PUB-deposit.h \ - taler-exchange-httpd_delete-purses-PURSE_PUB.c taler-exchange-httpd_delete-purses-PURSE_PUB.h \ - taler-exchange-httpd_get-purses-PURSE_PUB-merge.c taler-exchange-httpd_get-purses-PURSE_PUB-merge.h \ - taler-exchange-httpd_post-purses-PURSE_PUB-merge.c taler-exchange-httpd_post-purses-PURSE_PUB-merge.h \ - taler-exchange-httpd_post-recoup-withdraw.c taler-exchange-httpd_post-recoup-withdraw.h \ - taler-exchange-httpd_post-recoup-refresh.c taler-exchange-httpd_post-recoup-refresh.h \ - taler-exchange-httpd_post-coins-COIN_PUB-refund.c taler-exchange-httpd_post-coins-COIN_PUB-refund.h \ - taler-exchange-httpd_post-reserves-RESERVE_PUB-attest.c taler-exchange-httpd_post-reserves-RESERVE_PUB-attest.h \ - taler-exchange-httpd_post-reserves-RESERVE_PUB-close.c taler-exchange-httpd_post-reserves-RESERVE_PUB-close.h \ - taler-exchange-httpd_get-reserves-RESERVE_PUB.c taler-exchange-httpd_get-reserves-RESERVE_PUB.h \ - taler-exchange-httpd_get-reserves-RESERVE_PUB-attest.c taler-exchange-httpd_get-reserves-RESERVE_PUB-attest.h \ - taler-exchange-httpd_get-reserves-RESERVE_PUB-history.c taler-exchange-httpd_get-reserves-RESERVE_PUB-history.h \ - taler-exchange-httpd_post-reserves-RESERVE_PUB-open.c taler-exchange-httpd_post-reserves-RESERVE_PUB-open.h \ - taler-exchange-httpd_post-reserves-RESERVE_PUB-purse.c taler-exchange-httpd_post-reserves-RESERVE_PUB-purse.h \ - taler-exchange-httpd_responses.c taler-exchange-httpd_responses.h \ - taler-exchange-httpd_post-reveal-melt.c taler-exchange-httpd_post-reveal-melt.h \ - taler-exchange-httpd_post-reveal-withdraw.c taler-exchange-httpd_post-reveal-withdraw.h \ - taler-exchange-httpd_get-SPA.c taler-exchange-httpd_get-SPA.h \ - taler-exchange-httpd_get-TERMS.c taler-exchange-httpd_get-TERMS.h \ - taler-exchange-httpd_get-transfers-WTID.c taler-exchange-httpd_get-transfers-WTID.h \ - taler-exchange-httpd_post-withdraw.c taler-exchange-httpd_post-withdraw.h - - -taler_exchange_httpd_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/mhd/libtalermhd.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/templating/libtalertemplating.la \ - $(top_builddir)/src/kyclogic/libtalerkyclogic.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/extensions/libtalerextensions.la \ - -lmicrohttpd \ - -lgnunetcurl \ - -lgnunetjson \ - -lgnunetutil \ - -ljansson \ - -lcurl \ - -lz \ - $(XLIB) - -# Testcases - -AM_TESTS_ENVIRONMENT=export TALER_EXCHANGE_PREFIX=$${TALER_EXCHANGE_PREFIX:-@libdir@};export PATH=$${TALER_EXCHANGE_PREFIX:-@prefix@}/bin:$$PATH; - -check_SCRIPTS = \ - test_taler_exchange_httpd.sh -if HAVE_EXPENSIVE_TESTS -check_SCRIPTS += \ - test_taler_exchange_httpd_afl.sh -endif - -TESTS = \ - $(check_SCRIPTS) - -# Distribution - -EXTRA_DIST = \ - test_taler_exchange_httpd_home/.local/share/taler/exchange/offline-keys/master.priv \ - test_taler_exchange_httpd.conf \ - test_taler_exchange_unix.conf \ - test_taler_exchange_httpd.get \ - test_taler_exchange_httpd.post \ - exchange.conf \ - $(bin_SCRIPTS) \ - $(check_SCRIPTS) diff --git a/src/exchange/meson.build b/src/exchange/meson.build @@ -0,0 +1,300 @@ +# This build_file is in the public domain + +# Auditor also needs to access the exchange config, so we install +# the exchange configuration for it here as well! +install_data('exchange.conf', install_dir: pkgcfgadir) + +install_data('exchange.conf', install_dir: pkgcfgedir) + +# Programs +configure_file( + input: 'taler-exchange-kyc-aml-pep-trigger.sh', + output: 'taler-exchange-kyc-aml-pep-trigger.sh', + install: true, + copy: true, + install_dir: get_option('bindir'), +) + +executable( + 'taler-exchange-aggregator', + ['taler-exchange-aggregator.c'], + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerbank_dep, + libtalerkyclogic_dep, + gnunetutil_dep, + gnunetcurl_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-exchange-closer', + ['taler-exchange-closer.c'], + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerbank_dep, + gnunetutil_dep, + gnunetcurl_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-exchange-drain', + ['taler-exchange-drain.c'], + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerbank_dep, + gnunetutil_dep, + gnunetcurl_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-exchange-expire', + ['taler-exchange-expire.c'], + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerbank_dep, + gnunetutil_dep, + gnunetcurl_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-exchange-router', + ['taler-exchange-router.c'], + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerbank_dep, + gnunetutil_dep, + gnunetcurl_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-exchange-sanctionscheck', + ['taler-exchange-sanctionscheck.c'], + dependencies: [ + libtalerkyclogic_dep, + libtalerutil_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + gnunetutil_dep, + gnunetjson_dep, + gcrypt_dep, + json_dep, + m_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-exchange-transfer', + ['taler-exchange-transfer.c'], + dependencies: [ + libtalerbank_dep, + libtalerutil_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + gnunetutil_dep, + gnunetcurl_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-exchange-wirewatch', + ['taler-exchange-wirewatch.c'], + dependencies: [ + libtalerbank_dep, + libtalerutil_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + gnunetutil_dep, + gnunetcurl_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +taler_exchange_httpd_SOURCES = [ + 'taler-exchange-httpd.c', + 'taler-exchange-httpd_get-aml-OFFICER_PUB-accounts.c', + 'taler-exchange-httpd_get-aml-OFFICER_PUB-attributes-H_NORMALIZED_PAYTO.c', + 'taler-exchange-httpd_post-aml-OFFICER_PUB-decision.c', + 'taler-exchange-httpd_get-aml-OFFICER_PUB-decisions.c', + 'taler-exchange-httpd_get-aml-OFFICER_PUB-legitimizations.c', + 'taler-exchange-httpd_get-aml-OFFICER_PUB-kyc-statistics-NAMES.c', + 'taler-exchange-httpd_get-aml-OFFICER_PUB-measures.c', + 'taler-exchange-httpd_get-aml-OFFICER_PUB-transfers.c', + 'taler-exchange-httpd_post-auditors-AUDITOR_PUB-H_DENOM_PUB.c', + 'taler-exchange-httpd_post-batch-deposit.c', + 'taler-exchange-httpd_post-blinding-prepare.c', + 'taler-exchange-httpd_get-coins-COIN_PUB-history.c', + 'taler-exchange-httpd_common_deposit.c', + 'taler-exchange-httpd_common_kyc.c', + 'taler-exchange-httpd_get-config.c', + 'taler-exchange-httpd_get-contracts-CONTRACT_PUB.c', + 'taler-exchange-httpd_db.c', + 'taler-exchange-httpd_get-deposits.c', + 'taler-exchange-httpd_extensions.c', + 'taler-exchange-httpd_get-keys.c', + 'taler-exchange-httpd_get-kyc-check-H_NORMALIZED_PAYTO.c', + 'taler-exchange-httpd_get-kyc-info-ACCESS_TOKEN.c', + 'taler-exchange-httpd_get-kyc-proof-PROVIDER_NAME.c', + 'taler-exchange-httpd_post-kyc-start-ID.c', + 'taler-exchange-httpd_post-kyc-upload-ID.c', + 'taler-exchange-httpd_post-kyc-wallet.c', + 'taler-exchange-httpd_kyc-webhook.c', + 'taler-exchange-httpd_post-management-aml-officers.c', + 'taler-exchange-httpd_post-management-auditors.c', + 'taler-exchange-httpd_post-management-auditors-AUDITOR_PUB-disable.c', + 'taler-exchange-httpd_post-management-denominations-H_DENOM_PUB-revoke.c', + 'taler-exchange-httpd_post-management-drain.c', + 'taler-exchange-httpd_post-management-extensions.c', + 'taler-exchange-httpd_post-management-global-fees.c', + 'taler-exchange-httpd_post-management-partners.c', + 'taler-exchange-httpd_post-management-keys.c', + 'taler-exchange-httpd_post-management-signkeys-EXCHANGE_PUB-revoke.c', + 'taler-exchange-httpd_post-management-wire.c', + 'taler-exchange-httpd_post-management-wire-disable.c', + 'taler-exchange-httpd_post-management-wire-fee.c', + 'taler-exchange-httpd_post-melt.c', + 'taler-exchange-httpd_get-metrics.c', + 'taler-exchange-httpd_mhd.c', + 'taler-exchange-httpd_post-purses-PURSE_PUB-create.c', + 'taler-exchange-httpd_post-purses-PURSE_PUB-deposit.c', + 'taler-exchange-httpd_delete-purses-PURSE_PUB.c', + 'taler-exchange-httpd_get-purses-PURSE_PUB-merge.c', + 'taler-exchange-httpd_post-purses-PURSE_PUB-merge.c', + 'taler-exchange-httpd_post-recoup-withdraw.c', + 'taler-exchange-httpd_post-recoup-refresh.c', + 'taler-exchange-httpd_post-coins-COIN_PUB-refund.c', + 'taler-exchange-httpd_post-reserves-RESERVE_PUB-attest.c', + 'taler-exchange-httpd_post-reserves-RESERVE_PUB-close.c', + 'taler-exchange-httpd_get-reserves-RESERVE_PUB.c', + 'taler-exchange-httpd_get-reserves-RESERVE_PUB-attest.c', + 'taler-exchange-httpd_get-reserves-RESERVE_PUB-history.c', + 'taler-exchange-httpd_post-reserves-RESERVE_PUB-open.c', + 'taler-exchange-httpd_post-reserves-RESERVE_PUB-purse.c', + 'taler-exchange-httpd_responses.c', + 'taler-exchange-httpd_post-reveal-melt.c', + 'taler-exchange-httpd_post-reveal-withdraw.c', + 'taler-exchange-httpd_get-SPA.c', + 'taler-exchange-httpd_get-TERMS.c', + 'taler-exchange-httpd_get-transfers-WTID.c', + 'taler-exchange-httpd_post-withdraw.c', +] + +executable( + 'taler-exchange-httpd', + taler_exchange_httpd_SOURCES, + dependencies: [ + libtalerbank_dep, + libtalermhd_dep, + libtalerutil_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerextensions_dep, + libtalerkyclogic_dep, + libtalertemplating_dep, + gnunetutil_dep, + gnunetcurl_dep, + gnunetjson_dep, + gcrypt_dep, + json_dep, + mhd_dep, + zlib_dep, + curl_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +# Testcases + +test_taler_exchange_httpd = configure_file( + input: 'test_taler_exchange_httpd.sh', + output: 'test_taler_exchange_httpd.sh', + copy: true, +) +test( + 'test_taler_exchange_httpd', + test_taler_exchange_httpd, + workdir: meson.current_build_dir(), + suite: ['exchange', 'installcheck'], +) +test_taler_exchange_httpd_afl = configure_file( + input: 'test_taler_exchange_httpd_afl.sh', + output: 'test_taler_exchange_httpd_afl.sh', + copy: true, +) +configure_file( + input: 'test_taler_exchange_httpd.conf', + output: 'test_taler_exchange_httpd.conf', + copy: true, +) +configure_file( + input: 'test_taler_exchange_httpd.post', + output: 'test_taler_exchange_httpd.post', + copy: true, +) +configure_file( + input: 'test_taler_exchange_httpd.get', + output: 'test_taler_exchange_httpd.get', + copy: true, +) + +if get_option('expensivetests') + test( + 'test_taler_exchange_httpd_afl', + test_taler_exchange_httpd_afl, + workdir: meson.current_build_dir(), + suite: ['exchange', 'installcheck'], + ) +endif diff --git a/src/exchange/test_taler_exchange_httpd.sh b/src/exchange/test_taler_exchange_httpd.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # This file is part of TALER # Copyright (C) 2015-2020, 2023 Taler Systems SA diff --git a/src/exchange/test_taler_exchange_httpd_afl.sh b/src/exchange/test_taler_exchange_httpd_afl.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # This file is part of TALER # Copyright (C) 2015, 2020 Taler Systems SA diff --git a/src/exchangedb/Makefile.am b/src/exchangedb/Makefile.am @@ -1,443 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/pq/ $(POSTGRESQL_CPPFLAGS) - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -pkgcfgadir = $(prefix)/share/taler-auditor/config.d/ -pkgcfgedir = $(prefix)/share/taler-exchange/config.d/ - -# Auditor also needs to access the exchange DB, so we install -# the exchange configuration for it here as well! -pkgcfga_DATA = \ - exchangedb.conf \ - exchangedb-postgres.conf - -pkgcfge_DATA = \ - exchangedb.conf \ - exchangedb-postgres.conf - -sqldir = $(prefix)/share/taler-exchange/sql/ - -sqlinputs = \ - exchange_do_*.sql \ - exchange_statistics_*.sql \ - exchange_trigger_*.sql \ - *.sql.in \ - 0002-*.sql \ - 0003-*.sql \ - 0004-*.sql \ - 0009-*.sql \ - 0010-*.sql - -sql_DATA = \ - benchmark-0001.sql \ - versioning.sql \ - auditor-triggers-0001.sql \ - exchange-0001.sql \ - exchange-0002.sql \ - exchange-0003.sql \ - exchange-0004.sql \ - exchange-0005.sql \ - exchange-0006.sql \ - exchange-0007.sql \ - exchange-0008.sql \ - exchange-0009.sql \ - exchange-0010.sql \ - drop.sql \ - procedures.sql \ - tops-0001.sql - -BUILT_SOURCES = \ - benchmark-0001.sql \ - drop.sql \ - exchange-0001.sql \ - procedures.sql - -CLEANFILES = \ - exchange-0002.sql \ - exchange-0003.sql \ - exchange-0004.sql \ - exchange-0009.sql \ - exchange-0010.sql \ - procedures.sql - -procedures.sql: procedures.sql.in exchange_do_*.sql exchange_statistics_*.sql exchange_trigger_*.sql - chmod +w $@ 2> /dev/null || true - gcc -E -P -undef - < procedures.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ - chmod ugo-w $@ - -exchange-0002.sql: exchange-0002.sql.in 0002-*.sql - chmod +w $@ 2> /dev/null || true - gcc -E -P -undef - < exchange-0002.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ - chmod ugo-w $@ - -exchange-0003.sql: exchange-0003.sql.in 0003-*.sql - chmod +w $@ 2> /dev/null || true - gcc -E -P -undef - < exchange-0003.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ - chmod ugo-w $@ - -exchange-0004.sql: exchange-0004.sql.in 0004-*.sql - chmod +w $@ 2> /dev/null || true - gcc -E -P -undef - < exchange-0004.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ - chmod ugo-w $@ - -exchange-0009.sql: exchange-0009.sql.in 0009-*.sql - chmod +w $@ 2> /dev/null || true - gcc -E -P -undef - < exchange-0009.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ - chmod ugo-w $@ - -exchange-0010.sql: exchange-0010.sql.in 0010-*.sql - chmod +w $@ 2> /dev/null || true - gcc -E -P -undef - < exchange-0010.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ - chmod ugo-w $@ - -check_SCRIPTS = \ - test_idempotency.sh - -EXTRA_DIST = \ - exchangedb.conf \ - exchangedb-postgres.conf \ - bench-db-postgres.conf \ - test-exchange-db-postgres.conf \ - $(sqlinputs) \ - $(sql_DATA) \ - $(check_SCRIPTS) \ - pg_template.h pg_template.c \ - pg_template.sh - -plugindir = $(libdir)/taler-exchange - -if HAVE_POSTGRESQL -plugin_LTLIBRARIES = \ - libtaler_plugin_exchangedb_postgres.la -endif - -libtaler_plugin_exchangedb_postgres_la_SOURCES = \ - pg_abort_shard.h pg_abort_shard.c \ - pg_activate_signing_key.h pg_activate_signing_key.c \ - pg_add_denomination_key.h pg_add_denomination_key.c \ - pg_add_policy_fulfillment_proof.h pg_add_policy_fulfillment_proof.c \ - pg_aggregate.h pg_aggregate.c \ - pg_batch_ensure_coin_known.h pg_batch_ensure_coin_known.c \ - pg_begin_revolving_shard.h pg_begin_revolving_shard.c \ - pg_begin_shard.h pg_begin_shard.c \ - pg_clear_aml_lock.h pg_clear_aml_lock.c \ - pg_commit.h pg_commit.c \ - pg_complete_shard.h pg_complete_shard.c \ - pg_compute_shard.h pg_compute_shard.c \ - pg_count_known_coins.h pg_count_known_coins.c \ - pg_create_aggregation_transient.h pg_create_aggregation_transient.c \ - pg_create_tables.h pg_create_tables.c \ - pg_delete_aggregation_transient.h pg_delete_aggregation_transient.c \ - pg_delete_shard_locks.h pg_delete_shard_locks.c \ - pg_disable_rules.h pg_disable_rules.c \ - pg_do_withdraw.h pg_do_withdraw.c \ - pg_do_check_deposit_idempotent.h pg_do_check_deposit_idempotent.c \ - pg_do_deposit.h pg_do_deposit.c \ - pg_do_refresh.h pg_do_refresh.c \ - pg_do_purse_delete.c pg_do_purse_delete.h \ - pg_do_purse_deposit.h pg_do_purse_deposit.c \ - pg_do_purse_merge.h pg_do_purse_merge.c \ - pg_do_recoup.h pg_do_recoup.c \ - pg_do_recoup_refresh.h pg_do_recoup_refresh.c \ - pg_do_refund.h pg_do_refund.c \ - pg_do_reserve_open.c pg_do_reserve_open.h \ - pg_do_reserve_purse.h pg_do_reserve_purse.c \ - pg_drain_kyc_alert.h pg_drain_kyc_alert.c \ - pg_drop_tables.h pg_drop_tables.c \ - pg_enable_rules.h pg_enable_rules.c \ - pg_ensure_coin_known.h pg_ensure_coin_known.c \ - pg_event_listen.h pg_event_listen.c \ - pg_event_listen_cancel.h pg_event_listen_cancel.c \ - pg_event_notify.h pg_event_notify.c \ - pg_expire_purse.h pg_expire_purse.c \ - pg_find_aggregation_transient.h pg_find_aggregation_transient.c \ - pg_gc.h pg_gc.c \ - pg_get_coin_denomination.h pg_get_coin_denomination.c \ - pg_get_coin_transactions.c pg_get_coin_transactions.h \ - pg_get_denomination_info.h pg_get_denomination_info.c \ - pg_get_denomination_by_serial.h pg_get_denomination_by_serial.c \ - pg_get_denomination_revocation.h pg_get_denomination_revocation.c \ - pg_get_drain_profit.h pg_get_drain_profit.c \ - pg_get_expired_reserves.c pg_get_expired_reserves.h \ - pg_get_extension_manifest.h pg_get_extension_manifest.c \ - pg_get_global_fee.h pg_get_global_fee.c \ - pg_get_global_fees.h pg_get_global_fees.c \ - pg_get_known_coin.h pg_get_known_coin.c \ - pg_get_kyc_rules.h pg_get_kyc_rules.c \ - pg_get_refresh.h pg_get_refresh.c \ - pg_get_old_coin_by_h_blind.h pg_get_old_coin_by_h_blind.c \ - pg_get_pending_kyc_requirement_process.h pg_get_pending_kyc_requirement_process.c \ - pg_get_policy_details.h pg_get_policy_details.c \ - pg_get_purse_deposit.h pg_get_purse_deposit.c \ - pg_get_purse_request.c pg_get_purse_request.h \ - pg_get_ready_deposit.h pg_get_ready_deposit.c \ - pg_get_reserve_balance.h pg_get_reserve_balance.c \ - pg_get_reserve_by_h_planchets.h pg_get_reserve_by_h_planchets.c \ - pg_get_reserve_history.c pg_get_reserve_history.h \ - pg_get_signature_for_known_coin.h pg_get_signature_for_known_coin.c \ - pg_get_unfinished_close_requests.c pg_get_unfinished_close_requests.h \ - pg_get_wire_accounts.h pg_get_wire_accounts.c \ - pg_get_wire_fee.h pg_get_wire_fee.c \ - pg_get_wire_fees.h pg_get_wire_fees.c \ - pg_get_wire_hash_for_contract.h pg_get_wire_hash_for_contract.c \ - pg_get_withdraw.h pg_get_withdraw.c \ - pg_have_deposit2.h pg_have_deposit2.c \ - pg_helper.h \ - pg_inject_auditor_triggers.h pg_inject_auditor_triggers.c \ - pg_insert_active_legitimization_measure.h pg_insert_active_legitimization_measure.c \ - pg_insert_aml_decision.h pg_insert_aml_decision.c \ - pg_insert_aml_officer.h pg_insert_aml_officer.c \ - pg_insert_aml_program_failure.h pg_insert_aml_program_failure.c \ - pg_insert_auditor.h pg_insert_auditor.c \ - pg_insert_auditor_denom_sig.h pg_insert_auditor_denom_sig.c \ - pg_insert_close_request.c pg_insert_close_request.h \ - pg_insert_contract.h pg_insert_contract.c \ - pg_insert_denomination_info.h pg_insert_denomination_info.c \ - pg_insert_denomination_revocation.h pg_insert_denomination_revocation.c \ - pg_insert_drain_profit.h pg_insert_drain_profit.c \ - pg_insert_global_fee.h pg_insert_global_fee.c \ - pg_insert_kyc_failure.h pg_insert_kyc_failure.c \ - pg_insert_kyc_requirement_process.h pg_insert_kyc_requirement_process.c \ - pg_insert_partner.h pg_insert_partner.c \ - pg_insert_purse_request.h pg_insert_purse_request.c \ - pg_insert_records_by_table.c pg_insert_records_by_table.h \ - pg_insert_refund.h pg_insert_refund.c \ - pg_insert_reserve_closed.h pg_insert_reserve_closed.c \ - pg_insert_reserve_open_deposit.c pg_insert_reserve_open_deposit.h \ - pg_insert_sanction_list_hit.h pg_insert_sanction_list_hit.c \ - pg_insert_signkey_revocation.h pg_insert_signkey_revocation.c \ - pg_insert_successor_measure.h pg_insert_successor_measure.c \ - pg_insert_wire.h pg_insert_wire.c \ - pg_insert_wire_fee.h pg_insert_wire_fee.c \ - pg_iterate_active_auditors.h pg_iterate_active_auditors.c \ - pg_iterate_active_signkeys.h pg_iterate_active_signkeys.c \ - pg_iterate_auditor_denominations.h pg_iterate_auditor_denominations.c \ - pg_iterate_denomination_info.h pg_iterate_denomination_info.c \ - pg_iterate_denominations.h pg_iterate_denominations.c \ - pg_iterate_kyc_reference.c pg_iterate_kyc_reference.h \ - pg_iterate_reserve_close_info.c pg_iterate_reserve_close_info.h \ - pg_kyc_provider_account_lookup.h pg_kyc_provider_account_lookup.c \ - pg_kycauth_in_insert.h pg_kycauth_in_insert.c \ - pg_lookup_active_legitimization.h pg_lookup_active_legitimization.c \ - pg_lookup_aml_file_number.h pg_lookup_aml_file_number.c \ - pg_lookup_aml_history.h pg_lookup_aml_history.c \ - pg_lookup_aml_officer.h pg_lookup_aml_officer.c \ - pg_lookup_auditor_status.h pg_lookup_auditor_status.c \ - pg_lookup_auditor_timestamp.h pg_lookup_auditor_timestamp.c \ - pg_lookup_completed_legitimization.h pg_lookup_completed_legitimization.c \ - pg_lookup_denomination_key.h pg_lookup_denomination_key.c \ - pg_lookup_global_fee_by_time.h pg_lookup_global_fee_by_time.c \ - pg_lookup_h_payto_by_access_token.h pg_lookup_h_payto_by_access_token.c \ - pg_lookup_kyc_history.h pg_lookup_kyc_history.c \ - pg_lookup_kyc_process_by_account.h pg_lookup_kyc_process_by_account.c \ - pg_lookup_kyc_requirement_by_row.h pg_lookup_kyc_requirement_by_row.c \ - pg_lookup_kyc_status_by_token.h pg_lookup_kyc_status_by_token.c \ - pg_lookup_pending_legitimization.h pg_lookup_pending_legitimization.c \ - pg_lookup_records_by_table.c pg_lookup_records_by_table.h \ - pg_lookup_rules_by_access_token.h pg_lookup_rules_by_access_token.c \ - pg_lookup_serial_by_table.c pg_lookup_serial_by_table.h \ - pg_lookup_signing_key.h pg_lookup_signing_key.c \ - pg_lookup_signkey_revocation.h pg_lookup_signkey_revocation.c \ - pg_lookup_transfer_by_deposit.h pg_lookup_transfer_by_deposit.c \ - pg_lookup_wire_fee_by_time.h pg_lookup_wire_fee_by_time.c \ - pg_lookup_wire_timestamp.h pg_lookup_wire_timestamp.c \ - pg_lookup_wire_transfer.h pg_lookup_wire_transfer.c \ - pg_mark_refresh_reveal_success.h pg_mark_refresh_reveal_success.c \ - pg_persist_kyc_attributes.h pg_persist_kyc_attributes.c \ - pg_persist_policy_details.h pg_persist_policy_details.c \ - pg_preflight.h pg_preflight.c \ - pg_profit_drains_get_pending.h pg_profit_drains_get_pending.c \ - pg_profit_drains_set_finished.h pg_profit_drains_set_finished.c \ - pg_release_revolving_shard.h pg_release_revolving_shard.c \ - pg_reserves_get.h pg_reserves_get.c \ - pg_reserves_get_origin.h pg_reserves_get_origin.c \ - pg_reserves_in_insert.h pg_reserves_in_insert.c \ - pg_reserves_update.h pg_reserves_update.c \ - pg_rollback.h pg_rollback.c \ - pg_select_account_merges_above_serial_id.h pg_select_account_merges_above_serial_id.c \ - pg_select_aggregation_amounts_for_kyc_check.h pg_select_aggregation_amounts_for_kyc_check.c \ - pg_select_aggregation_transient.h pg_select_aggregation_transient.c \ - pg_select_aggregations_above_serial.h pg_select_aggregations_above_serial.c \ - pg_select_all_kyc_attributes.h pg_select_all_kyc_attributes.c \ - pg_select_all_purse_decisions_above_serial_id.h pg_select_all_purse_decisions_above_serial_id.c \ - pg_select_all_purse_deletions_above_serial_id.h pg_select_all_purse_deletions_above_serial_id.c \ - pg_select_aml_attributes.h pg_select_aml_attributes.c \ - pg_select_aml_decisions.h pg_select_aml_decisions.c \ - pg_select_aml_measures.h pg_select_aml_measures.c \ - pg_select_aml_statistics.h pg_select_aml_statistics.c \ - pg_select_auditor_denom_sig.h pg_select_auditor_denom_sig.c \ - pg_select_batch_deposits_missing_wire.h pg_select_batch_deposits_missing_wire.c \ - pg_select_coin_deposits_above_serial_id.h pg_select_coin_deposits_above_serial_id.c \ - pg_select_contract.h pg_select_contract.c \ - pg_select_contract_by_purse.h pg_select_contract_by_purse.c \ - pg_select_deposit_amounts_for_kyc_check.h pg_select_deposit_amounts_for_kyc_check.c \ - pg_select_exchange_credit_transfers.h pg_select_exchange_credit_transfers.c \ - pg_select_exchange_kycauth_transfers.h pg_select_exchange_kycauth_transfers.c \ - pg_select_exchange_debit_transfers.h pg_select_exchange_debit_transfers.c \ - pg_select_kyc_accounts.h pg_select_kyc_accounts.c \ - pg_select_kyc_attributes.h pg_select_kyc_attributes.c \ - pg_select_merge_amounts_for_kyc_check.h pg_select_merge_amounts_for_kyc_check.c \ - pg_select_purse.h pg_select_purse.c \ - pg_select_purse_by_merge_pub.h pg_select_purse_by_merge_pub.c \ - pg_select_purse_decisions_above_serial_id.h pg_select_purse_decisions_above_serial_id.c \ - pg_select_purse_deposits_above_serial_id.h pg_select_purse_deposits_above_serial_id.c \ - pg_select_purse_deposits_by_purse.h pg_select_purse_deposits_by_purse.c \ - pg_select_purse_merge.h pg_select_purse_merge.c \ - pg_select_purse_merges_above_serial_id.h pg_select_purse_merges_above_serial_id.c \ - pg_select_purse_requests_above_serial_id.h pg_select_purse_requests_above_serial_id.c \ - pg_select_recoup_above_serial_id.h pg_select_recoup_above_serial_id.c \ - pg_select_recoup_refresh_above_serial_id.h pg_select_recoup_refresh_above_serial_id.c \ - pg_select_refreshes_above_serial_id.h pg_select_refreshes_above_serial_id.c \ - pg_select_refunds_above_serial_id.h pg_select_refunds_above_serial_id.c \ - pg_select_refunds_by_coin.h pg_select_refunds_by_coin.c \ - pg_select_reserve_close_info.c pg_select_reserve_close_info.h \ - pg_select_reserve_closed_above_serial_id.c pg_select_reserve_closed_above_serial_id.h \ - pg_select_reserve_open_above_serial_id.c pg_select_reserve_open_above_serial_id.h \ - pg_select_reserves_in_above_serial_id.h pg_select_reserves_in_above_serial_id.c \ - pg_select_reserves_in_above_serial_id_by_account.h pg_select_reserves_in_above_serial_id_by_account.c \ - pg_select_wire_out_above_serial_id.h pg_select_wire_out_above_serial_id.c \ - pg_select_wire_out_above_serial_id_by_account.h pg_select_wire_out_above_serial_id_by_account.c \ - pg_select_withdraw_amounts_for_kyc_check.h pg_select_withdraw_amounts_for_kyc_check.c \ - pg_select_withdrawals_above_serial_id.h pg_select_withdrawals_above_serial_id.c \ - pg_set_aml_lock.h pg_set_aml_lock.c \ - pg_set_extension_manifest.h pg_set_extension_manifest.c \ - pg_set_purse_balance.h pg_set_purse_balance.c \ - pg_start.h pg_start.c \ - pg_start_deferred_wire_out.h pg_start_deferred_wire_out.c \ - pg_start_read_committed.h pg_start_read_committed.c \ - pg_start_read_only.h pg_start_read_only.c \ - pg_store_wire_transfer_out.h pg_store_wire_transfer_out.c \ - pg_test_aml_officer.h pg_test_aml_officer.c \ - pg_trigger_kyc_rule_for_account.h pg_trigger_kyc_rule_for_account.c \ - pg_update_aggregation_transient.h pg_update_aggregation_transient.c \ - pg_update_auditor.h pg_update_auditor.c \ - pg_update_kyc_process_by_row.h pg_update_kyc_process_by_row.c \ - pg_update_wire.h pg_update_wire.c \ - pg_wad_in_insert.h pg_wad_in_insert.c \ - pg_wire_prepare_data_get.h pg_wire_prepare_data_get.c \ - pg_wire_prepare_data_insert.h pg_wire_prepare_data_insert.c \ - pg_wire_prepare_data_mark_failed.h pg_wire_prepare_data_mark_failed.c \ - pg_wire_prepare_data_mark_finished.h pg_wire_prepare_data_mark_finished.c \ - plugin_exchangedb_common.c plugin_exchangedb_common.h \ - plugin_exchangedb_postgres.c plugin_exchangedb_postgres.h - - -libtaler_plugin_exchangedb_postgres_la_LDFLAGS = \ - $(TALER_PLUGIN_LDFLAGS) -libtaler_plugin_exchangedb_postgres_la_LIBADD = \ - $(LTLIBINTL) \ - $(top_builddir)/src/pq/libtalerpq.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetpq \ - -lgnunetutil \ - -ljansson \ - -lpq \ - $(XLIB) - -lib_LTLIBRARIES = \ - libtalerexchangedb.la - -libtalerexchangedb_la_SOURCES = \ - exchangedb_accounts.c \ - exchangedb_aml.c \ - exchangedb_history.c \ - exchangedb_plugin.c \ - exchangedb_transactions.c -libtalerexchangedb_la_LIBADD = \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/kyclogic/libtalerkyclogic.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetjson \ - -lgnunetutil \ - -ljansson \ - -lcurl \ - $(XLIB) -libtalerexchangedb_la_LDFLAGS = \ - $(POSTGRESQL_LDFLAGS) \ - -version-info 1:1:0 \ - -no-undefined - -# [oec 20250430] disable test for now -# check_PROGRAMS = \ -# test-exchangedb-postgres - -noinst_PROGRAMS = \ - bench-db-postgres\ - perf_select_refunds_by_coin-postgres\ - perf_reserves_in_insert-postgres \ - perf_deposits_get_ready-postgres - -AM_TESTS_ENVIRONMENT=export TALER_EXCHANGE_PREFIX=$${TALER_EXCHANGE_PREFIX:-@libdir@};export PATH=$${TALER_EXCHANGE_PREFIX:-@prefix@}/bin:$$PATH; -TESTS = \ - $(check_SCRIPTS) \ - $(check_PROGRAMS) - -test_exchangedb_postgres_SOURCES = \ - test_exchangedb.c -test_exchangedb_postgres_LDADD = \ - libtalerexchangedb.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/pq/libtalerpq.la \ - -ljansson \ - -lgnunetjson \ - -lgnunetutil \ - $(XLIB) - -bench_db_postgres_SOURCES = \ - bench_db.c -bench_db_postgres_LDADD = \ - libtalerexchangedb.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/pq/libtalerpq.la \ - -lgnunetpq \ - -lgnunetutil \ - $(XLIB) - -perf_reserves_in_insert_postgres_SOURCES = \ - perf_reserves_in_insert.c -perf_reserves_in_insert_postgres_LDADD = \ - libtalerexchangedb.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/pq/libtalerpq.la \ - -ljansson \ - -lgnunetjson \ - -lgnunetutil \ - -lm \ - $(XLIB) - -perf_select_refunds_by_coin_postgres_SOURCES = \ - perf_select_refunds_by_coin.c -perf_select_refunds_by_coin_postgres_LDADD = \ - libtalerexchangedb.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/pq/libtalerpq.la \ - -ljansson \ - -lgnunetjson \ - -lgnunetutil \ - -lm \ - $(XLIB) - -perf_deposits_get_ready_postgres_SOURCES = \ - perf_deposits_get_ready.c -perf_deposits_get_ready_postgres_LDADD = \ - libtalerexchangedb.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/pq/libtalerpq.la \ - -ljansson \ - -lgnunetjson \ - -lgnunetutil \ - -lm \ - $(XLIB) - - -EXTRA_test_exchangedb_postgres_DEPENDENCIES = \ - libtaler_plugin_exchangedb_postgres.la diff --git a/src/exchangedb/Makefile.sql b/src/exchangedb/Makefile.sql @@ -0,0 +1,30 @@ +procedures.sql: procedures.sql.in exchange_do_*.sql exchange_statistics_*.sql exchange_trigger_*.sql + gcc -E -P -undef - < procedures.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ + +exchange-0002.sql: exchange-0002.sql.in 0002-*.sql + gcc -E -P -undef - < exchange-0002.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ + +exchange-0003.sql: exchange-0003.sql.in 0003-*.sql + gcc -E -P -undef - < exchange-0003.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ + +exchange-0004.sql: exchange-0004.sql.in 0004-*.sql + gcc -E -P -undef - < exchange-0004.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ + +exchange-0009.sql: exchange-0009.sql.in 0009-*.sql + gcc -E -P -undef - < exchange-0009.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ + +exchange-0010.sql: exchange-0010.sql.in 0010-*.sql + gcc -E -P -undef - < exchange-0010.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ + +CLEANFILES = \ + exchange-0002.sql \ + exchange-0003.sql \ + exchange-0004.sql \ + exchange-0009.sql \ + exchange-0010.sql \ + procedures.sql + +all: ${CLEANFILES} + +clean: + rm ${CLEANFILES} diff --git a/src/exchangedb/meson.build b/src/exchangedb/meson.build @@ -0,0 +1,430 @@ +# This build file is in the public domain + +pkgcfgadir = get_option('datadir') / 'taler-auditor' / 'config.d' +pkgcfgedir = get_option('datadir') / 'taler-exchange' / 'config.d' + +# Auditor also needs to access the exchange DB, so we install +# the exchange configuration for it here as well! +install_data( + 'exchangedb.conf', + 'exchangedb-postgres.conf', + install_dir: pkgcfgadir, +) + +install_data( + 'exchangedb.conf', + 'exchangedb-postgres.conf', + install_dir: pkgcfgedir, +) + +configure_file( + input: 'test-exchange-db-postgres.conf', + output: 'test-exchange-db-postgres.conf', + copy: true, +) + +sqldir = get_option('datadir') / 'taler-exchange' / 'sql' + +# FIXME possibly provide this output in the tgz through dist script +run_command('make', '-f', 'Makefile.sql', 'all', check: true) + +sqlfiles = [ + 'benchmark-0001.sql', + 'versioning.sql', + 'auditor-triggers-0001.sql', + 'exchange-0001.sql', + 'exchange-0002.sql', + 'exchange-0003.sql', + 'exchange-0004.sql', + 'exchange-0005.sql', + 'exchange-0006.sql', + 'exchange-0007.sql', + 'exchange-0008.sql', + 'exchange-0009.sql', + 'exchange-0010.sql', + 'drop.sql', + 'procedures.sql', + 'tops-0001.sql', +] +install_data(sources: sqlfiles, install_dir: sqldir) + +# This makes meson copy the files into the build directory for testing +foreach f : sqlfiles + configure_file(input: f, output: f, copy: true) +endforeach + +test_idem = configure_file( + input: 'test_idempotency.sh', + output: 'test_idempotency.sh', + copy: true, +) + +test( + 'test_idempotency.sh', + test_idem, + workdir: meson.current_build_dir(), + suite: ['exchangedb', 'installcheck'], +) + + + +plugindir = get_option('libdir') / 'taler-exchange' + +if pq_dep.found() + libtaler_plugin_exchangedb_postgres_la_SOURCES = [ + 'pg_abort_shard.c', + 'pg_activate_signing_key.c', + 'pg_add_denomination_key.c', + 'pg_add_policy_fulfillment_proof.c', + 'pg_aggregate.c', + 'pg_batch_ensure_coin_known.c', + 'pg_begin_revolving_shard.c', + 'pg_begin_shard.c', + 'pg_clear_aml_lock.c', + 'pg_commit.c', + 'pg_complete_shard.c', + 'pg_compute_shard.c', + 'pg_count_known_coins.c', + 'pg_create_aggregation_transient.c', + 'pg_create_tables.c', + 'pg_delete_aggregation_transient.c', + 'pg_delete_shard_locks.c', + 'pg_disable_rules.c', + 'pg_do_withdraw.c', + 'pg_do_check_deposit_idempotent.c', + 'pg_do_deposit.c', + 'pg_do_refresh.c', + 'pg_do_purse_delete.c', + 'pg_do_purse_deposit.c', + 'pg_do_purse_merge.c', + 'pg_do_recoup.c', + 'pg_do_recoup_refresh.c', + 'pg_do_refund.c', + 'pg_do_reserve_open.c', + 'pg_do_reserve_purse.c', + 'pg_drain_kyc_alert.c', + 'pg_drop_tables.c', + 'pg_enable_rules.c', + 'pg_ensure_coin_known.c', + 'pg_event_listen.c', + 'pg_event_listen_cancel.c', + 'pg_event_notify.c', + 'pg_expire_purse.c', + 'pg_find_aggregation_transient.c', + 'pg_gc.c', + 'pg_get_coin_denomination.c', + 'pg_get_coin_transactions.c', + 'pg_get_denomination_info.c', + 'pg_get_denomination_by_serial.c', + 'pg_get_denomination_revocation.c', + 'pg_get_drain_profit.c', + 'pg_get_expired_reserves.c', + 'pg_get_extension_manifest.c', + 'pg_get_global_fee.c', + 'pg_get_global_fees.c', + 'pg_get_known_coin.c', + 'pg_get_kyc_rules.c', + 'pg_get_refresh.c', + 'pg_get_old_coin_by_h_blind.c', + 'pg_get_pending_kyc_requirement_process.c', + 'pg_get_policy_details.c', + 'pg_get_purse_deposit.c', + 'pg_get_purse_request.c', + 'pg_get_ready_deposit.c', + 'pg_get_reserve_balance.c', + 'pg_get_reserve_by_h_planchets.c', + 'pg_get_reserve_history.c', + 'pg_get_signature_for_known_coin.c', + 'pg_get_unfinished_close_requests.c', + 'pg_get_wire_accounts.c', + 'pg_get_wire_fee.c', + 'pg_get_wire_fees.c', + 'pg_get_wire_hash_for_contract.c', + 'pg_get_withdraw.c', + 'pg_have_deposit2.c', + 'pg_helper.h', + 'pg_inject_auditor_triggers.c', + 'pg_insert_active_legitimization_measure.c', + 'pg_insert_aml_decision.c', + 'pg_insert_aml_officer.c', + 'pg_insert_aml_program_failure.c', + 'pg_insert_auditor.c', + 'pg_insert_auditor_denom_sig.c', + 'pg_insert_close_request.c', + 'pg_insert_contract.c', + 'pg_insert_denomination_info.c', + 'pg_insert_denomination_revocation.c', + 'pg_insert_drain_profit.c', + 'pg_insert_global_fee.c', + 'pg_insert_kyc_failure.c', + 'pg_insert_kyc_requirement_process.c', + 'pg_insert_partner.c', + 'pg_insert_purse_request.c', + 'pg_insert_records_by_table.c', + 'pg_insert_refund.c', + 'pg_insert_reserve_closed.c', + 'pg_insert_reserve_open_deposit.c', + 'pg_insert_sanction_list_hit.c', + 'pg_insert_signkey_revocation.c', + 'pg_insert_successor_measure.c', + 'pg_insert_wire.c', + 'pg_insert_wire_fee.c', + 'pg_iterate_active_auditors.c', + 'pg_iterate_active_signkeys.c', + 'pg_iterate_auditor_denominations.c', + 'pg_iterate_denomination_info.c', + 'pg_iterate_denominations.c', + 'pg_iterate_kyc_reference.c', + 'pg_iterate_reserve_close_info.c', + 'pg_kyc_provider_account_lookup.c', + 'pg_kycauth_in_insert.c', + 'pg_lookup_active_legitimization.c', + 'pg_lookup_aml_file_number.c', + 'pg_lookup_aml_history.c', + 'pg_lookup_aml_officer.c', + 'pg_lookup_auditor_status.c', + 'pg_lookup_auditor_timestamp.c', + 'pg_lookup_completed_legitimization.c', + 'pg_lookup_denomination_key.c', + 'pg_lookup_global_fee_by_time.c', + 'pg_lookup_h_payto_by_access_token.c', + 'pg_lookup_kyc_history.c', + 'pg_lookup_kyc_process_by_account.c', + 'pg_lookup_kyc_requirement_by_row.c', + 'pg_lookup_kyc_status_by_token.c', + 'pg_lookup_pending_legitimization.c', + 'pg_lookup_records_by_table.c', + 'pg_lookup_rules_by_access_token.c', + 'pg_lookup_serial_by_table.c', + 'pg_lookup_signing_key.c', + 'pg_lookup_signkey_revocation.c', + 'pg_lookup_transfer_by_deposit.c', + 'pg_lookup_wire_fee_by_time.c', + 'pg_lookup_wire_timestamp.c', + 'pg_lookup_wire_transfer.c', + 'pg_mark_refresh_reveal_success.c', + 'pg_persist_kyc_attributes.c', + 'pg_persist_policy_details.c', + 'pg_preflight.c', + 'pg_profit_drains_get_pending.c', + 'pg_profit_drains_set_finished.c', + 'pg_release_revolving_shard.c', + 'pg_reserves_get.c', + 'pg_reserves_get_origin.c', + 'pg_reserves_in_insert.c', + 'pg_reserves_update.c', + 'pg_rollback.c', + 'pg_select_account_merges_above_serial_id.c', + 'pg_select_aggregation_amounts_for_kyc_check.c', + 'pg_select_aggregation_transient.c', + 'pg_select_aggregations_above_serial.c', + 'pg_select_all_kyc_attributes.c', + 'pg_select_all_purse_decisions_above_serial_id.c', + 'pg_select_all_purse_deletions_above_serial_id.c', + 'pg_select_aml_attributes.c', + 'pg_select_aml_decisions.c', + 'pg_select_aml_measures.c', + 'pg_select_aml_statistics.c', + 'pg_select_auditor_denom_sig.c', + 'pg_select_batch_deposits_missing_wire.c', + 'pg_select_coin_deposits_above_serial_id.c', + 'pg_select_contract.c', + 'pg_select_contract_by_purse.c', + 'pg_select_deposit_amounts_for_kyc_check.c', + 'pg_select_exchange_credit_transfers.c', + 'pg_select_exchange_kycauth_transfers.c', + 'pg_select_exchange_debit_transfers.c', + 'pg_select_kyc_accounts.c', + 'pg_select_kyc_attributes.c', + 'pg_select_merge_amounts_for_kyc_check.c', + 'pg_select_purse.c', + 'pg_select_purse_by_merge_pub.c', + 'pg_select_purse_decisions_above_serial_id.c', + 'pg_select_purse_deposits_above_serial_id.c', + 'pg_select_purse_deposits_by_purse.c', + 'pg_select_purse_merge.c', + 'pg_select_purse_merges_above_serial_id.c', + 'pg_select_purse_requests_above_serial_id.c', + 'pg_select_recoup_above_serial_id.c', + 'pg_select_recoup_refresh_above_serial_id.c', + 'pg_select_refreshes_above_serial_id.c', + 'pg_select_refunds_above_serial_id.c', + 'pg_select_refunds_by_coin.c', + 'pg_select_reserve_close_info.c', + 'pg_select_reserve_closed_above_serial_id.c', + 'pg_select_reserve_open_above_serial_id.c', + 'pg_select_reserves_in_above_serial_id.c', + 'pg_select_reserves_in_above_serial_id_by_account.c', + 'pg_select_wire_out_above_serial_id.c', + 'pg_select_wire_out_above_serial_id_by_account.c', + 'pg_select_withdraw_amounts_for_kyc_check.c', + 'pg_select_withdrawals_above_serial_id.c', + 'pg_set_aml_lock.c', + 'pg_set_extension_manifest.c', + 'pg_set_purse_balance.c', + 'pg_start.c', + 'pg_start_deferred_wire_out.c', + 'pg_start_read_committed.c', + 'pg_start_read_only.c', + 'pg_store_wire_transfer_out.c', + 'pg_test_aml_officer.c', + 'pg_trigger_kyc_rule_for_account.c', + 'pg_update_aggregation_transient.c', + 'pg_update_auditor.c', + 'pg_update_kyc_process_by_row.c', + 'pg_update_wire.c', + 'pg_wad_in_insert.c', + 'pg_wire_prepare_data_get.c', + 'pg_wire_prepare_data_insert.c', + 'pg_wire_prepare_data_mark_failed.c', + 'pg_wire_prepare_data_mark_finished.c', + 'plugin_exchangedb_common.c', + 'plugin_exchangedb_postgres.c', + ] + + shared_module( + 'taler_plugin_exchangedb_postgres', + libtaler_plugin_exchangedb_postgres_la_SOURCES, + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + libtalerpq_dep, + gnunetpq_dep, + gnunetutil_dep, + json_dep, + pq_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: exch_plugindir, + ) + +endif + +libtalerexchangedb = library( + 'talerexchangedb', + [ + 'exchangedb_accounts.c', + 'exchangedb_aml.c', + 'exchangedb_history.c', + 'exchangedb_plugin.c', + 'exchangedb_transactions.c', + ], + soversion: solibversions['libtalerexchangedb']['soversion'], + version: solibversions['libtalerexchangedb']['soversion'], + install_rpath: rpath_option, + dependencies: [ + libtalerbank_dep, + libtalerkyclogic_dep, + libtalerjson_dep, + libtalerutil_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + curl_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalerexchangedb_dep = declare_dependency(link_with: libtalerexchangedb) +pkg.generate( + libtalerexchangedb, + url: 'https://taler.net', + description: 'GNU Taler exchange DB library', +) + + +# [oec 20250430] disable test for now +# check_PROGRAMS = \ +# test-exchangedb-postgres + +#executable( +# 'test-exchangedb-postgres', +# ['test_exchangedb.c'], +# install_rpath: rpath_option, +# dependencies: [ +# libtalerexchangedb_dep, +# libtalerutil_dep, +# libtalerjson_dep, +# libtalerpq_dep, +# gnunetutil_dep, +# gnunetjson_dep, +# json_dep, +# ], +# include_directories: [incdir, configuration_inc], +# install: false, +#) + + +executable( + 'bench-db-postgres', + ['bench_db.c'], + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + libtalerpq_dep, + gnunetutil_dep, + gnunetpq_dep, + pq_dep, + ], + include_directories: [incdir, configuration_inc], + install: false, +) + +executable( + 'perf_reserves_in_insert-postgres', + ['perf_reserves_in_insert.c'], + install_rpath: rpath_option, + dependencies: [ + libtalerexchangedb_dep, + libtalerjson_dep, + libtalerutil_dep, + libtalerpq_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + m_dep, + ], + include_directories: [incdir, configuration_inc], + install: false, +) + + +executable( + 'perf_select_refunds_by_coin-postgres', + ['perf_select_refunds_by_coin.c'], + install_rpath: rpath_option, + dependencies: [ + libtalerexchangedb_dep, + libtalerjson_dep, + libtalerutil_dep, + libtalerpq_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + m_dep, + ], + include_directories: [incdir, configuration_inc], + install: false, +) + + +executable( + 'perf_deposits_get_ready-postgres', + ['perf_deposits_get_ready.c'], + install_rpath: rpath_option, + dependencies: [ + libtalerexchangedb_dep, + libtalerjson_dep, + libtalerutil_dep, + libtalerpq_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + m_dep, + ], + include_directories: [incdir, configuration_inc], + install: false, +) diff --git a/src/extensions/Makefile.am b/src/extensions/Makefile.am @@ -1,34 +0,0 @@ -# This Makefile.am is in the public domain - -AM_CPPFLAGS = \ - -I$(top_srcdir)/src/include \ - $(LIBGCRYPT_CFLAGS) \ - $(POSTGRESQL_CPPFLAGS) - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - - -# Basic extension handling library - -lib_LTLIBRARIES = \ - libtalerextensions.la - -libtalerextensions_la_LDFLAGS = \ - -version-info 0:0:0 \ - -no-undefined - -libtalerextensions_la_SOURCES = \ - extensions.c \ - age_restriction_helper.c - -libtalerextensions_la_LIBADD = \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetjson \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - diff --git a/src/extensions/age_restriction/Makefile.am b/src/extensions/age_restriction/Makefile.am @@ -1,32 +0,0 @@ -# This Makefile.am is in the public domain - -AM_CPPFLAGS = \ - -I$(top_srcdir)/src/include \ - $(LIBGCRYPT_CFLAGS) \ - $(POSTGRESQL_CPPFLAGS) - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -# Age restriction as extension library - -plugindir = $(libdir)/taler-exchange - -plugin_LTLIBRARIES = \ - libtaler_extension_age_restriction.la - -libtaler_extension_age_restriction_la_LDFLAGS = \ - $(TALER_PLUGIN_LDFLAGS) \ - -no-undefined - -libtaler_extension_age_restriction_la_SOURCES = \ - age_restriction.c -libtaler_extension_age_restriction_la_LIBADD = \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetjson \ - -lgnunetutil \ - -ljansson \ - $(XLIB) diff --git a/src/extensions/age_restriction/meson.build b/src/extensions/age_restriction/meson.build @@ -0,0 +1,23 @@ +# This build file is in the public domain + +# Age restriction as extension library + +age_plugindir = get_option('libdir') / 'taler-exchange' + +shared_module( + 'taler_extension_age_restriction', + 'age_restriction.c', + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + gnunetjson_dep, + gnunetutil_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: age_plugindir, +) + + diff --git a/src/extensions/meson.build b/src/extensions/meson.build @@ -0,0 +1,26 @@ +libtalerextensions_src = ['extensions.c', 'age_restriction_helper.c'] + +libtalerextensions = library( + 'talerextensions', + libtalerextensions_src, + soversion: solibversions['libtalerextensions']['soversion'], + version: solibversions['libtalerextensions']['soversion'], + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalerextensions_dep = declare_dependency(link_with: libtalerextensions) +pkg.generate( + libtalerextensions, + url: 'https://taler.net', + description: 'GNU Taler extensions library', +) diff --git a/src/include/Makefile.am b/src/include/Makefile.am @@ -1,7 +0,0 @@ -# This Makefile.am is in the public domain -SUBDIRS = taler . - -talerincludedir = $(includedir)/taler - -talerinclude_HEADERS = \ - gettext.h diff --git a/src/include/meson.build b/src/include/meson.build @@ -0,0 +1,3 @@ +subdir('taler') + +install_headers('gettext.h', install_dir: get_option('includedir') / 'taler') diff --git a/src/include/taler/Makefile.am b/src/include/taler/Makefile.am @@ -1,41 +0,0 @@ -# This Makefile.am is in the public domain -SUBDIRS = taler-exchange . -talerincludedir = $(includedir)/taler - -talerinclude_HEADERS = \ - taler_auditor_service.h \ - taler_amount_lib.h \ - taler_attributes.h \ - taler_auditordb_lib.h \ - taler_auditordb_plugin.h \ - taler_bank_service.h \ - taler_crypto_lib.h \ - taler_curl_lib.h \ - taler_dbevents.h \ - taler_error_codes.h \ - taler_exchange_service.h \ - taler_exchangedb_lib.h \ - taler_exchangedb_plugin.h \ - taler_extensions.h \ - taler_extensions_policy.h \ - taler_fakebank_lib.h \ - taler_kyclogic_lib.h \ - taler_kyclogic_plugin.h \ - taler_json_lib.h \ - taler_testing_lib.h \ - taler_util.h \ - taler_mhd_lib.h \ - taler_pq_lib.h \ - taler_signatures.h \ - taler_sq_lib.h \ - taler_templating_lib.h \ - taler_twister_testing_lib.h - -if HAVE_MHD2 -talerinclude_HEADERS += \ - taler_mhd2_lib.h -endif - -EXTRA_DIST = \ - platform.h \ - backoff.h diff --git a/src/include/taler/meson.build b/src/include/taler/meson.build @@ -0,0 +1,51 @@ +subdir('taler-exchange') + + +talerinclude_headers = [ + 'taler_auditor_service.h', + 'taler_amount_lib.h', + 'taler_attributes.h', + 'taler_auditordb_lib.h', + 'taler_auditordb_plugin.h', + 'taler_bank_service.h', + 'taler_crypto_lib.h', + 'taler_curl_lib.h', + 'taler_dbevents.h', + 'taler_error_codes.h', + 'taler_exchange_service.h', + 'taler_exchangedb_lib.h', + 'taler_exchangedb_plugin.h', + 'taler_extensions.h', + 'taler_extensions_policy.h', + 'taler_fakebank_lib.h', + 'taler_kyclogic_lib.h', + 'taler_kyclogic_plugin.h', + 'taler_json_lib.h', + 'taler_testing_lib.h', + 'taler_util.h', + 'taler_mhd_lib.h', + 'taler_pq_lib.h', + 'taler_signatures.h', + 'taler_sq_lib.h', + 'taler_templating_lib.h', + 'taler_twister_testing_lib.h', +] + +foreach h : talerinclude_headers + + install_headers(h, install_dir: get_option('includedir') / 'taler') + +endforeach + +if mhd2_dep.found() + install_headers( + 'taler_mhd2_lib.h', + install_dir: get_option('includedir') / 'taler', + ) +endif + +configure_file(input: 'platform.h', output: 'platform.h', copy: true) + +configure_file(input: 'backoff.h', output: 'backoff.h', copy: true) + + diff --git a/src/include/taler/taler-exchange/Makefile.am b/src/include/taler/taler-exchange/Makefile.am @@ -1,59 +0,0 @@ -# This Makefile.am is in the public domain -talerincludedir = $(includedir)/taler/taler-exchange - -talerinclude_HEADERS = \ - common.h \ - delete-purses-PURSE_PUB.h \ - get-aml-OFFICER_PUB-attributes-H_NORMALIZED_PAYTO.h \ - get-aml-OFFICER_PUB-decisions.h \ - get-aml-OFFICER_PUB-kyc-statistics-NAMES.h \ - get-aml-OFFICER_PUB-legitimizations.h \ - get-aml-OFFICER_PUB-measures.h \ - get-aml-OFFICER_PUB-transfers-credit.h \ - get-coins-COIN_PUB-history.h \ - get-contracts-CONTRACT_PUB.h \ - get-deposits-H_WIRE-MERCHANT_PUB-H_CONTRACT_TERMS-COIN_PUB.h \ - get-keys.h \ - get-kyc-check-H_NORMALIZED_PAYTO.h \ - get-kyc-info-ACCESS_TOKEN.h \ - get-kyc-proof-PROVIDER_NAME.h \ - get-management-keys.h \ - get-purses-PURSE_PUB-merge.h \ - get-reserves-attest-RESERVE_PUB.h \ - get-reserves-RESERVE_PUB.h \ - get-reserves-RESERVE_PUB-history.h \ - get-transfers-WTID.h \ - post-aml-OFFICER_PUB-decision.h \ - post-auditors-AUDITOR_PUB-H_DENOM_PUB.h \ - post-batch-deposit.h \ - post-blinding-prepare.h \ - post-coins-COIN_PUB-refund.h \ - post-kyc-start-ID.h \ - post-kyc-wallet.h \ - post-management-aml-officers.h \ - post-management-auditors.h \ - post-management-auditors-AUDITOR_PUB-disable.h \ - post-management-denominations-H_DENOM_PUB-revoke.h \ - post-management-drain.h \ - post-management-extensions.h \ - post-management-global-fees.h \ - post-management-keys.h \ - post-management-partners.h \ - post-management-signkeys-EXCHANGE_PUB-revoke.h \ - post-management-wire.h \ - post-management-wire-disable.h \ - post-management-wire-fee.h \ - post-melt.h \ - post-purses-PURSE_PUB-create.h \ - post-purses-PURSE_PUB-deposit.h \ - post-purses-PURSE_PUB-merge.h \ - post-recoup-refresh.h \ - post-recoup-withdraw.h \ - post-reserves-attest-RESERVE_PUB.h \ - post-reserves-RESERVE_PUB-close.h \ - post-reserves-RESERVE_PUB-open.h \ - post-reserves-RESERVE_PUB-purse.h \ - post-reveal-melt.h \ - post-reveal-withdraw.h \ - post-withdraw.h \ - post-withdraw_blinded.h diff --git a/src/include/taler/taler-exchange/meson.build b/src/include/taler/taler-exchange/meson.build @@ -0,0 +1,64 @@ +talerexchange_headers = [ + 'common.h', + 'delete-purses-PURSE_PUB.h', + 'get-aml-OFFICER_PUB-attributes-H_NORMALIZED_PAYTO.h', + 'get-aml-OFFICER_PUB-decisions.h', + 'get-aml-OFFICER_PUB-kyc-statistics-NAMES.h', + 'get-aml-OFFICER_PUB-legitimizations.h', + 'get-aml-OFFICER_PUB-measures.h', + 'get-aml-OFFICER_PUB-transfers-credit.h', + 'get-coins-COIN_PUB-history.h', + 'get-contracts-CONTRACT_PUB.h', + 'get-deposits-H_WIRE-MERCHANT_PUB-H_CONTRACT_TERMS-COIN_PUB.h', + 'get-keys.h', + 'get-kyc-check-H_NORMALIZED_PAYTO.h', + 'get-kyc-info-ACCESS_TOKEN.h', + 'get-kyc-proof-PROVIDER_NAME.h', + 'get-management-keys.h', + 'get-purses-PURSE_PUB-merge.h', + 'get-reserves-attest-RESERVE_PUB.h', + 'get-reserves-RESERVE_PUB.h', + 'get-reserves-RESERVE_PUB-history.h', + 'get-transfers-WTID.h', + 'post-aml-OFFICER_PUB-decision.h', + 'post-auditors-AUDITOR_PUB-H_DENOM_PUB.h', + 'post-batch-deposit.h', + 'post-blinding-prepare.h', + 'post-coins-COIN_PUB-refund.h', + 'post-kyc-start-ID.h', + 'post-kyc-wallet.h', + 'post-management-aml-officers.h', + 'post-management-auditors.h', + 'post-management-auditors-AUDITOR_PUB-disable.h', + 'post-management-denominations-H_DENOM_PUB-revoke.h', + 'post-management-drain.h', + 'post-management-extensions.h', + 'post-management-global-fees.h', + 'post-management-keys.h', + 'post-management-partners.h', + 'post-management-signkeys-EXCHANGE_PUB-revoke.h', + 'post-management-wire.h', + 'post-management-wire-disable.h', + 'post-management-wire-fee.h', + 'post-melt.h', + 'post-purses-PURSE_PUB-create.h', + 'post-purses-PURSE_PUB-deposit.h', + 'post-purses-PURSE_PUB-merge.h', + 'post-recoup-refresh.h', + 'post-recoup-withdraw.h', + 'post-reserves-attest-RESERVE_PUB.h', + 'post-reserves-RESERVE_PUB-close.h', + 'post-reserves-RESERVE_PUB-open.h', + 'post-reserves-RESERVE_PUB-purse.h', + 'post-reveal-melt.h', + 'post-reveal-withdraw.h', + 'post-withdraw.h', + 'post-withdraw_blinded.h', +] + +foreach h : talerexchange_headers + install_headers( + h, + install_dir: get_option('includedir') / 'taler' / 'taler-exchange', + ) +endforeach diff --git a/src/json/Makefile.am b/src/json/Makefile.am @@ -1,58 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -lib_LTLIBRARIES = \ - libtalerjson.la - -libtalerjson_la_SOURCES = \ - conversion.c \ - i18n.c \ - json.c \ - json_helper.c \ - json_pack.c \ - json_wire.c -libtalerjson_la_LDFLAGS = \ - -version-info 6:0:2 \ - -no-undefined -libtalerjson_la_LIBADD = \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetjson \ - -lgnunetutil \ - -lunistring \ - -ljansson \ - -lm \ - $(XLIB) - -TESTS = \ - test_conversion \ - test_json - -check_PROGRAMS= \ - test_conversion \ - test_json - -test_json_SOURCES = \ - test_json.c -test_json_LDADD = \ - libtalerjson.la \ - -lgnunetjson \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetutil \ - -ljansson - -test_conversion_SOURCES = \ - test_conversion.c -test_conversion_LDADD = \ - libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetjson \ - -lgnunetutil \ - -ljansson - -EXTRA_DIST = \ - test_conversion.sh diff --git a/src/json/meson.build b/src/json/meson.build @@ -0,0 +1,83 @@ +configure_file( + input: 'test_conversion.sh', + output: 'test_conversion.sh', + copy: true, +) + +libtalerjson_src = [ + 'conversion.c', + 'i18n.c', + 'json.c', + 'json_helper.c', + 'json_pack.c', + 'json_wire.c', +] + +libtalerjson = library( + 'talerjson', + libtalerjson_src, + soversion: solibversions['libtalerjson']['soversion'], + version: solibversions['libtalerjson']['soversion'], + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + unistr_dep, + m_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalerjson_dep = declare_dependency(link_with: libtalerjson) +pkg.generate( + libtalerjson, + url: 'https://taler.net', + description: 'GNU Taler JSON library', +) + +talerjson_tests = ['test_conversion', 'test_json'] + +talerjson_tests_installcheck = [] + +foreach t : talerjson_tests + + test_tmp = executable( + t, + ['@0@.c'.format(t)], + dependencies: [ + gnunetutil_dep, + gnunetjson_dep, + libtalerjson_dep, + libtalerutil_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test(t, test_tmp, workdir: meson.current_build_dir(), suite: ['json']) +endforeach + +foreach t : talerjson_tests_installcheck + + test_tmp = executable( + t, + ['@0@.c'.format(t)], + dependencies: [gnunetutil_dep, libtalerutil_dep, json_dep], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + t, + test_tmp, + workdir: meson.current_build_dir(), + suite: ['json', 'installcheck'], + ) + + +endforeach diff --git a/src/json/test_conversion.sh b/src/json/test_conversion.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh KEY=$(jq -r .key) echo -n "{\"$KEY\":\"$1\"}" diff --git a/src/kyclogic/Makefile.am b/src/kyclogic/Makefile.am @@ -1,184 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -pkgcfgdir = $(prefix)/share/taler-exchange/config.d/ - -pkgcfg_DATA = \ - kyclogic.conf \ - kyclogic-kycaid.conf \ - kyclogic-oauth2.conf \ - kyclogic-persona.conf - -bin_SCRIPTS = \ - taler-exchange-helper-measure-challenger-email-context-check \ - taler-exchange-helper-measure-challenger-postal-context-check \ - taler-exchange-helper-measure-challenger-sms-context-check \ - taler-exchange-helper-measure-clear-continue \ - taler-exchange-helper-measure-defaults-but-investigate \ - taler-exchange-helper-measure-freeze \ - taler-exchange-helper-measure-inform-investigate \ - taler-exchange-helper-measure-none \ - taler-exchange-helper-measure-preserve-but-investigate \ - taler-exchange-helper-measure-preserve-set-expiration \ - taler-exchange-helper-measure-tops-address-check \ - taler-exchange-helper-measure-tops-3rdparty-check \ - taler-exchange-helper-measure-tops-kyx-check \ - taler-exchange-helper-measure-tops-postal-check \ - taler-exchange-helper-measure-tops-sms-check \ - taler-exchange-helper-measure-test-form \ - taler-exchange-helper-measure-test-oauth \ - taler-exchange-helper-measure-update-from-context \ - taler-exchange-helper-measure-validate-accepted-tos \ - taler-exchange-kyc-kycaid-converter.sh \ - taler-exchange-kyc-persona-converter.sh \ - taler-exchange-kyc-oauth2-test-converter.sh \ - taler-exchange-kyc-challenger-email-converter \ - taler-exchange-kyc-challenger-postal-converter \ - taler-exchange-kyc-challenger-sms-converter \ - taler-exchange-kyc-oauth2-challenger.sh \ - taler-exchange-kyc-oauth2-nda.sh - -EXTRA_DIST = \ - $(pkgcfg_DATA) \ - $(bin_SCRIPTS) \ - sample.conf - -lib_LTLIBRARIES = \ - libtalerkyclogic.la - -libtalerkyclogic_la_SOURCES = \ - kyclogic_api.c \ - kyclogic_sanctions.c -libtalerkyclogic_la_LIBADD = \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetjson \ - -lgnunetutil \ - -ljansson \ - $(XLIB) -libtalerkyclogic_la_LDFLAGS = \ - -version-info 3:0:0 \ - -no-undefined - - -bin_PROGRAMS = \ - taler-exchange-helper-sanctions-dummy \ - taler-exchange-kyc-tester - -taler_exchange_kyc_tester_SOURCES = \ - taler-exchange-kyc-tester.c -taler_exchange_kyc_tester_LDADD = \ - $(LIBGCRYPT_LIBS) \ - libtalerkyclogic.la \ - $(top_builddir)/src/mhd/libtalermhd.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/templating/libtalertemplating.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lmicrohttpd \ - -lgnunetcurl \ - -lgnunetutil \ - -lgnunetjson \ - -ljansson \ - -lcurl \ - -lz \ - $(XLIB) - -taler_exchange_helper_sanctions_dummy_SOURCES = \ - taler-exchange-helper-sanctions-dummy.c -taler_exchange_helper_sanctions_dummy_LDADD = \ - $(LIBGCRYPT_LIBS) \ - libtalerkyclogic.la \ - $(top_builddir)/src/mhd/libtalermhd.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetutil \ - -lgnunetjson \ - -ljansson \ - $(XLIB) - - - -plugindir = $(libdir)/taler-exchange - -plugin_LTLIBRARIES = \ - libtaler_plugin_kyclogic_kycaid.la \ - libtaler_plugin_kyclogic_oauth2.la \ - libtaler_plugin_kyclogic_persona.la \ - libtaler_plugin_kyclogic_template.la - -libtaler_plugin_kyclogic_template_la_SOURCES = \ - plugin_kyclogic_template.c -libtaler_plugin_kyclogic_template_la_LIBADD = \ - $(LTLIBINTL) -libtaler_plugin_kyclogic_template_la_LDFLAGS = \ - $(TALER_PLUGIN_LDFLAGS) \ - -lgnunetcurl \ - -lgnunetutil \ - $(XLIB) - -libtaler_plugin_kyclogic_oauth2_la_SOURCES = \ - plugin_kyclogic_oauth2.c -libtaler_plugin_kyclogic_oauth2_la_LIBADD = \ - $(LTLIBINTL) -libtaler_plugin_kyclogic_oauth2_la_LDFLAGS = \ - $(TALER_PLUGIN_LDFLAGS) \ - $(top_builddir)/src/templating/libtalertemplating.la \ - $(top_builddir)/src/mhd/libtalermhd.la \ - $(top_builddir)/src/curl/libtalercurl.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetcurl \ - -lgnunetjson \ - -lgnunetutil \ - -lmicrohttpd \ - -ljansson \ - -lcurl \ - $(XLIB) - -libtaler_plugin_kyclogic_kycaid_la_SOURCES = \ - plugin_kyclogic_kycaid.c -libtaler_plugin_kyclogic_kycaid_la_LIBADD = \ - $(LTLIBINTL) -libtaler_plugin_kyclogic_kycaid_la_LDFLAGS = \ - $(TALER_PLUGIN_LDFLAGS) \ - $(top_builddir)/src/templating/libtalertemplating.la \ - $(top_builddir)/src/mhd/libtalermhd.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/curl/libtalercurl.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetcurl \ - -lgnunetjson \ - -lgnunetutil \ - -lmicrohttpd \ - -ljansson \ - -lcurl \ - $(XLIB) - -libtaler_plugin_kyclogic_persona_la_SOURCES = \ - plugin_kyclogic_persona.c -libtaler_plugin_kyclogic_persona_la_LIBADD = \ - $(LTLIBINTL) -libtaler_plugin_kyclogic_persona_la_DEPENDENCIES = \ - libtalerkyclogic.la -libtaler_plugin_kyclogic_persona_la_LDFLAGS = \ - $(TALER_PLUGIN_LDFLAGS) \ - libtalerkyclogic.la \ - $(top_builddir)/src/mhd/libtalermhd.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/curl/libtalercurl.la \ - $(top_builddir)/src/templating/libtalertemplating.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetcurl \ - -lgnunetjson \ - -lgnunetutil \ - -lmicrohttpd \ - -ljansson \ - -lcurl \ - $(XLIB) - -AM_TESTS_ENVIRONMENT=export TALER_EXCHANGE_PREFIX=$${TALER_EXCHANGE_PREFIX:-@libdir@};export PATH=$${TALER_EXCHANGE_PREFIX:-@prefix@}/bin:$$PATH; diff --git a/src/kyclogic/meson.build b/src/kyclogic/meson.build @@ -0,0 +1,199 @@ +# This build file is in the public domain + +install_data( + 'kyclogic.conf', + 'kyclogic-kycaid.conf', + 'kyclogic-oauth2.conf', + 'kyclogic-persona.conf', + install_dir: pkgcfgdir, +) + +kyc_bin_SCRIPTS = [ + 'taler-exchange-helper-measure-challenger-email-context-check', + 'taler-exchange-helper-measure-challenger-postal-context-check', + 'taler-exchange-helper-measure-challenger-sms-context-check', + 'taler-exchange-helper-measure-clear-continue', + 'taler-exchange-helper-measure-defaults-but-investigate', + 'taler-exchange-helper-measure-freeze', + 'taler-exchange-helper-measure-inform-investigate', + 'taler-exchange-helper-measure-none', + 'taler-exchange-helper-measure-preserve-but-investigate', + 'taler-exchange-helper-measure-preserve-set-expiration', + 'taler-exchange-helper-measure-tops-address-check', + 'taler-exchange-helper-measure-tops-3rdparty-check', + 'taler-exchange-helper-measure-tops-kyx-check', + 'taler-exchange-helper-measure-tops-postal-check', + 'taler-exchange-helper-measure-tops-sms-check', + 'taler-exchange-helper-measure-test-form', + 'taler-exchange-helper-measure-test-oauth', + 'taler-exchange-helper-measure-update-from-context', + 'taler-exchange-helper-measure-validate-accepted-tos', + 'taler-exchange-kyc-kycaid-converter.sh', + 'taler-exchange-kyc-persona-converter.sh', + 'taler-exchange-kyc-oauth2-test-converter.sh', + 'taler-exchange-kyc-challenger-email-converter', + 'taler-exchange-kyc-challenger-postal-converter', + 'taler-exchange-kyc-challenger-sms-converter', + 'taler-exchange-kyc-oauth2-challenger.sh', + 'taler-exchange-kyc-oauth2-nda.sh', +] + +foreach b : kyc_bin_SCRIPTS + configure_file( + input: b, + output: b, + install: true, + install_dir: get_option('bindir'), + copy: true, + ) +endforeach + +libtalerkyclogic = library( + 'talerkyclogic', + ['kyclogic_api.c', 'kyclogic_sanctions.c'], + soversion: solibversions['libtalerkyclogic']['soversion'], + version: solibversions['libtalerkyclogic']['soversion'], + install_rpath: rpath_option, + dependencies: [ + libtalerjson_dep, + libtalerutil_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalerkyclogic_dep = declare_dependency(link_with: libtalerkyclogic) +pkg.generate( + libtalerkyclogic, + url: 'https://taler.net', + description: 'GNU Taler KYC library', +) + + + +executable( + 'taler-exchange-helper-sanctions-dummy', + ['taler-exchange-helper-sanctions-dummy.c'], + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalermhd_dep, + libtalerkyclogic_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('bindir'), +) + +executable( + 'taler-exchange-kyc-tester', + ['taler-exchange-kyc-tester.c'], + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + libtalermhd_dep, + libtalertemplating_dep, + libtalerkyclogic_dep, + gnunetutil_dep, + gnunetcurl_dep, + gnunetjson_dep, + json_dep, + curl_dep, + zlib_dep, + mhd_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('bindir'), +) + + +exch_plugindir = get_option('libdir') / 'taler-exchange' + +shared_module( + 'taler_plugin_kyclogic_kycaid', + ['plugin_kyclogic_kycaid.c'], + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + libtalercurl_dep, + libtalerjson_dep, + libtalertemplating_dep, + libtalermhd_dep, + gnunetcurl_dep, + gnunetjson_dep, + gnunetutil_dep, + mhd_dep, + json_dep, + curl_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: exch_plugindir, +) + +shared_module( + 'taler_plugin_kyclogic_template', + ['plugin_kyclogic_template.c'], + install_rpath: rpath_option, + dependencies: [gnunetcurl_dep, gnunetutil_dep], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: exch_plugindir, +) + +shared_module( + 'taler_plugin_kyclogic_oauth2', + ['plugin_kyclogic_oauth2.c'], + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + libtalercurl_dep, + libtalerjson_dep, + libtalertemplating_dep, + libtalermhd_dep, + gnunetcurl_dep, + gnunetjson_dep, + gnunetutil_dep, + mhd_dep, + json_dep, + curl_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: exch_plugindir, +) + +shared_module( + 'taler_plugin_kyclogic_persona', + ['plugin_kyclogic_persona.c'], + install_rpath: rpath_option, + dependencies: [ + libtalerkyclogic_dep, + libtalerutil_dep, + libtalercurl_dep, + libtalerjson_dep, + libtalertemplating_dep, + libtalermhd_dep, + gnunetcurl_dep, + gnunetjson_dep, + gnunetutil_dep, + mhd_dep, + json_dep, + curl_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: exch_plugindir, +) diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am @@ -1,131 +0,0 @@ -# This Makefile.am is in the public domain - -AM_CPPFLAGS = \ - -I$(top_srcdir)/src/include \ - $(LIBGCRYPT_CFLAGS) \ - $(POSTGRESQL_CPPFLAGS) - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - - -# Libraries - -lib_LTLIBRARIES = \ - libtalerauditor.la \ - libtalerexchange.la - -libtalerexchange_la_LDFLAGS = \ - -version-info 20:0:0 \ - -no-undefined -libtalerexchange_la_SOURCES = \ - exchange_api_delete-purses-PURSE_PUB.c \ - exchange_api_get-aml-OFFICER_PUB-attributes-H_NORMALIZED_PAYTO.c \ - exchange_api_get-aml-OFFICER_PUB-decisions.c \ - exchange_api_get-aml-OFFICER_PUB-kyc-statistics-NAMES.c \ - exchange_api_get-aml-OFFICER_PUB-legitimizations.c \ - exchange_api_get-aml-OFFICER_PUB-measures.c \ - exchange_api_get-coins-COIN_PUB-history.c \ - exchange_api_get-contracts-CONTRACT_PUB.c \ - exchange_api_get-deposits-H_WIRE-MERCHANT_PUB-H_CONTRACT_TERMS-COIN_PUB.c \ - exchange_api_get-kyc-check-H_NORMALIZED_PAYTO.c \ - exchange_api_get-kyc-info-ACCESS_TOKEN.c \ - exchange_api_get-kyc-proof-PROVIDER_NAME.c \ - exchange_api_get-keys.c \ - exchange_api_get-management-keys.c \ - exchange_api_get-purses-PURSE_PUB-merge.c \ - exchange_api_get-reserves-RESERVE_PUB.c \ - exchange_api_get-reserves-RESERVE_PUB-attest.c \ - exchange_api_get-reserves-RESERVE_PUB-history.c \ - exchange_api_get-transfers-WTID.c \ - exchange_api_common.c exchange_api_common.h \ - exchange_api_curl_defaults.c exchange_api_curl_defaults.h \ - exchange_api_handle.c exchange_api_handle.h \ - exchange_api_post-aml-OFFICER_PUB-decision.c \ - exchange_api_post-auditors-AUDITOR_PUB-H_DENOM_PUB.c \ - exchange_api_post-batch-deposit.c \ - exchange_api_post-blinding-prepare.c \ - exchange_api_post-coins-COIN_PUB-refund.c \ - exchange_api_post-kyc-start-ID.c \ - exchange_api_post-kyc-wallet.c \ - exchange_api_post-management-aml-officers.c \ - exchange_api_post-management-auditors-AUDITOR_PUB-disable.c \ - exchange_api_post-management-auditors.c \ - exchange_api_post-management-denominations-H_DENOM_PUB-revoke.c \ - exchange_api_post-management-drain.c \ - exchange_api_post-management-extensions.c \ - exchange_api_post-management-global-fees.c \ - exchange_api_post-management-keys.c \ - exchange_api_post-management-partners.c \ - exchange_api_post-management-signkeys-EXCHANGE_PUB-revoke.c \ - exchange_api_post-management-wire-disable.c \ - exchange_api_post-management-wire-fee.c \ - exchange_api_post-management-wire.c \ - exchange_api_post-melt.c \ - exchange_api_post-purses-PURSE_PUB-create.c \ - exchange_api_post-purses-PURSE_PUB-deposit.c \ - exchange_api_post-purses-PURSE_PUB-merge.c \ - exchange_api_post-recoup-refresh.c \ - exchange_api_post-recoup-withdraw.c \ - exchange_api_post-reserves-RESERVE_PUB-attest.c \ - exchange_api_post-reserves-RESERVE_PUB-close.c \ - exchange_api_post-reserves-RESERVE_PUB-open.c \ - exchange_api_post-reserves-RESERVE_PUB-purse.c \ - exchange_api_post-reveal-melt.c \ - exchange_api_post-reveal-withdraw.c \ - exchange_api_post-withdraw.c \ - exchange_api_post-withdraw_blinded.c \ - exchange_api_refresh_common.c exchange_api_refresh_common.h \ - exchange_api_restrictions.c \ - exchange_api_stefan.c - -libtalerexchange_la_LIBADD = \ - libtalerauditor.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/kyclogic/libtalerkyclogic.la \ - $(top_builddir)/src/curl/libtalercurl.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/extensions/libtalerextensions.la \ - -lgnunetcurl \ - -lgnunetjson \ - -lgnunetutil \ - -ljansson \ - -lcurl \ - -lm \ - $(XLIB) - -libtalerauditor_la_LDFLAGS = \ - -version-info 0:0:0 \ - -no-undefined -libtalerauditor_la_SOURCES = \ - auditor_api_curl_defaults.c auditor_api_curl_defaults.h \ - auditor_api_get_config.c \ - auditor_api_put_deposit_confirmation.c -libtalerauditor_la_LIBADD = \ - $(top_builddir)/src/curl/libtalercurl.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetcurl \ - -lgnunetjson \ - -lgnunetutil \ - -ljansson \ - -lcurl \ - -lm \ - $(XLIB) - - -check_PROGRAMS = \ - test_stefan - -TESTS = \ - $(check_PROGRAMS) - - -test_stefan_SOURCES = \ - test_stefan.c -test_stefan_LDADD = \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetutil diff --git a/src/lib/meson.build b/src/lib/meson.build @@ -0,0 +1,149 @@ +# This build file is in the public domain + +# Libraries + +libtalerexchange_la_SOURCES = [ + 'exchange_api_delete-purses-PURSE_PUB.c', + 'exchange_api_get-aml-OFFICER_PUB-attributes-H_NORMALIZED_PAYTO.c', + 'exchange_api_get-aml-OFFICER_PUB-decisions.c', + 'exchange_api_get-aml-OFFICER_PUB-kyc-statistics-NAMES.c', + 'exchange_api_get-aml-OFFICER_PUB-legitimizations.c', + 'exchange_api_get-aml-OFFICER_PUB-measures.c', + 'exchange_api_get-coins-COIN_PUB-history.c', + 'exchange_api_get-contracts-CONTRACT_PUB.c', + 'exchange_api_get-deposits-H_WIRE-MERCHANT_PUB-H_CONTRACT_TERMS-COIN_PUB.c', + 'exchange_api_get-kyc-check-H_NORMALIZED_PAYTO.c', + 'exchange_api_get-kyc-info-ACCESS_TOKEN.c', + 'exchange_api_get-kyc-proof-PROVIDER_NAME.c', + 'exchange_api_get-keys.c', + 'exchange_api_get-management-keys.c', + 'exchange_api_get-purses-PURSE_PUB-merge.c', + 'exchange_api_get-reserves-RESERVE_PUB-attest.c', + 'exchange_api_get-reserves-RESERVE_PUB.c', + 'exchange_api_get-reserves-RESERVE_PUB-history.c', + 'exchange_api_get-transfers-WTID.c', + 'exchange_api_common.c', + 'exchange_api_curl_defaults.c', + 'exchange_api_handle.c', + 'exchange_api_post-aml-OFFICER_PUB-decision.c', + 'exchange_api_post-auditors-AUDITOR_PUB-H_DENOM_PUB.c', + 'exchange_api_post-batch-deposit.c', + 'exchange_api_post-blinding-prepare.c', + 'exchange_api_post-coins-COIN_PUB-refund.c', + 'exchange_api_post-kyc-start-ID.c', + 'exchange_api_post-kyc-wallet.c', + 'exchange_api_post-management-aml-officers.c', + 'exchange_api_post-management-auditors-AUDITOR_PUB-disable.c', + 'exchange_api_post-management-auditors.c', + 'exchange_api_post-management-denominations-H_DENOM_PUB-revoke.c', + 'exchange_api_post-management-drain.c', + 'exchange_api_post-management-extensions.c', + 'exchange_api_post-management-global-fees.c', + 'exchange_api_post-management-keys.c', + 'exchange_api_post-management-partners.c', + 'exchange_api_post-management-signkeys-EXCHANGE_PUB-revoke.c', + 'exchange_api_post-management-wire-disable.c', + 'exchange_api_post-management-wire-fee.c', + 'exchange_api_post-management-wire.c', + 'exchange_api_post-melt.c', + 'exchange_api_post-purses-PURSE_PUB-create.c', + 'exchange_api_post-purses-PURSE_PUB-deposit.c', + 'exchange_api_post-purses-PURSE_PUB-merge.c', + 'exchange_api_post-recoup-refresh.c', + 'exchange_api_post-recoup-withdraw.c', + 'exchange_api_post-reserves-RESERVE_PUB-attest.c', + 'exchange_api_post-reserves-RESERVE_PUB-close.c', + 'exchange_api_post-reserves-RESERVE_PUB-open.c', + 'exchange_api_post-reserves-RESERVE_PUB-purse.c', + 'exchange_api_post-reveal-melt.c', + 'exchange_api_post-reveal-withdraw.c', + 'exchange_api_post-withdraw.c', + 'exchange_api_post-withdraw_blinded.c', + 'exchange_api_refresh_common.c', + 'exchange_api_restrictions.c', + 'exchange_api_stefan.c', +] + +libtalerauditor = library( + 'talerauditor', + [ + 'auditor_api_curl_defaults.c', + 'auditor_api_get_config.c', + 'auditor_api_put_deposit_confirmation.c', + ], + soversion: solibversions['libtalerauditor']['soversion'], + version: solibversions['libtalerauditor']['soversion'], + install_rpath: rpath_option, + dependencies: [ + libtalercurl_dep, + libtalerjson_dep, + libtalerutil_dep, + gnunetutil_dep, + gnunetcurl_dep, + gnunetjson_dep, + json_dep, + curl_dep, + m_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalerauditor_dep = declare_dependency(link_with: libtalerauditor) +pkg.generate( + libtalerauditor, + url: 'https://taler.net', + description: 'GNU Taler auditor library', +) + + +libtalerexchange = library( + 'talerexchange', + libtalerexchange_la_SOURCES, + soversion: solibversions['libtalerexchange']['soversion'], + version: solibversions['libtalerexchange']['soversion'], + install_rpath: rpath_option, + dependencies: [ + libtalerauditor_dep, + libtalerkyclogic_dep, + libtalercurl_dep, + libtalerextensions_dep, + libtalerjson_dep, + libtalerutil_dep, + gnunetutil_dep, + gnunetcurl_dep, + gnunetjson_dep, + json_dep, + curl_dep, + m_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalerexchange_dep = declare_dependency(link_with: libtalerexchange) +pkg.generate( + libtalerexchange, + url: 'https://taler.net', + description: 'GNU Taler exchange library', +) + + +test_stefan = executable( + 'test_stefan', + ['test_stefan.c'.format(t)], + dependencies: [gnunetutil_dep, libtalerutil_dep, libtalerexchange_dep], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_stefan', + test_stefan, + workdir: meson.current_build_dir(), + suite: ['stefan', 'installcheck'], +) + + diff --git a/src/meson.build b/src/meson.build @@ -0,0 +1,32 @@ +configure_file( + input: 'taler-exchange.conf', + output: 'taler-exchange.conf', + configuration: cdata, + install: true, + install_dir: pkgcfgdir, +) + +subdir('include') +subdir('util') +subdir('json') +subdir('extensions') +subdir('curl') +if pq_dep.found() + subdir('pq') +endif +if sqlite_dep.found() + subdir('sq') +endif +subdir('mhd') +subdir('templating') +subdir('bank-lib') +subdir('kyclogic') +subdir('exchangedb') +subdir('exchange') +subdir('auditordb') +subdir('auditor') +subdir('lib') +subdir('exchange-tools') +subdir('extensions/age_restriction') +subdir('testing') +subdir('benchmark') diff --git a/src/mhd/Makefile.am b/src/mhd/Makefile.am @@ -1,79 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -lib_LTLIBRARIES = \ - libtalermhd.la - -libtalermhd_la_SOURCES = \ - mhd.c \ - mhd_config.c \ - mhd_legal.c \ - mhd_parsing.c \ - mhd_responses.c \ - mhd_run.c \ - mhd_spa.c \ - mhd_typst.c -libtalermhd_la_LDFLAGS = \ - -version-info 8:0:1 \ - -no-undefined -libtalermhd_la_LIBADD = \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetjson \ - -lgnunetmhd \ - -lgnunetutil \ - -lmicrohttpd \ - -ljansson \ - -lz \ - $(XLIB) - -if HAVE_MHD2 -lib_LTLIBRARIES += \ - libtalermhd2.la -endif - -libtalermhd2_la_SOURCES = \ - mhd_config.c \ - mhd2.c \ - mhd2_legal.c \ - mhd2_responses.c \ - mhd2_run.c \ - mhd2_spa.c -libtalermhd2_la_LDFLAGS = \ - -version-info 0:0:0 \ - -no-undefined -libtalermhd2_la_LIBADD = \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetjson \ - -lgnunetutil \ - -lmicrohttpd2 \ - -ljansson \ - -lz \ - $(XLIB) - -AM_TESTS_ENVIRONMENT=export TALER_EXCHANGE_PREFIX=$${TALER_EXCHANGE_PREFIX:-@libdir@};export PATH=$${TALER_EXCHANGE_PREFIX:-@prefix@}/bin:$$PATH;export TALER_AUDITOR_PREFIX=$${TALER_AUDITOR_PREFIX:-@libdir@}; - -EXTRA_DIST = \ - test_typst.conf \ - test_typst_1.typ - -check_PROGRAMS = \ - test_typst - -TESTS = $(check_PROGRAMS) - -test_typst_SOURCES = \ - test_typst.c -test_typst_LDADD = \ - libtalermhd.la \ - -ltalerutil \ - -lmicrohttpd \ - -lgnunetjson \ - -ljansson \ - -lgnunetutil diff --git a/src/mhd/meson.build b/src/mhd/meson.build @@ -0,0 +1,155 @@ +configure_file( + input: 'test_typst.conf', + output: 'test_typst.conf', + configuration: cdata, + install: true, + install_dir: pkgcfgdir, +) + +configure_file( + input: 'test_typst_1.typ', + output: 'test_typst_1.typ', + configuration: cdata, + install: true, + install_dir: pkgcfgdir, +) + + + +libtalermhd_src = [ + 'mhd.c', + 'mhd_config.c', + 'mhd_legal.c', + 'mhd_parsing.c', + 'mhd_responses.c', + 'mhd_run.c', + 'mhd_spa.c', + 'mhd_typst.c', +] + +libtalermhd = library( + 'talermhd', + libtalermhd_src, + soversion: solibversions['libtalermhd']['soversion'], + version: solibversions['libtalermhd']['soversion'], + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetmhd_dep, + json_dep, + mhd_dep, + zlib_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalermhd_dep = declare_dependency(link_with: libtalermhd) +pkg.generate( + libtalermhd, + url: 'https://taler.net', + description: 'GNU Taler microhttpd library', +) + +talermhd_tests = [] + +talermhd_tests_installcheck = ['test_typst'] + +foreach t : talermhd_tests + + test_tmp = executable( + t, + ['@0@.c'.format(t)], + dependencies: [ + gnunetutil_dep, + gnunetjson_dep, + libtalermhd_dep, + libtalerutil_dep, + json_dep, + mhd_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + t, + test_tmp, + workdir: meson.current_build_dir(), + env: ['PWD=' + meson.current_build_dir()], + suite: ['mhd'], + ) +endforeach + +foreach t : talermhd_tests_installcheck + + test_tmp = executable( + t, + ['@0@.c'.format(t)], + dependencies: [ + gnunetutil_dep, + gnunetjson_dep, + libtalermhd_dep, + libtalerutil_dep, + json_dep, + mhd_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + t, + test_tmp, + workdir: meson.current_build_dir(), + env: ['PWD=' + meson.current_build_dir()], + suite: ['mhd', 'installcheck'], + ) + + +endforeach + +if mhd2_dep.found() + + libtalermhd2_src = [ + 'mhd2.c', + 'mhd2_config.c', + 'mhd2_legal.c', + 'mhd2_responses.c', + 'mhd2_run.c', + 'mhd2_spa.c', + ] + + libtalermhd2 = library( + 'talermhd2', + libtalermhd2_src, + soversion: solibversions['libtalermhd2']['soversion'], + version: solibversions['libtalermhd2']['soversion'], + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + libtalerjson_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetmhd_dep, + json_dep, + mhd2_dep, + zlib_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), + ) + + libtalermhd2_dep = declare_dependency(link_with: libtalermhd2) + pkg.generate( + libtalermhd2, + url: 'https://taler.net', + description: 'GNU Taler microhttpd2 wrapper library', + ) + +endif diff --git a/src/mhd/test_typst_1.typ b/src/mhd/test_typst_1.typ @@ -36,7 +36,7 @@ grid( columns: (50%, 50%), gutter: 1em, - image(datadir + "/typst-forms/vss_vqf_verein.png", width: 80%), + image(datadir + "/typst/packages/taler-exchange/common/0.0.0/vss_vqf_verein.png", width: 80%), align(right)[ #table( columns: (1fr, 1fr), diff --git a/src/pq/Makefile.am b/src/pq/Makefile.am @@ -1,42 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include $(LIBGCRYPT_CFLAGS) $(POSTGRESQL_CPPFLAGS) - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -lib_LTLIBRARIES = \ - libtalerpq.la - -libtalerpq_la_SOURCES = \ - pq_common.h pq_common.c \ - pq_query_helper.c \ - pq_result_helper.c -libtalerpq_la_LIBADD = \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetutil -ljansson \ - -lgnunetpq \ - -lpq \ - $(XLIB) -libtalerpq_la_LDFLAGS = \ - $(POSTGRESQL_LDFLAGS) \ - -version-info 0:1:0 \ - -no-undefined - -check_PROGRAMS= \ - test_pq - -TESTS = \ - $(check_PROGRAMS) - -test_pq_SOURCES = \ - test_pq.c -test_pq_LDADD = \ - libtalerpq.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetpq \ - -lgnunetutil \ - -ljansson \ - -lpq \ - $(XLIB) diff --git a/src/pq/meson.build b/src/pq/meson.build @@ -0,0 +1,70 @@ +libtalerpq_src = ['pq_common.c', 'pq_query_helper.c', 'pq_result_helper.c'] + +libtalerpq = library( + 'talerpq', + libtalerpq_src, + soversion: solibversions['libtalerpq']['soversion'], + version: solibversions['libtalerpq']['soversion'], + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + gnunetutil_dep, + gnunetpq_dep, + json_dep, + pq_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalerpq_dep = declare_dependency(link_with: libtalerpq) +pkg.generate( + libtalerpq, + url: 'https://taler.net', + description: 'GNU Taler postgresql wrapper library', +) + +talerpq_tests = ['test_pq'] + +talerpq_tests_installcheck = [] + +foreach t : talerpq_tests + + test_tmp = executable( + t, + ['@0@.c'.format(t)], + dependencies: [ + gnunetutil_dep, + gnunetpq_dep, + libtalerpq_dep, + libtalerutil_dep, + json_dep, + pq_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test(t, test_tmp, workdir: meson.current_build_dir(), suite: ['pq']) +endforeach + +foreach t : talerpq_tests_installcheck + + test_tmp = executable( + t, + ['@0@.c'.format(t)], + dependencies: [gnunetutil_dep, libtalerutil_dep, json_dep], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + t, + test_tmp, + workdir: meson.current_build_dir(), + suite: ['pq', 'installcheck'], + ) + + +endforeach diff --git a/src/sq/Makefile.am b/src/sq/Makefile.am @@ -1,40 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include $(LIBGCRYPT_CFLAGS) $(SQLITE_CPPFLAGS) - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -lib_LTLIBRARIES = \ - libtalersq.la - -libtalersq_la_SOURCES = \ - sq_query_helper.c \ - sq_result_helper.c -libtalersq_la_LIBADD = \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetutil -ljansson \ - -lsqlite3 \ - $(XLIB) -libtalersq_la_LDFLAGS = \ - $(SQLITE_LDFLAGS) \ - -version-info 0:0:0 \ - -no-undefined - -check_PROGRAMS= \ - test_sq - -TESTS = \ - $(check_PROGRAMS) - -test_sq_SOURCES = \ - test_sq.c -test_sq_LDADD = \ - libtalersq.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetsq \ - -lgnunetutil \ - -ljansson \ - -lsqlite3 \ - $(XLIB) diff --git a/src/sq/meson.build b/src/sq/meson.build @@ -0,0 +1,70 @@ +libtalersq_src = ['sq_query_helper.c', 'sq_result_helper.c'] + +libtalersq = library( + 'talersq', + libtalersq_src, + soversion: solibversions['libtalersq']['soversion'], + version: solibversions['libtalersq']['soversion'], + install_rpath: rpath_option, + dependencies: [ + libtalerutil_dep, + gnunetutil_dep, + gnunetsq_dep, + json_dep, + sqlite_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalersq_dep = declare_dependency(link_with: libtalersq) +pkg.generate( + libtalersq, + url: 'https://taler.net', + description: 'GNU Taler sqlite wrapper library', +) + +talersq_tests = ['test_sq'] + +talersq_tests_installcheck = [] + +foreach t : talersq_tests + + test_tmp = executable( + t, + ['@0@.c'.format(t)], + dependencies: [ + gnunetutil_dep, + gnunetsq_dep, + libtalersq_dep, + libtalerutil_dep, + json_dep, + sqlite_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test(t, test_tmp, workdir: meson.current_build_dir(), suite: ['sq']) +endforeach + +foreach t : talersq_tests_installcheck + + test_tmp = executable( + t, + ['@0@.c'.format(t)], + dependencies: [gnunetutil_dep, libtalerutil_dep, json_dep], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + t, + test_tmp, + workdir: meson.current_build_dir(), + suite: ['sq', 'installcheck'], + ) + + +endforeach diff --git a/src/templating/Makefile.am b/src/templating/Makefile.am @@ -1,133 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include $(LIBGCRYPT_CFLAGS) - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -noinst_PROGRAMS = \ - taler-mustach-tool - -taler_mustach_tool_SOURCES = \ - mustach-tool.c \ - mustach-jansson.h -taler_mustach_tool_LDADD = \ - libmustach.la \ - $(XLIB) \ - -ljansson -taler_mustach_tool_CFLAGS = \ - -DTOOL=MUSTACH_TOOL_JANSSON \ - -DMUSTACH_SAFE=1 \ - -DMUSTACH_LOAD_TEMPLATE=0 - -lib_LTLIBRARIES = \ - libtalertemplating.la - -noinst_LTLIBRARIES = \ - libmustach.la - -libtalertemplating_la_SOURCES = \ - mustach.c mustach.h \ - mustach-wrap.c mustach-wrap.h \ - mustach-jansson.c mustach-jansson.h \ - templating_api.c -libtalertemplating_la_LIBADD = \ - $(top_builddir)/src/mhd/libtalermhd.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lmicrohttpd \ - -lgnunetjson \ - -lgnunetutil \ - -ljansson \ - $(XLIB) -libtalertemplating_la_LDFLAGS = \ - -version-info 1:1:1 \ - -no-undefined -libtalertemplating_la_CFLAGS = \ - -DMUSTACH_SAFE=1 \ - -DMUSTACH_LOAD_TEMPLATE=0 - -libmustach_la_SOURCES = \ - mustach.c mustach.h \ - mustach-wrap.c mustach-wrap.h \ - mustach-jansson.c mustach-jansson.h - -test_mustach_jansson_SOURCES = \ - test_mustach_jansson.c -test_mustach_jansson_LDADD = \ - -lgnunetutil \ - -ljansson \ - -lmustach \ - $(XLIB) - -check_PROGRAMS = \ - test_mustach_jansson - -TESTS = $(check_PROGRAMS) - -EXTRA_DIST = \ - $(check_SCRIPTS) \ - mustach-original-Makefile \ - mustach.1.gz \ - mustach.1.scd \ - meson.build \ - LICENSE.txt \ - ORIGIN \ - pkgcfgs \ - README.md \ - dotest.sh \ - AUTHORS \ - CHANGELOG.md \ - mustach-json-c.h \ - mustach-json-c.c \ - mustach-cjson.h \ - mustach-cjson.c \ - test1/json \ - test1/Makefile \ - test1/must \ - test1/resu.ref \ - test1/vg.ref \ - test2/json \ - test2/Makefile \ - test2/must \ - test2/resu.ref \ - test2/vg.ref \ - test3/json \ - test3/Makefile \ - test3/must \ - test3/resu.ref \ - test3/vg.ref \ - test4/json \ - test4/Makefile \ - test4/must \ - test4/resu.ref \ - test4/vg.ref \ - test5/json \ - test5/Makefile \ - test5/must \ - test5/must2 \ - test5/must2.mustache \ - test5/must3.mustache \ - test5/resu.ref \ - test5/vg.ref \ - test6/json \ - test6/Makefile \ - test6/must \ - test6/resu.ref \ - test6/test-custom-write.c \ - test6/vg.ref \ - test7/base.mustache \ - test7/json \ - test7/Makefile \ - test7/node.mustache \ - test7/resu.ref \ - test7/vg.ref \ - test8/json \ - test8/Makefile \ - test8/must \ - test8/resu.ref \ - test8/vg.ref \ - test-specs/test-specs.c \ - test-specs/test-specs-cjson.ref \ - test-specs/test-specs-jansson.ref \ - test-specs/test-specs-json-c.ref diff --git a/src/templating/meson.build b/src/templating/meson.build @@ -1,12 +1,65 @@ -project('mustach', 'c', - version: '1.0.0' +# This meson.build is in the public domain + +libmustach = static_library( + 'mustach', + ['mustach.c', 'mustach-wrap.c', 'mustach-jansson.c'], + install: false, +) + +libmustach_dep = declare_dependency(link_with: libmustach) + +executable( + 'taler-mustach-tool', + ['mustach-tool.c'], + dependencies: [libmustach_dep, json_dep], + include_directories: [incdir, configuration_inc], + install: false, + c_args: [ + '-DTOOL=MUSTACH_TOOL_JANSSON', + '-DMUSTACH_SAFE=1', + '-DMUSTACH_LOAD_TEMPLATE=0', + ], +) + +libtalertemplating = library( + 'talertemplating', + ['mustach.c', 'mustach-wrap.c', 'mustach-jansson.c', 'templating_api.c'], + soversion: solibversions['libtalertemplating']['soversion'], + version: solibversions['libtalertemplating']['soversion'], + dependencies: [ + libtalermhd_dep, + libtalerutil_dep, + mhd_dep, + gnunetjson_dep, + gnunetutil_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + c_args: ['-DMUSTACH_SAFE=1', '-DMUSTACH_LOAD_TEMPLATE=0'], + install: true, + install_dir: get_option('libdir'), ) -mustach_inc = include_directories('.') -mustach_lib = shared_library('mustach', - 'mustach.c', - include_directories: mustach_inc +libtalertemplating_dep = declare_dependency(link_with: libtalertemplating) +pkg.generate( + libtalertemplating, + url: 'https://taler.net', + description: 'GNU Taler templating library', ) -mustach_dep = declare_dependency(link_with: mustach_lib, - include_directories: mustach_inc) + +test_mustach_jansson = executable( + 'test_mustach_jansson', + ['test_mustach_jansson.c'], + dependencies: [gnunetutil_dep, json_dep, libmustach_dep], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) + +test( + 'test_mustach_jansson', + test_mustach_jansson, + workdir: meson.current_build_dir(), + suite: ['templating'], +) diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am @@ -1,598 +0,0 @@ -# This Makefile.am is in the public domain - -AM_CPPFLAGS = \ - -I$(top_srcdir)/src/include \ - $(LIBGCRYPT_CFLAGS) \ - $(POSTGRESQL_CPPFLAGS) - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -clean-local: - rm -rf report* - -bin_SCRIPTS = \ - taler-unified-setup.sh - -# Libraries - -lib_LTLIBRARIES = \ - libtalertesting.la - -if HAVE_TWISTER -lib_LTLIBRARIES += libtalertwistertesting.la -libtalertwistertesting_la_SOURCES = \ - testing_api_twister_helpers.c \ - testing_api_cmd_twister_exec_client.c -libtalertwistertesting_la_LIBADD = \ - -lgnunetutil \ - libtalertesting.la \ - -ltalertwister \ - $(XLIB) -libtalertwistertesting_la_LDFLAGS = \ - $(GN_LIB_LDFLAGS) $(WINFLAGS) \ - -version-info 0:1:0 -endif - -libtalertesting_la_LDFLAGS = \ - -version-info 4:0:0 \ - -no-undefined -libtalertesting_la_SOURCES = \ - testing_api_cmd_age_withdraw.c \ - testing_api_cmd_auditor_add_denom_sig.c \ - testing_api_cmd_auditor_add.c \ - testing_api_cmd_auditor_del.c \ - testing_api_cmd_auditor_deposit_confirmation.c \ - testing_api_cmd_auditor_exec_auditor.c \ - testing_api_cmd_auditor_exec_auditor_dbinit.c \ - testing_api_cmd_bank_account_token.c \ - testing_api_cmd_bank_admin_add_incoming.c \ - testing_api_cmd_bank_admin_add_kycauth.c \ - testing_api_cmd_bank_check.c \ - testing_api_cmd_bank_admin_check.c \ - testing_api_cmd_bank_check_empty.c \ - testing_api_cmd_bank_history_credit.c \ - testing_api_cmd_bank_history_debit.c \ - testing_api_cmd_bank_transfer.c \ - testing_api_cmd_batch.c \ - testing_api_cmd_batch_deposit.c \ - testing_api_cmd_batch_withdraw.c \ - testing_api_cmd_check_aml_decisions.c \ - testing_api_cmd_coin_history.c \ - testing_api_cmd_common.c \ - testing_api_cmd_contract_get.c \ - testing_api_cmd_deposit.c \ - testing_api_cmd_deposits_get.c \ - testing_api_cmd_exec_aggregator.c \ - testing_api_cmd_exec_auditor-offline.c \ - testing_api_cmd_exec_closer.c \ - testing_api_cmd_exec_expire.c \ - testing_api_cmd_exec_router.c \ - testing_api_cmd_exec_transfer.c \ - testing_api_cmd_exec_wget.c \ - testing_api_cmd_exec_wirewatch.c \ - testing_api_cmd_get_active_legitimization_measures.c \ - testing_api_cmd_get_auditor.c \ - testing_api_cmd_get_exchange.c \ - testing_api_cmd_get_kyc_info.c \ - testing_api_cmd_insert_deposit.c \ - testing_api_cmd_kyc_check_get.c \ - testing_api_cmd_kyc_proof.c \ - testing_api_cmd_kyc_wallet_get.c \ - testing_api_cmd_oauth.c \ - testing_api_cmd_offline_sign_global_fees.c \ - testing_api_cmd_offline_sign_wire_fees.c \ - testing_api_cmd_offline_sign_keys.c \ - testing_api_cmd_offline_sign_extensions.c \ - testing_api_cmd_post_kyc_form.c \ - testing_api_cmd_post_kyc_start.c \ - testing_api_cmd_purse_create_deposit.c \ - testing_api_cmd_purse_delete.c \ - testing_api_cmd_purse_deposit.c \ - testing_api_cmd_purse_get.c \ - testing_api_cmd_purse_merge.c \ - testing_api_cmd_recoup.c \ - testing_api_cmd_recoup_refresh.c \ - testing_api_cmd_refund.c \ - testing_api_cmd_refresh.c \ - testing_api_cmd_reserve_attest.c \ - testing_api_cmd_reserve_close.c \ - testing_api_cmd_reserve_get.c \ - testing_api_cmd_reserve_get_attestable.c \ - testing_api_cmd_reserve_history.c \ - testing_api_cmd_reserve_open.c \ - testing_api_cmd_reserve_purse.c \ - testing_api_cmd_revoke.c \ - testing_api_cmd_revoke_denom_key.c \ - testing_api_cmd_revoke_sign_key.c \ - testing_api_cmd_run_fakebank.c \ - testing_api_cmd_set_officer.c \ - testing_api_cmd_set_wire_fee.c \ - testing_api_cmd_signal.c \ - testing_api_cmd_sleep.c \ - testing_api_cmd_stat.c \ - testing_api_cmd_system_start.c \ - testing_api_cmd_take_aml_decision.c \ - testing_api_cmd_transfer_get.c \ - testing_api_cmd_wait.c \ - testing_api_cmd_wire_add.c \ - testing_api_cmd_wire_del.c \ - testing_api_cmd_withdraw.c \ - testing_api_loop.c \ - testing_api_misc.c \ - testing_api_traits.c - - -libtalertesting_la_LIBADD = \ - $(top_builddir)/src/lib/libtalerauditor.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/kyclogic/libtalerkyclogic.la \ - $(top_builddir)/src/mhd/libtalermhd.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/extensions/libtalerextensions.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - -lgnunetcurl \ - -lgnunetjson \ - -lgnunetutil \ - -ljansson \ - -lmicrohttpd \ - -lcurl \ - $(XLIB) - - -# Test cases - -AM_TESTS_ENVIRONMENT=export TALER_EXCHANGE_PREFIX=$${TALER_EXCHANGE_PREFIX:-@libdir@};export PATH=$${TALER_EXCHANGE_PREFIX:-@prefix@}/bin:$$PATH;export TALER_AUDITOR_PREFIX=$${TALER_AUDITOR_PREFIX:-@libdir@}; - - -check_PROGRAMS = \ - test_auditor_api_version \ - test_auditor_api_cs \ - test_auditor_api_rsa \ - test_bank_api_with_fakebank \ - test_bank_api_with_nexus \ - test_exchange_api_cs \ - test_exchange_api_rsa \ - test_exchange_api_age_restriction_cs \ - test_exchange_api_age_restriction_rsa \ - test_exchange_api_keys_cherry_picking_cs \ - test_exchange_api_keys_cherry_picking_rsa \ - test_exchange_api_overlapping_keys_bug_cs \ - test_exchange_api_overlapping_keys_bug_rsa \ - test_exchange_management_api_cs \ - test_exchange_management_api_rsa \ - test_kyc_api \ - test_taler_exchange_aggregator-postgres \ - test_taler_exchange_wirewatch-postgres \ - test_exchange_p2p_cs \ - test_exchange_p2p_rsa -if HAVE_TWISTER - check_PROGRAMS += \ - test_exchange_api_twisted_cs \ - test_exchange_api_twisted_rsa \ - test_bank_api_with_fakebank_twisted -endif - -# Removed for now... -# test_auditor_api_cs -# test_auditor_api_rsa - -# FIXME_9828 -# test_exchange_api_revocation_cs -# test_exchange_api_revocation_rsa - -check_SCRIPTS = \ - test-sanctions.sh \ - test-exchange-taler-harness.sh - -TESTS = \ - $(check_PROGRAMS) \ - $(check_SCRIPTS) - -test_auditor_api_cs_SOURCES = \ - test_auditor_api.c -test_auditor_api_cs_LDADD = \ - $(top_builddir)/src/lib/libtalerauditor.la \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_auditor_api_rsa_SOURCES = \ - test_auditor_api.c -test_auditor_api_rsa_LDADD = \ - $(top_builddir)/src/lib/libtalerauditor.la \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - - -test_auditor_api_version_SOURCES = \ - test_auditor_api_version.c -test_auditor_api_version_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerauditor.la \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_bank_api_with_nexus_SOURCES = \ - test_bank_api.c -test_bank_api_with_nexus_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - -lgnunetutil \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(XLIB) - -test_bank_api_with_fakebank_SOURCES = \ - test_bank_api.c -test_bank_api_with_fakebank_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - -lgnunetutil \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(XLIB) - -test_exchange_api_cs_SOURCES = \ - test_exchange_api.c -test_exchange_api_cs_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/extensions/libtalerextensions.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_exchange_api_rsa_SOURCES = \ - test_exchange_api.c -test_exchange_api_rsa_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/extensions/libtalerextensions.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_exchange_api_age_restriction_cs_SOURCES = \ - test_exchange_api_age_restriction.c -test_exchange_api_age_restriction_cs_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/extensions/libtalerextensions.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_exchange_api_age_restriction_rsa_SOURCES = \ - test_exchange_api_age_restriction.c -test_exchange_api_age_restriction_rsa_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/extensions/libtalerextensions.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_exchange_p2p_cs_SOURCES = \ - test_exchange_p2p.c -test_exchange_p2p_cs_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/extensions/libtalerextensions.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_exchange_p2p_rsa_SOURCES = \ - test_exchange_p2p.c -test_exchange_p2p_rsa_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/extensions/libtalerextensions.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - - -test_exchange_api_keys_cherry_picking_cs_SOURCES = \ - test_exchange_api_keys_cherry_picking.c -test_exchange_api_keys_cherry_picking_cs_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_exchange_api_keys_cherry_picking_rsa_SOURCES = \ - test_exchange_api_keys_cherry_picking.c -test_exchange_api_keys_cherry_picking_rsa_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -# FIXME_9828 -# test_exchange_api_revocation_cs_SOURCES = \ -# test_exchange_api_revocation.c -# test_exchange_api_revocation_cs_LDADD = \ -# libtalertesting.la \ -# $(top_builddir)/src/lib/libtalerexchange.la \ -# $(LIBGCRYPT_LIBS) \ -# $(top_builddir)/src/bank-lib/libtalerfakebank.la \ -# $(top_builddir)/src/bank-lib/libtalerbank.la \ -# $(top_builddir)/src/json/libtalerjson.la \ -# $(top_builddir)/src/util/libtalerutil.la \ -# -lgnunetcurl \ -# -lgnunetutil \ -# -ljansson \ -# $(XLIB) - -# FIXME_9828 -# test_exchange_api_revocation_rsa_SOURCES = \ -# test_exchange_api_revocation.c -# test_exchange_api_revocation_rsa_LDADD = \ -# libtalertesting.la \ -# $(top_builddir)/src/lib/libtalerexchange.la \ -# $(LIBGCRYPT_LIBS) \ -# $(top_builddir)/src/bank-lib/libtalerfakebank.la \ -# $(top_builddir)/src/bank-lib/libtalerbank.la \ -# $(top_builddir)/src/json/libtalerjson.la \ -# $(top_builddir)/src/util/libtalerutil.la \ -# -lgnunetcurl \ -# -lgnunetutil \ -# -ljansson \ -# $(XLIB) - - -test_exchange_api_overlapping_keys_bug_cs_SOURCES = \ - test_exchange_api_overlapping_keys_bug.c -test_exchange_api_overlapping_keys_bug_cs_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_exchange_api_overlapping_keys_bug_rsa_SOURCES = \ - test_exchange_api_overlapping_keys_bug.c -test_exchange_api_overlapping_keys_bug_rsa_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_exchange_management_api_cs_SOURCES = \ - test_exchange_management_api.c -test_exchange_management_api_cs_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetutil \ - $(XLIB) - -test_exchange_management_api_rsa_SOURCES = \ - test_exchange_management_api.c -test_exchange_management_api_rsa_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetutil \ - $(XLIB) - - -test_taler_exchange_aggregator_postgres_SOURCES = \ - test_taler_exchange_aggregator.c -test_taler_exchange_aggregator_postgres_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - libtalertesting.la \ - -lmicrohttpd \ - -lgnunetutil \ - -lgnunetjson \ - -ljansson \ - -lpthread \ - $(XLIB) - -test_taler_exchange_wirewatch_postgres_SOURCES = \ - test_taler_exchange_wirewatch.c -test_taler_exchange_wirewatch_postgres_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/exchangedb/libtalerexchangedb.la \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - libtalertesting.la \ - -lmicrohttpd \ - -lgnunetutil \ - -lgnunetjson \ - -lgnunetpq \ - -ljansson \ - -lpthread \ - $(XLIB) - -test_exchange_api_twisted_cs_SOURCES = \ - test_exchange_api_twisted.c -test_exchange_api_twisted_cs_LDADD = \ - $(LIBGCRYPT_LIBS) \ - libtalertesting.la \ - libtalertwistertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_exchange_api_twisted_rsa_SOURCES = \ - test_exchange_api_twisted.c -test_exchange_api_twisted_rsa_LDADD = \ - $(LIBGCRYPT_LIBS) \ - libtalertesting.la \ - libtalertwistertesting.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_bank_api_with_fakebank_twisted_SOURCES = \ - test_bank_api_twisted.c -test_bank_api_with_fakebank_twisted_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(top_builddir)/src/json/libtalerjson.la \ - libtalertwistertesting.la \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_kyc_api_SOURCES = \ - test_kyc_api.c -test_kyc_api_LDADD = \ - libtalertesting.la \ - $(top_builddir)/src/lib/libtalerauditor.la \ - $(top_builddir)/src/lib/libtalerexchange.la \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/bank-lib/libtalerfakebank.la \ - $(top_builddir)/src/bank-lib/libtalerbank.la \ - $(top_builddir)/src/json/libtalerjson.la \ - $(top_builddir)/src/util/libtalerutil.la \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -# Distribution - -EXTRA_DIST = \ - $(bin_SCRIPTS) \ - $(check_SCRIPTS) \ - valgrind.h \ - coins-cs.conf \ - coins-rsa.conf \ - sanction-list.json \ - test_exchange_api_home/.local/share/taler-auditor/offline-keys/auditor.priv \ - test_exchange_api_home/.local/share/taler-exchange/offline/master.priv \ - test_auditor_api-cs.conf \ - test_auditor_api-rsa.conf \ - test_auditor_api_expire_reserve_now-cs.conf \ - test_auditor_api_expire_reserve_now-rsa.conf \ - test_bank_api.conf \ - test_bank_api_fakebank.conf \ - test_bank_api_fakebank_twisted.conf \ - test_bank_api_nexus.conf \ - test_exchange_api.conf \ - test_exchange_api-cs.conf \ - test_exchange_api-rsa.conf \ - test_exchange_api_age_restriction.conf \ - test_exchange_api_age_restriction-cs.conf \ - test_exchange_api_age_restriction-rsa.conf \ - test_exchange_api-twisted.conf \ - test_exchange_api_twisted-cs.conf \ - test_exchange_api_twisted-rsa.conf \ - test_exchange_api_keys_cherry_picking.conf \ - test_exchange_api_keys_cherry_picking-cs.conf \ - test_exchange_api_keys_cherry_picking-rsa.conf \ - test_exchange_api_expire_reserve_now-cs.conf \ - test_exchange_api_expire_reserve_now-rsa.conf \ - test-taler-exchange-aggregator-postgres.conf \ - test-taler-exchange-wirewatch-postgres.conf \ - test_kyc_api.conf diff --git a/src/testing/meson.build b/src/testing/meson.build @@ -0,0 +1,890 @@ +# This build file is in the public domain + +#clean-local: +# rm -rf report* + +configure_file( + input: 'taler-unified-setup.sh', + output: 'taler-unified-setup.sh', + copy: true, + install: true, + install_dir: get_option('bindir'), +) + +# Libraries + +libtalertesting_la_SOURCES = [ + 'testing_api_cmd_age_withdraw.c', + 'testing_api_cmd_auditor_add_denom_sig.c', + 'testing_api_cmd_auditor_add.c', + 'testing_api_cmd_auditor_del.c', + 'testing_api_cmd_auditor_deposit_confirmation.c', + 'testing_api_cmd_auditor_exec_auditor.c', + 'testing_api_cmd_auditor_exec_auditor_dbinit.c', + 'testing_api_cmd_bank_account_token.c', + 'testing_api_cmd_bank_admin_add_incoming.c', + 'testing_api_cmd_bank_admin_add_kycauth.c', + 'testing_api_cmd_bank_check.c', + 'testing_api_cmd_bank_admin_check.c', + 'testing_api_cmd_bank_check_empty.c', + 'testing_api_cmd_bank_history_credit.c', + 'testing_api_cmd_bank_history_debit.c', + 'testing_api_cmd_bank_transfer.c', + 'testing_api_cmd_batch.c', + 'testing_api_cmd_batch_deposit.c', + 'testing_api_cmd_batch_withdraw.c', + 'testing_api_cmd_check_aml_decisions.c', + 'testing_api_cmd_coin_history.c', + 'testing_api_cmd_common.c', + 'testing_api_cmd_contract_get.c', + 'testing_api_cmd_deposit.c', + 'testing_api_cmd_deposits_get.c', + 'testing_api_cmd_exec_aggregator.c', + 'testing_api_cmd_exec_auditor-offline.c', + 'testing_api_cmd_exec_closer.c', + 'testing_api_cmd_exec_expire.c', + 'testing_api_cmd_exec_router.c', + 'testing_api_cmd_exec_transfer.c', + 'testing_api_cmd_exec_wget.c', + 'testing_api_cmd_exec_wirewatch.c', + 'testing_api_cmd_get_active_legitimization_measures.c', + 'testing_api_cmd_get_auditor.c', + 'testing_api_cmd_get_exchange.c', + 'testing_api_cmd_get_kyc_info.c', + 'testing_api_cmd_insert_deposit.c', + 'testing_api_cmd_kyc_check_get.c', + 'testing_api_cmd_kyc_proof.c', + 'testing_api_cmd_kyc_wallet_get.c', + 'testing_api_cmd_oauth.c', + 'testing_api_cmd_offline_sign_global_fees.c', + 'testing_api_cmd_offline_sign_wire_fees.c', + 'testing_api_cmd_offline_sign_keys.c', + 'testing_api_cmd_offline_sign_extensions.c', + 'testing_api_cmd_post_kyc_form.c', + 'testing_api_cmd_post_kyc_start.c', + 'testing_api_cmd_purse_create_deposit.c', + 'testing_api_cmd_purse_delete.c', + 'testing_api_cmd_purse_deposit.c', + 'testing_api_cmd_purse_get.c', + 'testing_api_cmd_purse_merge.c', + 'testing_api_cmd_recoup.c', + 'testing_api_cmd_recoup_refresh.c', + 'testing_api_cmd_refund.c', + 'testing_api_cmd_refresh.c', + 'testing_api_cmd_reserve_attest.c', + 'testing_api_cmd_reserve_close.c', + 'testing_api_cmd_reserve_get.c', + 'testing_api_cmd_reserve_get_attestable.c', + 'testing_api_cmd_reserve_history.c', + 'testing_api_cmd_reserve_open.c', + 'testing_api_cmd_reserve_purse.c', + 'testing_api_cmd_revoke.c', + 'testing_api_cmd_revoke_denom_key.c', + 'testing_api_cmd_revoke_sign_key.c', + 'testing_api_cmd_run_fakebank.c', + 'testing_api_cmd_set_officer.c', + 'testing_api_cmd_set_wire_fee.c', + 'testing_api_cmd_signal.c', + 'testing_api_cmd_sleep.c', + 'testing_api_cmd_stat.c', + 'testing_api_cmd_system_start.c', + 'testing_api_cmd_take_aml_decision.c', + 'testing_api_cmd_transfer_get.c', + 'testing_api_cmd_wait.c', + 'testing_api_cmd_wire_add.c', + 'testing_api_cmd_wire_del.c', + 'testing_api_cmd_withdraw.c', + 'testing_api_loop.c', + 'testing_api_misc.c', + 'testing_api_traits.c', +] + +libtalertesting = library( + 'talertesting', + libtalertesting_la_SOURCES, + soversion: solibversions['libtalertesting']['soversion'], + version: solibversions['libtalertesting']['soversion'], + install_rpath: rpath_option, + dependencies: [ + libtalerauditor_dep, + libtalerexchange_dep, + libtalerexchangedb_dep, + libtalermhd_dep, + libtalerextensions_dep, + libtalerbank_dep, + libtalerfakebank_dep, + libtalerkyclogic_dep, + libtalerjson_dep, + libtalerutil_dep, + gnunetutil_dep, + gnunetcurl_dep, + gnunetjson_dep, + json_dep, + curl_dep, + mhd_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalertesting_dep = declare_dependency(link_with: libtalertesting) +pkg.generate( + libtalertesting, + url: 'https://taler.net', + description: 'GNU Taler testing library', +) + +if twister_dep.found() + libtalertwistertesting = library( + 'talertwistertesting', + libtalertesting_la_SOURCES, + soversion: solibversions['libtalertwistertesting']['soversion'], + version: solibversions['libtalertwistertesting']['soversion'], + install_rpath: rpath_option, + dependencies: [libtalertesting_dep, twister_dep, gnunetutil_dep], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), + ) + + libtalertwistertesting_dep = declare_dependency( + link_with: libtalertwistertesting, + ) + pkg.generate( + libtalertesting, + url: 'https://taler.net', + description: 'GNU Taler twisted testing library', + ) + +endif + + +# Test cases + +#check_PROGRAMS = \ +# test_auditor_api_version \ +# test_auditor_api_cs \ +# test_auditor_api_rsa \ +# test_bank_api_with_fakebank \ +# test_bank_api_with_nexus \ +# test_exchange_api_cs \ +# test_exchange_api_rsa \ +# test_exchange_api_age_restriction_cs \ +# test_exchange_api_age_restriction_rsa \ +# test_exchange_api_keys_cherry_picking_cs \ +# test_exchange_api_keys_cherry_picking_rsa \ +# test_exchange_api_overlapping_keys_bug_cs \ +# test_exchange_api_overlapping_keys_bug_rsa \ +# test_exchange_management_api_cs \ +# test_exchange_management_api_rsa \ +# test_kyc_api \ +# test_taler_exchange_aggregator-postgres \ +# test_taler_exchange_wirewatch-postgres \ +# test_exchange_p2p_cs \ +# test_exchange_p2p_rsa +#if HAVE_TWISTER +# check_PROGRAMS += \ +# test_exchange_api_twisted_cs \ +# test_exchange_api_twisted_rsa \ +# test_bank_api_with_fakebank_twisted +#endif +# +## FIXME_9828 +## test_exchange_api_revocation_cs +## test_exchange_api_revocation_rsa +# +#check_SCRIPTS = \ +# test-sanctions.sh \ +# test-exchange-taler-harness.sh +# + +test_auditor_api_cs = executable( + 'test_auditor_api_cs', + ['test_auditor_api.c'], + dependencies: [ + libtalertesting_dep, + libtalerauditor_dep, + libtalerexchange_dep, + libtalerbank_dep, + libtalerfakebank_dep, + libtalerjson_dep, + libtalerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_auditor_api_cs', + test_auditor_api_cs, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + +test_auditor_api_rsa = executable( + 'test_auditor_api_rsa', + ['test_auditor_api.c'], + dependencies: [ + libtalertesting_dep, + libtalerauditor_dep, + libtalerexchange_dep, + libtalerbank_dep, + libtalerfakebank_dep, + libtalerjson_dep, + libtalerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_auditor_api_rsa', + test_auditor_api_rsa, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + +test_auditor_api_version = executable( + 'test_auditor_api_version', + ['test_auditor_api_version.c'], + dependencies: [ + libtalertesting_dep, + libtalerauditor_dep, + libtalerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_auditor_api_version', + test_auditor_api_version, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + +test_bank_api_with_nexus = executable( + 'test_bank_api_with_nexus', + ['test_bank_api.c'], + dependencies: [ + libtalertesting_dep, + libtalerexchange_dep, + libtalerbank_dep, + gnunetutil_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_auditor_api_version', + test_auditor_api_version, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + + +test_bank_api_with_fakebank = executable( + 'test_bank_api_with_fakebank', + ['test_bank_api.c'], + dependencies: [ + libtalertesting_dep, + libtalerexchange_dep, + libtalerbank_dep, + gnunetutil_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_auditor_api_version', + test_auditor_api_version, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + +test_exchange_api_cs = executable( + 'test_exchange_api_cs', + ['test_exchange_api.c'], + dependencies: [ + libtalertesting_dep, + libtalerexchange_dep, + libtalerbank_dep, + libtalerfakebank_dep, + libtalerjson_dep, + libtalerutil_dep, + libtalerextensions_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_exchange_api_cs', + test_exchange_api_cs, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + +test_exchange_api_rsa = executable( + 'test_exchange_api_rsa', + ['test_exchange_api.c'], + dependencies: [ + libtalertesting_dep, + libtalerexchange_dep, + libtalerextensions_dep, + libtalerbank_dep, + libtalerfakebank_dep, + libtalerjson_dep, + libtalerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_exchange_api_rsa', + test_exchange_api_rsa, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + + +test_exchange_api_age_restriction_cs = executable( + 'test_exchange_api_age_restriction_cs', + ['test_exchange_api_age_restriction.c'], + dependencies: [ + libtalertesting_dep, + libtalerexchange_dep, + libtalerextensions_dep, + libtalerbank_dep, + libtalerfakebank_dep, + libtalerjson_dep, + libtalerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_exchange_api_age_restriction_cs', + test_exchange_api_age_restriction_cs, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + +test_exchange_api_age_restriction_rsa = executable( + 'test_exchange_api_age_restriction_rsa', + ['test_exchange_api_age_restriction.c'], + dependencies: [ + libtalertesting_dep, + libtalerexchange_dep, + libtalerextensions_dep, + libtalerbank_dep, + libtalerfakebank_dep, + libtalerjson_dep, + libtalerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_exchange_api_age_restriction_rsa', + test_exchange_api_age_restriction_rsa, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + +test_exchange_api_p2p_cs = executable( + 'test_exchange_p2p_cs', + ['test_exchange_p2p.c'], + dependencies: [ + libtalertesting_dep, + libtalerexchange_dep, + libtalerextensions_dep, + libtalerbank_dep, + libtalerfakebank_dep, + libtalerjson_dep, + libtalerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_exchange_api_p2p_cs', + test_exchange_api_p2p_cs, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + +test_exchange_api_p2p_rsa = executable( + 'test_exchange_p2p_rsa', + ['test_exchange_p2p.c'], + dependencies: [ + libtalertesting_dep, + libtalerexchange_dep, + libtalerextensions_dep, + libtalerbank_dep, + libtalerfakebank_dep, + libtalerjson_dep, + libtalerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_exchange_api_p2p_rsa', + test_exchange_api_p2p_rsa, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + +test_exchange_api_keys_cherry_picking_cs = executable( + 'test_exchange_api_keys_cherry_picking_cs', + ['test_exchange_api_keys_cherry_picking.c'], + dependencies: [ + libtalertesting_dep, + libtalerexchange_dep, + libtalerbank_dep, + libtalerjson_dep, + libtalerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_exchange_api_keys_cherry_picking_cs', + test_exchange_api_keys_cherry_picking_cs, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + +test_exchange_api_keys_cherry_picking_rsa = executable( + 'test_exchange_api_keys_cherry_picking_rsa', + ['test_exchange_api_keys_cherry_picking.c'], + dependencies: [ + libtalertesting_dep, + libtalerexchange_dep, + libtalerbank_dep, + libtalerjson_dep, + libtalerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_exchange_api_keys_cherry_picking_rsa', + test_exchange_api_keys_cherry_picking_rsa, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + + +## FIXME_9828 +## test_exchange_api_revocation_cs_SOURCES = \ +## test_exchange_api_revocation.c +## test_exchange_api_revocation_cs_LDADD = \ +## libtalertesting.la \ +## $(top_builddir)/src/lib/libtalerexchange.la \ +## $(LIBGCRYPT_LIBS) \ +## $(top_builddir)/src/bank-lib/libtalerfakebank.la \ +## $(top_builddir)/src/bank-lib/libtalerbank.la \ +## $(top_builddir)/src/json/libtalerjson.la \ +## $(top_builddir)/src/util/libtalerutil.la \ +## -lgnunetcurl \ +## -lgnunetutil \ +## -ljansson \ +## $(XLIB) +# +## FIXME_9828 +## test_exchange_api_revocation_rsa_SOURCES = \ +## test_exchange_api_revocation.c +## test_exchange_api_revocation_rsa_LDADD = \ +## libtalertesting.la \ +## $(top_builddir)/src/lib/libtalerexchange.la \ +## $(LIBGCRYPT_LIBS) \ +## $(top_builddir)/src/bank-lib/libtalerfakebank.la \ +## $(top_builddir)/src/bank-lib/libtalerbank.la \ +## $(top_builddir)/src/json/libtalerjson.la \ +## $(top_builddir)/src/util/libtalerutil.la \ +## -lgnunetcurl \ +## -lgnunetutil \ +## -ljansson \ +## $(XLIB) + +test_exchange_api_overlapping_keys_bug_rsa = executable( + 'test_exchange_api_overlapping_keys_bug_rsa', + ['test_exchange_api_overlapping_keys_bug.c'], + dependencies: [ + libtalertesting_dep, + libtalerexchange_dep, + libtalerbank_dep, + libtalerjson_dep, + libtalerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_exchange_api_overlapping_keys_bug_rsa', + test_exchange_api_overlapping_keys_bug_rsa, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + +test_exchange_api_overlapping_keys_bug_cs = executable( + 'test_exchange_api_overlapping_keys_bug_cs', + ['test_exchange_api_overlapping_keys_bug.c'], + dependencies: [ + libtalertesting_dep, + libtalerexchange_dep, + libtalerbank_dep, + libtalerjson_dep, + libtalerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_exchange_api_overlapping_keys_bug_cs', + test_exchange_api_overlapping_keys_bug_cs, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + +test_exchange_management_api_cs = executable( + 'test_exchange_management_api_cs', + ['test_exchange_management_api.c'], + dependencies: [ + libtalertesting_dep, + libtalerexchange_dep, + libtalerutil_dep, + gnunetutil_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_exchange_management_api_cs', + test_exchange_management_api_cs, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + +test_exchange_management_api_rsa = executable( + 'test_exchange_management_api_rsa', + ['test_exchange_management_api.c'], + dependencies: [ + libtalertesting_dep, + libtalerexchange_dep, + libtalerutil_dep, + gnunetutil_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_exchange_management_api_rsa', + test_exchange_management_api_rsa, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + +test_taler_exchange_aggregator_postgres = executable( + 'test_taler_exchange_aggregator_postgres', + ['test_taler_exchange_aggregator.c'], + dependencies: [ + libtalertesting_dep, + libtalerfakebank_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerutil_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + mhd_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_taler_exchange_aggregator_postgres', + test_taler_exchange_aggregator_postgres, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + +test_taler_exchange_wirewatch_postgres = executable( + 'test_taler_exchange_wirewatch_postgres', + ['test_taler_exchange_wirewatch.c'], + dependencies: [ + libtalertesting_dep, + libtalerfakebank_dep, + libtalerjson_dep, + libtalerexchangedb_dep, + libtalerutil_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetpq_dep, + pq_dep, + json_dep, + mhd_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_taler_exchange_wirewatch_postgres', + test_taler_exchange_wirewatch_postgres, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + +if twister_dep.found() + + test_exchange_api_twisted_cs = executable( + 'test_exchange_api_twisted_cs', + ['test_exchange_api_twisted.c'], + dependencies: [ + libtalertesting_dep, + libtalertwistertesting_dep, + libtalerbank_dep, + libtalerfakebank_dep, + libtalerjson_dep, + libtalerexchange_dep, + libtalerutil_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetpq_dep, + json_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + 'test_exchange_api_twisted_cs', + test_exchange_api_twisted_cs, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], + ) + + + test_exchange_api_twisted_rsa = executable( + 'test_exchange_api_twisted_rsa', + ['test_exchange_api_twisted.c'], + dependencies: [ + libtalertesting_dep, + libtalertwistertesting_dep, + libtalerbank_dep, + libtalerfakebank_dep, + libtalerjson_dep, + libtalerexchange_dep, + libtalerutil_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetpq_dep, + json_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + 'test_exchange_api_twisted_rsa', + test_exchange_api_twisted_rsa, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], + ) + + + test_bank_api_twisted = executable( + 'test_bank_api_with_fakebank_twisted', + ['test_bank_api_twisted.c'], + dependencies: [ + libtalertesting_dep, + libtalertwistertesting_dep, + libtalerbank_dep, + libtalerfakebank_dep, + libtalerjson_dep, + libtalerexchange_dep, + libtalerutil_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetpq_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + 'test_bank_api_twisted', + test_bank_api_twisted, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], + ) +endif + + +test_kyc_api = executable( + 'test_kyc_api', + ['test_kyc_api.c'], + dependencies: [ + libtalertesting_dep, + libtalerauditor_dep, + libtalerfakebank_dep, + libtalerbank_dep, + libtalerjson_dep, + libtalerexchange_dep, + libtalerexchangedb_dep, + libtalerutil_dep, + gnunetutil_dep, + gnunetcurl_dep, + json_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, +) +test( + 'test_kyc_api', + test_kyc_api, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], +) + + + +## Distribution + +EXTRA_DIST = [ + 'valgrind.h', + 'coins-cs.conf', + 'coins-rsa.conf', + 'sanction-list.json', + 'test_auditor_api-cs.conf', + 'test_auditor_api-rsa.conf', + 'test_auditor_api_expire_reserve_now-cs.conf', + 'test_auditor_api_expire_reserve_now-rsa.conf', + 'test_bank_api.conf', + 'test_bank_api_fakebank.conf', + 'test_bank_api_fakebank_twisted.conf', + 'test_bank_api_nexus.conf', + 'test_exchange_api.conf', + 'test_exchange_api-cs.conf', + 'test_exchange_api-rsa.conf', + 'test_exchange_api_age_restriction.conf', + 'test_exchange_api_age_restriction-cs.conf', + 'test_exchange_api_age_restriction-rsa.conf', + 'test_exchange_api-twisted.conf', + 'test_exchange_api_twisted-cs.conf', + 'test_exchange_api_twisted-rsa.conf', + 'test_exchange_api_keys_cherry_picking.conf', + 'test_exchange_api_keys_cherry_picking-cs.conf', + 'test_exchange_api_keys_cherry_picking-rsa.conf', + 'test_exchange_api_expire_reserve_now-cs.conf', + 'test_exchange_api_expire_reserve_now-rsa.conf', + 'test-taler-exchange-aggregator-postgres.conf', + 'test-taler-exchange-wirewatch-postgres.conf', + 'test_kyc_api.conf', +] + +foreach f : EXTRA_DIST + configure_file(input: f, output: f, copy: true) +endforeach + +subdir( + 'test_exchange_api_home' / '.local' / 'share' / 'taler-auditor' / 'offline-keys', +) +subdir( + 'test_exchange_api_home' / '.local' / 'share' / 'taler-exchange' / 'offline', +) diff --git a/src/testing/taler-unified-setup.sh b/src/testing/taler-unified-setup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # This file is part of TALER # Copyright (C) 2023, 2024 Taler Systems SA diff --git a/src/testing/test_exchange_api_home/.local/share/taler-auditor/offline-keys/meson.build b/src/testing/test_exchange_api_home/.local/share/taler-auditor/offline-keys/meson.build @@ -0,0 +1,6 @@ +configure_file( + input: 'auditor.priv', + output: 'auditor.priv', + copy: true + ) + diff --git a/src/testing/test_exchange_api_home/.local/share/taler-exchange/offline/meson.build b/src/testing/test_exchange_api_home/.local/share/taler-exchange/offline/meson.build @@ -0,0 +1,6 @@ +configure_file( + input: 'master.priv', + output: 'master.priv', + copy: true + ) + diff --git a/src/util/Makefile.am b/src/util/Makefile.am @@ -1,196 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include $(LIBGCRYPT_CFLAGS) - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - - -pkgcfgadir = $(prefix)/share/taler-auditor/config.d/ -pkgcfgedir = $(prefix)/share/taler-exchange/config.d/ - -pkgcfga_DATA = \ - auditor-paths.conf - -pkgcfge_DATA = \ - currencies.conf \ - exchange-paths.conf \ - taler-exchange-secmod-eddsa.conf \ - taler-exchange-secmod-rsa.conf \ - taler-exchange-secmod-cs.conf - -EXTRA_DIST = \ - $(pkgcfga_DATA) \ - $(pkgcfge_DATA) \ - test_helper_eddsa.conf \ - test_helper_rsa.conf \ - test_helper_cs.conf - -bin_PROGRAMS = \ - taler-auditor-config \ - taler-exchange-secmod-eddsa \ - taler-exchange-secmod-rsa \ - taler-exchange-secmod-cs \ - taler-exchange-config - -taler_auditor_config_SOURCES = \ - taler-auditor-config.c -taler_auditor_config_LDADD = \ - libtalerutil.la \ - -lgnunetutil \ - $(XLIB) - -taler_exchange_config_SOURCES = \ - taler-exchange-config.c -taler_exchange_config_LDADD = \ - libtalerutil.la \ - -lgnunetutil \ - $(XLIB) - -taler_exchange_secmod_rsa_SOURCES = \ - taler-exchange-secmod-rsa.c -taler_exchange_secmod_rsa_LDADD = \ - libtalerutil.la \ - -lgnunetutil \ - -lpthread \ - $(LIBGCRYPT_LIBS) \ - $(XLIB) - -taler_exchange_secmod_cs_SOURCES = \ - taler-exchange-secmod-cs.c -taler_exchange_secmod_cs_LDADD = \ - libtalerutil.la \ - -lgnunetutil \ - -lpthread \ - $(LIBGCRYPT_LIBS) \ - $(XLIB) - -taler_exchange_secmod_eddsa_SOURCES = \ - taler-exchange-secmod-eddsa.c -taler_exchange_secmod_eddsa_LDADD = \ - libtalerutil.la \ - -lgnunetutil \ - -lpthread \ - $(LIBGCRYPT_LIBS) \ - $(XLIB) - -lib_LTLIBRARIES = \ - libtalerutil.la - -libtalerutil_la_SOURCES = \ - age_restriction.c \ - amount.c \ - aml_signatures.c \ - auditor_signatures.c \ - config.c \ - crypto.c \ - crypto_confirmation.c \ - crypto_contract.c \ - crypto_helper_common.c crypto_helper_common.h \ - crypto_helper_rsa.c \ - crypto_helper_cs.c \ - crypto_helper_esign.c \ - crypto_wire.c \ - denom.c \ - exchange_signatures.c \ - getopt.c \ - lang.c \ - iban.c \ - kyc_signatures.c \ - merchant_signatures.c \ - offline_signatures.c \ - payto.c \ - secmod_common.c secmod_common.h \ - secmod_cs.c secmod_cs.h \ - secmod_eddsa.c secmod_eddsa.h \ - secmod_rsa.c secmod_rsa.h \ - secmod_signatures.c \ - taler_error_codes.c \ - tokens.c \ - url.c \ - util.c \ - wallet_signatures.c \ - xml.c \ - yna.c \ - os_installation.c - -libtalerutil_la_LIBADD = \ - -lgnunetutil \ - -lgnunetjson \ - -lsodium \ - -ljansson \ - $(LIBGCRYPT_LIBS) \ - -lmicrohttpd $(XLIB) \ - -lunistring \ - -lz \ - -lm - -libtalerutil_la_LDFLAGS = \ - -version-info 12:0:2 \ - -no-undefined - - -AM_TESTS_ENVIRONMENT=export TALER_EXCHANGE_PREFIX=$${TALER_EXCHANGE_PREFIX:-@libdir@};export PATH=$${TALER_EXCHANGE_PREFIX:-@prefix@}/bin:$$PATH; - -check_PROGRAMS = \ - test_age_restriction \ - test_amount \ - test_crypto \ - test_helper_eddsa \ - test_helper_rsa \ - test_helper_cs \ - test_payto \ - test_url - -TESTS = \ - $(check_PROGRAMS) - -test_age_restriction_SOURCES = \ - test_age_restriction.c -test_age_restriction_LDADD = \ - -lgnunetutil \ - libtalerutil.la - -test_amount_SOURCES = \ - test_amount.c -test_amount_LDADD = \ - -lgnunetutil \ - libtalerutil.la - -test_crypto_SOURCES = \ - test_crypto.c -test_crypto_LDADD = \ - libtalerutil.la \ - -lgnunetutil \ - -ljansson - -test_payto_SOURCES = \ - test_payto.c -test_payto_LDADD = \ - -lgnunetutil \ - libtalerutil.la - -test_helper_eddsa_SOURCES = \ - test_helper_eddsa.c -test_helper_eddsa_LDADD = \ - -lgnunetutil \ - libtalerutil.la - -test_helper_rsa_SOURCES = \ - test_helper_rsa.c -test_helper_rsa_LDADD = \ - -lgnunetutil \ - libtalerutil.la - -test_helper_cs_SOURCES = \ - test_helper_cs.c -test_helper_cs_LDADD = \ - -lgnunetutil \ - libtalerutil.la - -test_url_SOURCES = \ - test_url.c -test_url_LDADD = \ - -lgnunetutil \ - libtalerutil.la diff --git a/src/util/meson.build b/src/util/meson.build @@ -0,0 +1,196 @@ +pkgcfgadir = get_option('datadir') / 'taler-auditor' / 'config.d' + +configure_file( + input: 'auditor-paths.conf', + output: 'auditor-paths.conf', + configuration: cdata, + install: true, + install_dir: pkgcfgadir, +) + +exchange_configs = [ + 'currencies.conf', + 'exchange-paths.conf', + 'taler-exchange-secmod-eddsa.conf', + 'taler-exchange-secmod-rsa.conf', + 'taler-exchange-secmod-cs.conf', +] + + +foreach c : exchange_configs + configure_file( + input: c, + output: c, + configuration: cdata, + install: true, + install_dir: pkgcfgdir, + ) +endforeach + +exchange_helper_configs = [ + 'test_helper_eddsa.conf', + 'test_helper_rsa.conf', + 'test_helper_cs.conf', +] + +foreach c : exchange_helper_configs + configure_file( + input: c, + output: c, + copy: true, + ) +endforeach + +libtalerutil_src = [ + 'age_restriction.c', + 'amount.c', + 'aml_signatures.c', + 'auditor_signatures.c', + 'config.c', + 'crypto.c', + 'crypto_confirmation.c', + 'crypto_contract.c', + 'crypto_helper_common.c', + 'crypto_helper_rsa.c', + 'crypto_helper_cs.c', + 'crypto_helper_esign.c', + 'crypto_wire.c', + 'denom.c', + 'exchange_signatures.c', + 'getopt.c', + 'lang.c', + 'iban.c', + 'kyc_signatures.c', + 'merchant_signatures.c', + 'offline_signatures.c', + 'payto.c', + 'secmod_common.c', + 'secmod_cs.c', + 'secmod_eddsa.c', + 'secmod_rsa.c', + 'secmod_signatures.c', + 'taler_error_codes.c', + 'tokens.c', + 'url.c', + 'util.c', + 'wallet_signatures.c', + 'xml.c', + 'yna.c', + 'os_installation.c', +] + +libtalerutil = library( + 'talerutil', + libtalerutil_src, + soversion: solibversions['libtalerutil']['soversion'], + version: solibversions['libtalerutil']['soversion'], + install_rpath: rpath_option, + dependencies: [ + gnunetutil_dep, + gnunetjson_dep, + sodium_dep, + json_dep, + gcrypt_dep, + mhd_dep, + unistr_dep, + zlib_dep, + m_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalerutil_dep = declare_dependency(link_with: libtalerutil) +pkg.generate( + libtalerutil, + url: 'https://taler.net', + description: 'GNU Taler utilities library', +) + +executable( + 'taler-auditor-config', + ['taler-auditor-config.c'], + dependencies: [gnunetutil_dep, libtalerutil_dep], + include_directories: [incdir, configuration_inc], + install: true, +) + +executable( + 'taler-exchange-config', + ['taler-exchange-config.c'], + dependencies: [gnunetutil_dep, libtalerutil_dep], + include_directories: [incdir, configuration_inc], + install: true, +) + +executable( + 'taler-exchange-secmod-rsa', + ['taler-exchange-secmod-rsa.c'], + dependencies: [gnunetutil_dep, libtalerutil_dep, gcrypt_dep], + include_directories: [incdir, configuration_inc], + install: true, +) + +executable( + 'taler-exchange-secmod-cs', + ['taler-exchange-secmod-cs.c'], + dependencies: [gnunetutil_dep, libtalerutil_dep, gcrypt_dep], + include_directories: [incdir, configuration_inc], + install: true, +) + +executable( + 'taler-exchange-secmod-eddsa', + ['taler-exchange-secmod-eddsa.c'], + dependencies: [gnunetutil_dep, libtalerutil_dep, gcrypt_dep], + include_directories: [incdir, configuration_inc], + install: true, +) + +talerutil_tests = [ + 'test_age_restriction', + 'test_amount', + 'test_crypto', + 'test_payto', + 'test_url', +] + +talerutil_tests_installcheck = [ + 'test_helper_eddsa', + 'test_helper_rsa', + 'test_helper_cs', +] + +foreach t : talerutil_tests + + test_tmp = executable( + t, + ['@0@.c'.format(t)], + dependencies: [gnunetutil_dep, libtalerutil_dep, json_dep], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test(t, test_tmp, workdir: meson.current_build_dir(), suite: ['util']) +endforeach + +foreach t : talerutil_tests_installcheck + + test_tmp = executable( + t, + ['@0@.c'.format(t)], + dependencies: [gnunetutil_dep, libtalerutil_dep, json_dep], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + t, + test_tmp, + workdir: meson.current_build_dir(), + suite: ['util', 'installcheck'], + ) + + +endforeach