merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit ac2dcbd177026b3260ff5a22293cbf5b6aae378e
parent dc3f3ccab28cbf19319be71d6a4a6c735444e9a6
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date:   Fri, 10 Apr 2026 11:50:00 +0200

build: convert build system to meson

Diffstat:
Mbootstrap | 29+++++++++++++----------------
Dconfigure.ac | 523-------------------------------------------------------------------------------
Mcontrib/ci/Containerfile | 2+-
Mcontrib/ci/jobs/0-codespell/job.sh | 2+-
Mcontrib/ci/jobs/2-test/4-test.sh | 11+++++------
Acontrib/meson.build | 45+++++++++++++++++++++++++++++++++++++++++++++
Acontrib/typst/common/meson.build | 5+++++
Acontrib/typst/meson.build | 11+++++++++++
Mdebian/libtalermerchant-dev.install | 3+++
Mdebian/rules | 5+----
Ddoc/Makefile.am | 42------------------------------------------
Adoc/meson.build | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aflake.lock | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mflake.nix | 5++++-
Ameson.build | 401+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ameson.options | 5+++++
Dsrc/Makefile.am | 3---
Dsrc/backend/Makefile.am | 447-------------------------------------------------------------------------------
Asrc/backend/meson.build | 347+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/backenddb/Makefile.am | 339-------------------------------------------------------------------------------
Asrc/backenddb/Makefile.sql | 11+++++++++++
Asrc/backenddb/meson.build | 330+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/bank/Makefile.am | 28----------------------------
Asrc/bank/meson.build | 29+++++++++++++++++++++++++++++
Dsrc/include/Makefile.am | 2--
Asrc/include/meson.build | 2++
Dsrc/include/taler/Makefile.am | 15---------------
Dsrc/include/taler/merchant/Makefile.am | 74--------------------------------------------------------------------------
Asrc/include/taler/merchant/meson.build | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/include/taler/meson.build | 20++++++++++++++++++++
Dsrc/lib/Makefile.am | 114-------------------------------------------------------------------------------
Asrc/lib/meson.build | 152+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dsrc/merchant-tools/Makefile.am | 65-----------------------------------------------------------------
Asrc/merchant-tools/meson.build | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/meson.build | 9+++++++++
Dsrc/testing/Makefile.am | 285-------------------------------------------------------------------------------
Asrc/testing/meson.build | 369+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/testing/test_merchant_accounts.sh | 2+-
Msrc/testing/test_merchant_instance_auth.sh | 2+-
Msrc/testing/test_merchant_instance_creation.sh | 2+-
Msrc/testing/test_merchant_instance_purge.sh | 2+-
Msrc/testing/test_merchant_instance_response.sh | 2+-
Msrc/testing/test_merchant_kyc.sh | 2+-
Msrc/testing/test_merchant_mfa.sh | 2+-
Msrc/testing/test_merchant_order_autocleanup.sh | 2+-
Msrc/testing/test_merchant_order_creation.sh | 2+-
Msrc/testing/test_merchant_order_refund.sh | 2+-
Msrc/testing/test_merchant_product_creation.sh | 2+-
Msrc/testing/test_merchant_statistics.sh | 2+-
Msrc/testing/test_merchant_templates.sh | 2+-
Msrc/testing/test_merchant_tokenfamilies.sh | 2+-
Msrc/testing/test_merchant_transfer_tracking.sh | 2+-
Msrc/testing/test_merchant_wirewatch.sh | 2+-
Dsrc/util/Makefile.am | 72------------------------------------------------------------------------
Asrc/util/meson.build | 106+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
55 files changed, 2207 insertions(+), 2054 deletions(-)

diff --git a/bootstrap b/bootstrap @@ -32,10 +32,10 @@ existence() } # Freeze SQL files that must no longer be edited. -for n in 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 -do - chmod -w src/backenddb/merchant-$n.sql* -done +#for n in 0001 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 +#do +# chmod -w src/backenddb/merchant-$n.sql* +#done if existence uncrustify; then echo "Installing uncrustify hook and configuration" @@ -48,15 +48,12 @@ else fi # Generate Makefile.am in contrib/ -cd contrib -rm -f Makefile.am -find wallet-core/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 -if +#cd contrib +#rm -f Makefile.am +#find wallet-core/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 .. diff --git a/configure.ac b/configure.ac @@ -1,523 +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> -# -# This configure file is in the public domain - -AC_PREREQ([2.69]) -AC_INIT([taler-merchant],[1.5.17],[taler-bug@gnunet.org]) -AC_CONFIG_SRCDIR([src/backend/taler-merchant-httpd.c]) -AC_CONFIG_HEADERS([taler_merchant_config.h]) -# 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-merchant],,, -DX_PS_FEATURE(OFF), -DX_PDF_FEATURE(OFF), -DX_RTF_FEATURE(OFF), -DX_CHI_FEATURE(OFF), -DX_XML_FEATURE(OFF)) - - -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 - -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 "$doc_only" = "yes"]) - - -# Not indented as it covers most of the file... -AS_IF([test "x$doc_only" != xyes],[ - - -# Checks for programs. -AC_PROG_CC - - - -CFLAGS="-Wall -Wno-address-of-packed-member $CFLAGS" - -# 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" - ])]) - -# Checks for header files. -AC_CHECK_HEADERS([stdint.h stdlib.h string.h unistd.h]) - -# 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]) - - -jansson=0 -PKG_CHECK_MODULES([JANSSON], [jansson >= 2.3], - [LDFLAGS="$JANSSON_LIBS $LDFLAGS" - CPPFLAGS="$JANSSON_CFLAGS $CPPFLAGS"], - [AC_MSG_ERROR([[ -*** -*** You need libjansson to build this program. -***]])]) - - -# 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]) - - -# NOTE: If we find libcurl here we set LIBCURL to -lcurl -# This affects the LIBCURL_CHECK_CONFIG call below as it takes LIBCURL into -# account when checking for curl. -AC_CHECK_LIB([curl], - [curl_easy_getinfo], - [LIBCURL="-lcurl" - curl_gnutls=1], - [curl_gnutls=0]) - -LIBCURL_CHECK_CONFIG([], [7.34.0], [], - [AC_MSG_ERROR([cURL must have a version >= 7.34.0])]) - -# Even if curl is found, we check for this constant in order to determine -# if we can use this feature. -AC_CHECK_HEADER([curl/curl.h], - [AC_CHECK_DECLS([CURLINFO_TLS_SSL_PTR], - [], - [AC_MSG_ERROR([cURL must support CURLINFO_TLS_SSL_PTR])], - [[#include <curl/curl.h>]])]) - -# test for libqrencode -qrencode=0 -QR_LIBS="-lqrencode" -AC_MSG_CHECKING(for libqrencode) -AC_ARG_WITH(qrencode, - [ --with-qrencode=PFX Base of libqrencode installation], - [AC_MSG_RESULT([$with_qrencode]) - AS_CASE([$with_qrencode], - [no],[], - [yes],[ - AC_CHECK_HEADERS(qrencode.h,qrencode=1) - ], - [ - CPPFLAGS="-I$with_qrencode/include $CPPFLAGS" - QR_CFLAGS="-I$with_qrencode/include" - QR_LIBS="-L$with_qrencode/lib/$MULTIARCH -L$with_qrencode/lib/ -lqrencode" - AC_CHECK_HEADERS(qrencode.h,qrencode=1) - ]) - ], - [AC_MSG_RESULT([--with-qrencode not specified]) - AC_CHECK_HEADERS(qrencode.h,qrencode=1)]) - -AS_IF([test "$qrencode" != 1], -[AC_MSG_ERROR([[ -*** -*** You need libqrencode to build this program. -*** ]])]) - -AC_SUBST(QR_CFLAGS) -AC_SUBST(QR_LIBS) - - -# 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]) - - -CPPFLAGS="$CPPFLAGS $POSTGRESQL_CPPFLAGS" - -# 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_TIME_round_up], libgnunetutil=1)]) -AS_IF([test $libgnunetutil != 1], - [AC_MSG_ERROR([[ -*** -*** You need libgnunetutil >= 0.25.3 to build this program. -*** This library is part of GNUnet, available at -*** https://gnunet.org -*** ]])]) - -libgnunetpq=0 -AC_CHECK_HEADERS([gnunet/gnunet_pq_lib.h], - [AC_CHECK_LIB([gnunetpq], [GNUNET_PQ_query_param_blind_sign_priv], libgnunetpq=1)]) - -AS_IF([test $libgnunetpq != 1], - [AC_MSG_ERROR([[ -*** -*** You need libgnunetpq >= 0.25.3 (API v7) to build this program. -*** This library is part of GNUnet, available at -*** https://gnunet.org -*** ]])]) - -AM_CONDITIONAL(HAVE_GNUNETPQ, test x$libgnunetpq = x1) - -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) - - -libtalerutil=0 -AC_MSG_CHECKING([for libtalerutil]) -AC_ARG_WITH(exchange, - [AS_HELP_STRING([--with-exchange=PFX], [base of Taler EXCHANGE installation])], - [AC_MSG_RESULT([given as $with_exchange])], - [AC_MSG_RESULT(not given) - with_exchange=yes]) -AS_CASE([$with_exchange], - [yes], [], - [no], [AC_MSG_ERROR([--with-exchange is required])], - [LDFLAGS="-L$with_exchange/lib/$MULTIARCH -L$with_exchange/lib/ $LDFLAGS" - CPPFLAGS="-I$with_exchange/include $CPPFLAGS $POSTGRESQL_CPPFLAGS"]) - -AC_CHECK_HEADERS([taler/taler_util.h], - [AC_CHECK_LIB([talerutil], [TALER_merchant_instance_auth_hash_with_salt], libtalerutil=1)]) -AM_CONDITIONAL(HAVE_TALERUTIL, test x$libtalerutil = x1) -AS_IF([test $libtalerutil != 1], - [AC_MSG_ERROR([[ -*** -*** You need libtalerutil >= 1.1.0 (ABI v8) to build this program. -*** This library is part of the GNU Taler exchange, available at -*** https://taler.net -*** ]])]) - -libtalerexchange=0 -AC_MSG_CHECKING([for libtalerexchange]) -AC_ARG_WITH(exchange, - [AS_HELP_STRING([--with-exchange=PFX], [base of Taler EXCHANGE installation])], - [AC_MSG_RESULT([given as $with_exchange])], - [AC_MSG_RESULT(not given) - with_exchange=yes]) -AS_CASE([$with_exchange], - [yes], [], - [no], [AC_MSG_ERROR([--with-exchange is required])], - [LDFLAGS="-L$with_exchange/lib/$MULTIARCH -L$with_exchange/lib/ $LDFLAGS" - CPPFLAGS="-I$with_exchange/include $CPPFLAGS $POSTGRESQL_CPPFLAGS"]) - -AC_CHECK_HEADERS([taler/taler_exchange_service.h], - [AC_CHECK_LIB([talerexchange], [TALER_EXCHANGE_keys_test_account_allowed], libtalerexchange=1)]) -AM_CONDITIONAL(HAVE_TALEREXCHANGE, test x$libtalerexchange = x1) -AS_IF([test $libtalerexchange != 1], - [AC_MSG_ERROR([[ -*** -*** You need libtalerexchange >= 15:0:0 to build this program. -*** This library is part of the GNU Taler exchange, available at -*** https://taler.net -*** ]])]) - - -libdonau=0 -AC_MSG_CHECKING([for libdonau]) -AC_ARG_WITH(donau, - [AS_HELP_STRING([--with-donau=PFX], [base of Taler DONAU installation])], - [AC_MSG_RESULT([given as $with_donau])], - [AC_MSG_RESULT(not given) - with_donau=yes]) -AS_CASE([$with_donau], - [yes], [], - [no], [], - [LDFLAGS="-L$with_donau/lib/$MULTIARCH -L$with_donau/lib/ $LDFLAGS" - CPPFLAGS="-I$with_donau/include $CPPFLAGS $POSTGRESQL_CPPFLAGS"]) - -AC_CHECK_HEADERS([donau/donau_service.h], - [AC_CHECK_LIB([donau], [DONAU_get_keys], libdonau=1)]) -AM_CONDITIONAL(HAVE_DONAU, test x$libdonau = x1) -AS_IF([test $libdonau != 1], - [AC_MSG_ERROR([[ -*** -*** You need libdonau >= 5:0:0 to build this program. -*** This library is part of the GNU Taler donau, available at -*** https://taler.net -*** ]])]) - - - -libtalermhd=0 -AC_MSG_CHECKING([for libtalermhd]) -AC_ARG_WITH(exchange, - [AS_HELP_STRING([--with-exchange=PFX], [base of Taler EXCHANGE installation])], - [AC_MSG_RESULT([given as $with_exchange])], - [AC_MSG_RESULT(not given) - with_exchange=yes]) -AS_CASE([$with_exchange], - [yes], [], - [no], [AC_MSG_ERROR([--with-exchange is required])], - [LDFLAGS="-L$with_exchange/lib/$MULTIARCH -L$with_exchange/lib/ $LDFLAGS" - CPPFLAGS="-I$with_exchange/include $CPPFLAGS $POSTGRESQL_CPPFLAGS"]) - -AC_CHECK_HEADERS([taler/taler_mhd_lib.h], - [AC_CHECK_LIB([talermhd], [TALER_MHD_parse_request_arg_rel_time], libtalermhd=1)]) -AM_CONDITIONAL(HAVE_TALERMHD, test x$libtalermhd = x1) -AS_IF([test $libtalermhd != 1], - [AC_MSG_ERROR([[ -*** -*** You need libtalermhd >= 1.1.0 (API v8) to build this program. -*** This library is part of the GNU Taler exchange, available at -*** https://taler.net -*** ]])]) - -libtalerjson=0 -AC_MSG_CHECKING([for libtalerjson]) -AC_CHECK_HEADERS([taler/taler_json_lib.h], - [AC_CHECK_LIB([talerjson], [TALER_JSON_currency_specs_to_json], libtalerjson=1)]) -AM_CONDITIONAL(HAVE_TALERJSON, test x$libtalerjson = x1) -AS_IF([test $libtalerjson != 1], - [AC_MSG_ERROR([[ -*** -*** You need libtalerjson >= 1.1 (API v6) to build this program. -*** This library is part of the GNU Taler exchange, available at -*** https://taler.net -*** ]])]) - - -# Check for Taler's libtalerpq - -libtalerpq=0 -AC_MSG_CHECKING([for libtalerpq]) -AC_CHECK_HEADERS([taler/taler_pq_lib.h], - [AC_CHECK_LIB([talerpq], [TALER_PQ_query_param_array_blinded_denom_sig], libtalerpq=1)]) -AM_CONDITIONAL(HAVE_TALERPQ, test x$libtalerpq = x1) -AS_IF([test $libtalerpq != 1], - [AC_MSG_ERROR([[ -*** -*** You need libtalerpq >= 0.9.4 to build this program. -*** This library is part of the GNU Taler exchange, available at -*** https://taler.net -*** ]])]) - - -# Check for Taler's libtalerfakebank -libtalerfakebank=0 -AC_MSG_CHECKING([for libtalerfakebank]) -AC_CHECK_HEADERS([taler/taler_fakebank_lib.h], - [AC_CHECK_LIB([talerfakebank], [TALER_FAKEBANK_start], libtalerfakebank=1)]) -AM_CONDITIONAL(HAVE_TALERFAKEBANK, test x$libtalerfakebank = x1) - - - -# check for libtalertwister -twistertesting=0 -AC_MSG_CHECKING([for talerwtistertesting]) -AC_ARG_WITH([twister], - [AS_HELP_STRING([--with-twister=PFX], [base of libtalertwistertesting])], - [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_LIB(talertwistertesting,TALER_TWISTER_run_twister, - [AC_CHECK_HEADER([taler/taler_twister_testing_lib.h],[twistertesting=1])]) -AM_CONDITIONAL(HAVE_TWISTER, test x$twistertesting = x1) - - -# 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"]) - - -# 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]) - -# 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 about the doc-only if on top of the file - -# logic if doc_only is set, make sure conditionals are still defined -AM_CONDITIONAL([HAVE_GNUNETPQ], [false]) -AM_CONDITIONAL([HAVE_POSTGRESQL], [false]) -AM_CONDITIONAL([HAVE_TALERUTIL], [false]) -AM_CONDITIONAL(HAVE_TALEREXCHANGE, [false]) -AM_CONDITIONAL([HAVE_TALERPQ], [false]) -AM_CONDITIONAL([HAVE_DONAU], [false]) -AM_CONDITIONAL([HAVE_TALERMHD], [false]) -AM_CONDITIONAL([HAVE_TALERJSON], [false]) -AM_CONDITIONAL([HAVE_TALERFAKEBANK], [false]) -AM_CONDITIONAL([USE_COVERAGE], [false]) -AM_CONDITIONAL([ENABLE_DOC], [true]) -AM_CONDITIONAL([HAVE_TWISTER], [true]) - - -# end of 'doc_only' -]) - - -# should experimental code be compiled (code that may not yet compile / have passing test cases)? -AC_MSG_CHECKING(whether to compile experimental code) -AC_ARG_ENABLE([experimental], - [AS_HELP_STRING([--enable-experimental], [enable compiling experimental code])], - [enable_experimental=${enableval}], - [enable_experimental=no]) -AC_MSG_RESULT($enable_experimental) -AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"]) - - -AC_CONFIG_FILES([Makefile -contrib/Makefile -contrib/typst/Makefile -contrib/typst/common/Makefile -contrib/typst/kyc/Makefile -contrib/typst/orders/Makefile -contrib/typst/transactions/Makefile -doc/Makefile -doc/doxygen/Makefile -src/Makefile -src/bank/Makefile -src/backend/Makefile -src/backenddb/Makefile -src/include/Makefile -src/include/taler/Makefile -src/include/taler/merchant/Makefile -src/lib/Makefile -src/merchant-tools/Makefile -src/util/Makefile -src/testing/Makefile -]) -AC_OUTPUT 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 \ git \ - autoconf \ + meson \ libjansson-dev \ libgcrypt-dev \ libqrencode-dev \ diff --git a/contrib/ci/jobs/0-codespell/job.sh b/contrib/ci/jobs/0-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/2-test/4-test.sh b/contrib/ci/jobs/2-test/4-test.sh @@ -9,16 +9,15 @@ check_command() print_logs() { - for i in src/*/test-suite.log + set +e + for i in build/meson-logs/testlog.txt do - for FAILURE in $(grep '^FAIL:' ${i} | cut -d' ' -f2) - do - echo "Printing ${FAILURE}.log" - cat "$(dirname $i)/${FAILURE}.log" - done + echo "Printing ${i}" + cat "$i" done } + if ! check_command ; then print_logs exit 1 diff --git a/contrib/meson.build b/contrib/meson.build @@ -0,0 +1,45 @@ +# This file is in the public domain. + +subdir('typst') + +configure_file( + input: 'taler-merchant-dbconfig', + output: 'taler-merchant-dbconfig', + configuration: cdata, + install: true, + install_dir: get_option('bindir'), +) + +terms_DATA = ['merchant-tos-tops-v0.en.rst', 'merchant-tos-demo-v0.en.rst'] + +install_data( + sources: terms_DATA, + install_dir: get_option('datadir') / 'taler-merchant' / 'terms', +) + + +dist_tmplpkgdata_DATA = [ + 'offer_refund.en', + 'request_payment.en', + 'show_order_details.en', +] +fs = import('fs') + +foreach f : dist_tmplpkgdata_DATA + f_must = '@0@.must'.format(f) + fs.copyfile('wallet-core' / 'backend' / '@0@.html'.format(f), f_must) + install_data( + f_must, + install_dir: get_option('datadir') / 'taler-merchant' / 'templates', + ) +endforeach +install_data( + 'kyc_text.en.must', + install_dir: get_option('datadir') / 'taler-merchant' / 'templates', +) + +install_subdir( + 'wallet-core' / 'backoffice', + strip_directory: true, + install_dir: get_option('datadir') / 'taler-merchant' / 'spa', +) diff --git a/contrib/typst/common/meson.build b/contrib/typst/common/meson.build @@ -0,0 +1,5 @@ +install_data( + 'lib.typ', + 'typst.toml', + install_dir: get_option('datadir') / 'taler-merchant' / 'typst' / 'packages' / 'taler-merchant' / 'common' / '0.0.0', +) diff --git a/contrib/typst/meson.build b/contrib/typst/meson.build @@ -0,0 +1,11 @@ +typst_folders = ['kyc', 'orders', 'transactions'] + +foreach f : typst_folders + install_data( + f / '@0@.typ'.format(f), + f / 'typst.toml', + install_dir: get_option('datadir') / 'taler-merchant' / 'typst' / 'packages' / 'taler-merchant' / f / '0.0.0', + ) +endforeach + +subdir('common') diff --git a/debian/libtalermerchant-dev.install b/debian/libtalermerchant-dev.install @@ -7,6 +7,9 @@ usr/include # Dev-only library, used by benchmark. usr/lib/*/libtalermerchanttesting.so.* +# pkgconfig +usr/lib/*/pkgconfig/talermerchant*.pc + # The .so symlinks are only needed for development usr/lib/*/*.so 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,42 +0,0 @@ -SUBDIRS = . doxygen - -man_MANS = \ - prebuilt/man/taler-merchant-benchmark.1 \ - prebuilt/man/taler-merchant.conf.5 \ - prebuilt/man/taler-merchant-config.1 \ - prebuilt/man/taler-merchant-dbconfig.1 \ - prebuilt/man/taler-merchant-dbinit.1 \ - prebuilt/man/taler-merchant-depositcheck.1 \ - prebuilt/man/taler-merchant-donaukeyupdate.1 \ - prebuilt/man/taler-merchant-exchangekeyupdate.1 \ - prebuilt/man/taler-merchant-httpd.1 \ - prebuilt/man/taler-merchant-kyccheck.1 \ - prebuilt/man/taler-merchant-passwd.1 \ - prebuilt/man/taler-merchant-reconciliation.1 \ - prebuilt/man/taler-merchant-report-generator.1 \ - prebuilt/man/taler-merchant-report-generator-email.1 \ - prebuilt/man/taler-merchant-rproxy-setup.1 \ - prebuilt/man/taler-merchant-webhook.1 \ - prebuilt/man/taler-merchant-wirewatch.1 - -info_TEXINFOS = \ - prebuilt/texinfo/taler-merchant.texi - -install-info-local: - @echo " $(MKDIR_P) '$(DESTDIR)$(infodir)/taler-merchant-figures'"; \ - $(MKDIR_P) "$(DESTDIR)$(infodir)/taler-merchant-figures" || exit 1; \ - echo " $(INSTALL_DATA) prebuilt/texinfo/taler-merchant-figures/*.png '$(DESTDIR)$(infodir)/taler-merchant-figures'"; \ - $(INSTALL_DATA) '$(srcdir)/prebuilt/texinfo/taler-merchant-figures/arch-api.png' '$(srcdir)/prebuilt/texinfo/taler-merchant-figures/merchant_first_login.png' '$(srcdir)/prebuilt/texinfo/taler-merchant-figures/no_default_account_yet.png' '$(srcdir)/prebuilt/texinfo/taler-merchant-figures/enter_instance_details.png' '$(srcdir)/prebuilt/texinfo/taler-merchant-figures/instance_iban_config.png' '$(srcdir)/prebuilt/texinfo/taler-merchant-figures/create_orders.png' '$(srcdir)/prebuilt/texinfo/taler-merchant-figures/payment_links.png' '$(srcdir)/prebuilt/texinfo/taler-merchant-figures/merchant-db.png' "$(DESTDIR)$(infodir)/taler-merchant-figures" || exit 1; - - -EXTRA_DIST = \ - $(man_MANS) \ - $(info_TEXINFOS) \ - prebuilt/texinfo/taler-merchant-figures/arch-api.png \ - prebuilt/texinfo/taler-merchant-figures/merchant_first_login.png \ - prebuilt/texinfo/taler-merchant-figures/no_default_account_yet.png \ - prebuilt/texinfo/taler-merchant-figures/enter_instance_details.png \ - prebuilt/texinfo/taler-merchant-figures/instance_iban_config.png \ - prebuilt/texinfo/taler-merchant-figures/create_orders.png \ - prebuilt/texinfo/taler-merchant-figures/payment_links.png \ - prebuilt/texinfo/taler-merchant-figures/merchant-db.png diff --git a/doc/meson.build b/doc/meson.build @@ -0,0 +1,66 @@ +install_man( + [ + 'prebuilt'/'man'/'taler-merchant-benchmark.1', + 'prebuilt'/'man'/'taler-merchant.conf.5', + 'prebuilt'/'man'/'taler-merchant-config.1', + 'prebuilt'/'man'/'taler-merchant-dbconfig.1', + 'prebuilt'/'man'/'taler-merchant-dbinit.1', + 'prebuilt'/'man'/'taler-merchant-depositcheck.1', + 'prebuilt'/'man'/'taler-merchant-donaukeyupdate.1', + 'prebuilt'/'man'/'taler-merchant-exchangekeyupdate.1', + 'prebuilt'/'man'/'taler-merchant-httpd.1', + 'prebuilt'/'man'/'taler-merchant-kyccheck.1', + 'prebuilt'/'man'/'taler-merchant-passwd.1', + 'prebuilt'/'man'/'taler-merchant-reconciliation.1', + 'prebuilt'/'man'/'taler-merchant-report-generator.1', + 'prebuilt'/'man'/'taler-merchant-report-generator-email.1', + 'prebuilt'/'man'/'taler-merchant-rproxy-setup.1', + 'prebuilt'/'man'/'taler-merchant-webhook.1', + 'prebuilt'/'man'/'taler-merchant-wirewatch.1', + ], +) + +fs = import('fs') + +fs.copyfile( + 'prebuilt'/'texinfo'/'taler-merchant.texi', + 'taler-merchant.texi', + ) + +makeinfo = find_program('makeinfo', native: true, required: false) + +if makeinfo.found() + + f_info = '@0@.info'.format('taler-merchant') + f_texi = meson.current_build_dir() / '@0@.texi'.format('taler-merchant') + + custom_target( + f_info, + output: f_info, + command: [ + makeinfo, + '--no-split', + '--no-headers', + f_texi, + '-o', + '@OUTPUT0@', + ], + install: true, + install_dir: get_option('infodir'), + ) + +endif + + +install_emptydir(get_option('infodir') / 'taler-merchant-figures') +install_data( + 'prebuilt'/'texinfo'/'taler-merchant-figures'/'arch-api.png', + 'prebuilt'/'texinfo'/'taler-merchant-figures'/'merchant_first_login.png', + 'prebuilt'/'texinfo'/'taler-merchant-figures'/'no_default_account_yet.png', + 'prebuilt'/'texinfo'/'taler-merchant-figures'/'enter_instance_details.png', + 'prebuilt'/'texinfo'/'taler-merchant-figures'/'instance_iban_config.png', + 'prebuilt'/'texinfo'/'taler-merchant-figures'/'create_orders.png', + 'prebuilt'/'texinfo'/'taler-merchant-figures'/'payment_links.png', + 'prebuilt'/'texinfo'/'taler-merchant-figures'/'merchant-db.png', + install_dir: get_option('infodir') / 'taler-merchant-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": 1775730577, + "narHash": "sha256-5i3MKmxBFQP9/wp3QyFWyS7DqURq/M4T8gr1JSbyygI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0d5a853f7004a5fc57b61a97ccb02832f8e7ed9d", + "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 @@ -3,7 +3,6 @@ nixpkgs.url = "nixpkgs/release-25.11"; systems.url = "github:nix-systems/default"; gnunet.url = "git+https://git.gnunet.org/gnunet?rev=7c6b613e37e301b0e81fb94af5878d00c98e5b75"; - exchange.url = "git+https://git.taler.net/exchange?rev=6c5cbfc3c55a6a86b98f3d583c6241fb3713da3c"; self.submodules = true; }; @@ -85,7 +84,11 @@ pkgs.codespell pkgs.clang-tools pkgs.uncrustify + pkgs.jq #probably not needed pkgs.doxygen + pkgs.typst + pkgs.pdftk + pkgs.qrencode ]; shellHook = '' diff --git a/meson.build b/meson.build @@ -0,0 +1,401 @@ +project( + 'taler-merchant', + 'c', + license: 'AGPLv3', + meson_version: '>=1.1.0', + version: '1.5.12', +) + +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-merchant' / 'config.d' +docdir = get_option('datadir') / 'doc' / 'taler-merchant' + +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'] + + foreach h : check_headers + if cc.check_header(h) + define = 'HAVE_' + h.underscorify().to_upper() + message(define) + private_config.set(define, 1) + endif + endforeach + + + 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.1') + + gnunetutil_dep = dependency('gnunetutil', required: false) + if not gnunetutil_dep.found() + gnunetutil_dep = cc.find_library('gnunetutil', required: true) + endif + + cc.has_header_symbol( + 'gnunet/gnunet_util_lib.h', + 'GNUNET_TIME_round_up', + dependencies: [gnunetutil_dep], + required: true, + ) + + gnunetjson_dep = dependency('gnunetjson', required: false) + if not gnunetjson_dep.found() + gnunetjson_dep = cc.find_library('gnunetjson', required: true) + endif + + 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, + ) + + 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_query_param_blind_sign_priv', + required: true, + dependencies: [pq_dep, gnunetpq_dep], + ) + private_config.set10('HAVE_GNUNETPQ', gnunetpq_dep.found()) + + talerutil_dep = dependency('talerutil', required: false) + if not talerutil_dep.found() + talerutil_dep = cc.find_library('talerutil', required: true) + endif + cc.has_header_symbol( + 'taler/taler_util.h', + 'TALER_merchant_instance_auth_hash_with_salt', + required: true, + dependencies: [talerutil_dep], + ) + private_config.set10('HAVE_TALERUTIL', talerutil_dep.found()) + + talercurl_dep = dependency('talercurl', required: false) + if not talercurl_dep.found() + talercurl_dep = cc.find_library('talercurl', required: true) + endif + talerkyclogic_dep = dependency('talerkyclogic', required: false) + if not talerkyclogic_dep.found() + talerkyclogic_dep = cc.find_library('talerkyclogic', required: true) + endif + talerbank_dep = dependency('talerbank', required: false) + if not talerbank_dep.found() + talerbank_dep = cc.find_library('talerbank', required: true) + endif + talerfakebank_dep = dependency('talerfakebank', required: false) + if not talerfakebank_dep.found() + talerfakebank_dep = cc.find_library('talerfakebank', required: false) + endif + talertemplating_dep = dependency('talertemplating', required: false) + if not talertemplating_dep.found() + talertemplating_dep = cc.find_library('talertemplating', required: true) + endif + talertesting_dep = dependency('talertesting', required: false) + if not talertesting_dep.found() + talertesting_dep = cc.find_library('talertesting', required: true) + endif + + talerexchange_dep = dependency('talerexchange', required: false) + if not talerexchange_dep.found() + talerexchange_dep = cc.find_library('talerexchange', required: true) + endif + cc.has_header_symbol( + 'taler/taler_exchange_service.h', + 'TALER_EXCHANGE_keys_test_account_allowed', + required: true, + dependencies: [talerexchange_dep], + ) + private_config.set10('HAVE_TALEREXCHANGE', talerexchange_dep.found()) + + donau_dep = dependency('donau', required: false) + if not donau_dep.found() + donau_dep = cc.find_library('donau', required: true) + endif + cc.has_header_symbol( + 'donau/donau_service.h', + 'DONAU_get_keys', + required: true, + dependencies: [donau_dep], + ) + donaujson_dep = dependency('donaujson', required: false) + if not donaujson_dep.found() + donaujson_dep = cc.find_library('donaujson', required: true) + endif + donauutil_dep = dependency('donauutil', required: false) + if not donauutil_dep.found() + donauutil_dep = cc.find_library('donauutil', required: true) + endif + donautesting_dep = dependency('donautesting', required: false) + if not donautesting_dep.found() + donautesting_dep = cc.find_library('donautesting', required: true) + endif + private_config.set10('HAVE_DONAU', donau_dep.found()) + + talermhd_dep = dependency('talermhd', required: false) + if not talermhd_dep.found() + talermhd_dep = cc.find_library('talermhd', required: true) + endif + cc.has_header_symbol( + 'taler/taler_mhd_lib.h', + 'TALER_MHD_parse_request_arg_rel_time', + required: true, + dependencies: [talermhd_dep], + ) + private_config.set10('HAVE_TALERMHD', talermhd_dep.found()) + + + talerjson_dep = dependency('talerjson', required: false) + if not talerjson_dep.found() + talerjson_dep = cc.find_library('talerjson', required: true) + endif + cc.has_header_symbol( + 'taler/taler_json_lib.h', + 'TALER_JSON_currency_specs_to_json', + required: true, + dependencies: [talerjson_dep], + ) + private_config.set10('HAVE_TALERJSON', talerjson_dep.found()) + + + talerpq_dep = dependency('talerpq', required: false) + if not talerpq_dep.found() + talerpq_dep = cc.find_library('talerpq', required: true) + endif + cc.has_header_symbol( + 'taler/taler_pq_lib.h', + 'TALER_PQ_query_param_array_blinded_denom_sig', + required: true, + dependencies: [talerpq_dep], + ) + private_config.set10('HAVE_TALERPQ', talerpq_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 + + talertwistertesting_dep = dependency('talertwistertesting', required: false) + if not talertwistertesting_dep.found() + talertwistertesting_dep = cc.find_library( + 'talertwistertesting', + required: false, + ) + endif + cc.has_header_symbol( + 'taler/taler_twister_testing_lib.h', + 'TALER_TWISTER_run_twister', + required: true, + dependencies: [talertwistertesting_dep], + ) + private_config.set10('HAVE_TWISTER', talertwistertesting_dep.found()) + qrencode_dep = dependency('qrencode', required: false) + if not qrencode_dep.found() + qrencode_dep = cc.find_library('qrencode', required: true) + endif + m_dep = cc.find_library('m', required: false) + if m_dep.found() + private_config.set('HAVE_LIBM', 1) + 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 = [ + ['libtalermerchant', '9:0:1'], + ['libtalermerchantutil', '1:1:1'], + ['libtalermerchantbank', '0:1:0'], + ['libtalermerchantdb', '4:1:2'], + ['libtalermerchanttesting', '4:1:1'], + ] + + 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 + + taler_prefix = get_option('prefix') / get_option('libdir') + + add_test_setup( + 'default', + env: ['TALER_merchant_PREFIX=' + taler_prefix], + exclude_suites: ['perf', 'installcheck', 'integrationtests'], + is_default: true, + ) +else + subdir('contrib') + if not get_option('disable-doc') + subdir('doc') + endif +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,5 @@ +# Build options +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/src/Makefile.am b/src/Makefile.am @@ -1,3 +0,0 @@ -# This Makefile is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include -SUBDIRS = include util bank backenddb backend lib testing merchant-tools diff --git a/src/backend/Makefile.am b/src/backend/Makefile.am @@ -1,447 +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-merchant/config.d/ - -pkgcfg_DATA = \ - kudos.conf \ - merchant.conf \ - tops.conf - - -bin_SCRIPTS = \ - taler-merchant-report-generator-email \ - taler-merchant-report-generator-file - -EXTRA_DIST = \ - $(pkgcfg_DATA) \ - $(bin_SCRIPTS) - -bin_PROGRAMS = \ - taler-merchant-depositcheck \ - taler-merchant-exchangekeyupdate \ - taler-merchant-httpd \ - taler-merchant-kyccheck \ - taler-merchant-reconciliation \ - taler-merchant-report-generator \ - taler-merchant-webhook \ - taler-merchant-wirewatch - -if HAVE_DONAU - bin_PROGRAMS += \ - taler-merchant-donaukeyupdate -endif - -taler_merchant_depositcheck_SOURCES = \ - taler-merchant-depositcheck.c -taler_merchant_depositcheck_LDADD = \ - $(top_builddir)/src/backenddb/libtalermerchantdb.la \ - $(top_builddir)/src/util/libtalermerchantutil.la \ - -ltalerexchange \ - -ltalerjson \ - -ltalerutil \ - -ltalerpq \ - -ljansson \ - -lgnunetcurl \ - -lgnunetjson \ - -lgnunetutil \ - -lcurl \ - $(XLIB) -taler_merchant_depositcheck_CFLAGS = \ - $(AM_CFLAGS) - - -taler_merchant_exchangekeyupdate_SOURCES = \ - taler-merchant-exchangekeyupdate.c -taler_merchant_exchangekeyupdate_LDADD = \ - $(top_builddir)/src/backenddb/libtalermerchantdb.la \ - $(top_builddir)/src/util/libtalermerchantutil.la \ - -ltalerexchange \ - -ltalerjson \ - -ltalerutil \ - -ltalerpq \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -lcurl \ - $(XLIB) -taler_merchant_exchangekeyupdate_CFLAGS = \ - $(AM_CFLAGS) - - -taler_merchant_httpd_SOURCES = \ - taler-merchant-httpd.c taler-merchant-httpd.h \ - taler-merchant-httpd_auth.c \ - taler-merchant-httpd_auth.h \ - taler-merchant-httpd_contract.c taler-merchant-httpd_contract.h \ - taler-merchant-httpd_dispatcher.c \ - taler-merchant-httpd_dispatcher.h \ - taler-merchant-httpd_exchanges.c \ - taler-merchant-httpd_exchanges.h \ - taler-merchant-httpd_get-orders-ORDER_ID.c \ - taler-merchant-httpd_get-orders-ORDER_ID.h \ - taler-merchant-httpd_get-sessions-SESSION_ID.c \ - taler-merchant-httpd_get-sessions-SESSION_ID.h \ - taler-merchant-httpd_get-products-IMAGE_HASH-image.c \ - taler-merchant-httpd_get-products-IMAGE_HASH-image.h \ - taler-merchant-httpd_get-config.c \ - taler-merchant-httpd_get-config.h \ - taler-merchant-httpd_get-exchanges.c \ - taler-merchant-httpd_get-exchanges.h \ - taler-merchant-httpd_get-templates-TEMPLATE_ID.c \ - taler-merchant-httpd_get-templates-TEMPLATE_ID.h \ - taler-merchant-httpd_helper.c \ - taler-merchant-httpd_helper.h \ - taler-merchant-httpd_mhd.c \ - taler-merchant-httpd_mhd.h \ - taler-merchant-httpd_get-terms.c \ - taler-merchant-httpd_get-terms.h \ - taler-merchant-httpd_mfa.c \ - taler-merchant-httpd_mfa.h \ - taler-merchant-httpd_delete-private-accounts-H_WIRE.c \ - taler-merchant-httpd_delete-private-accounts-H_WIRE.h \ - taler-merchant-httpd_delete-private-categories-CATEGORY_ID.c \ - taler-merchant-httpd_delete-private-categories-CATEGORY_ID.h \ - taler-merchant-httpd_delete-private-units-UNIT.c \ - taler-merchant-httpd_delete-private-units-UNIT.h \ - taler-merchant-httpd_delete-management-instances-INSTANCE.c \ - taler-merchant-httpd_delete-management-instances-INSTANCE.h \ - taler-merchant-httpd_delete-private-token.c \ - taler-merchant-httpd_delete-private-token.h \ - taler-merchant-httpd_delete-private-tokens-SERIAL.c \ - taler-merchant-httpd_delete-private-tokens-SERIAL.h \ - taler-merchant-httpd_delete-private-products-PRODUCT_ID.c \ - taler-merchant-httpd_delete-private-products-PRODUCT_ID.h \ - taler-merchant-httpd_delete-private-orders-ORDER_ID.c \ - taler-merchant-httpd_delete-private-orders-ORDER_ID.h \ - taler-merchant-httpd_delete-private-otp-devices-DEVICE_ID.c \ - taler-merchant-httpd_delete-private-otp-devices-DEVICE_ID.h \ - taler-merchant-httpd_delete-private-templates-TEMPLATE_ID.c \ - taler-merchant-httpd_delete-private-templates-TEMPLATE_ID.h \ - taler-merchant-httpd_delete-private-tokenfamilies-TOKEN_FAMILY_SLUG.c \ - taler-merchant-httpd_delete-private-tokenfamilies-TOKEN_FAMILY_SLUG.h \ - taler-merchant-httpd_delete-private-transfers-TID.c \ - taler-merchant-httpd_delete-private-transfers-TID.h \ - taler-merchant-httpd_delete-private-webhooks-WEBHOOK_ID.c \ - taler-merchant-httpd_delete-private-webhooks-WEBHOOK_ID.h \ - taler-merchant-httpd_get-private-accounts.c \ - taler-merchant-httpd_get-private-accounts.h \ - taler-merchant-httpd_get-private-accounts-H_WIRE.c \ - taler-merchant-httpd_get-private-accounts-H_WIRE.h \ - taler-merchant-httpd_get-private-categories.c \ - taler-merchant-httpd_get-private-categories.h \ - taler-merchant-httpd_get-private-units.c \ - taler-merchant-httpd_get-private-units.h \ - taler-merchant-httpd_get-private-categories-CATEGORY_ID.c \ - taler-merchant-httpd_get-private-categories-CATEGORY_ID.h \ - taler-merchant-httpd_get-private-units-UNIT.c \ - taler-merchant-httpd_get-private-units-UNIT.h \ - taler-merchant-httpd_get-management-instances.c \ - taler-merchant-httpd_get-management-instances.h \ - taler-merchant-httpd_get-management-instances-INSTANCE.c \ - taler-merchant-httpd_get-management-instances-INSTANCE.h \ - taler-merchant-httpd_get-private-kyc.c \ - taler-merchant-httpd_get-private-kyc.h \ - taler-merchant-httpd_get-private-tokens.c \ - taler-merchant-httpd_get-private-tokens.h \ - taler-merchant-httpd_get-private-pos.c \ - taler-merchant-httpd_get-private-pos.h \ - taler-merchant-httpd_get-private-products.c \ - taler-merchant-httpd_get-private-products.h \ - taler-merchant-httpd_get-private-products-PRODUCT_ID.c \ - taler-merchant-httpd_get-private-products-PRODUCT_ID.h \ - taler-merchant-httpd_get-private-orders.c \ - taler-merchant-httpd_get-private-orders.h \ - taler-merchant-httpd_get-private-orders-ORDER_ID.c \ - taler-merchant-httpd_get-private-orders-ORDER_ID.h \ - taler-merchant-httpd_get-private-otp-devices.c \ - taler-merchant-httpd_get-private-otp-devices.h \ - taler-merchant-httpd_get-private-otp-devices-DEVICE_ID.c \ - taler-merchant-httpd_get-private-otp-devices-DEVICE_ID.h \ - taler-merchant-httpd_get-private-incoming.c \ - taler-merchant-httpd_get-private-incoming.h \ - taler-merchant-httpd_get-private-incoming-ID.c \ - taler-merchant-httpd_get-private-incoming-ID.h \ - taler-merchant-httpd_get-private-transfers.c \ - taler-merchant-httpd_get-private-transfers.h \ - taler-merchant-httpd_get-private-templates.c \ - taler-merchant-httpd_get-private-templates.h \ - taler-merchant-httpd_get-private-templates-TEMPLATE_ID.c \ - taler-merchant-httpd_get-private-templates-TEMPLATE_ID.h \ - taler-merchant-httpd_get-private-tokenfamilies.c \ - taler-merchant-httpd_get-private-tokenfamilies.h \ - taler-merchant-httpd_get-private-tokenfamilies-TOKEN_FAMILY_SLUG.c \ - taler-merchant-httpd_get-private-tokenfamilies-TOKEN_FAMILY_SLUG.h \ - taler-merchant-httpd_get-private-webhooks.c \ - taler-merchant-httpd_get-private-webhooks.h \ - taler-merchant-httpd_get-private-webhooks-WEBHOOK_ID.c \ - taler-merchant-httpd_get-private-webhooks-WEBHOOK_ID.h \ - taler-merchant-httpd_patch-private-accounts-H_WIRE.c \ - taler-merchant-httpd_patch-private-accounts-H_WIRE.h \ - taler-merchant-httpd_patch-private-categories-CATEGORY_ID.c \ - taler-merchant-httpd_patch-private-categories-CATEGORY_ID.h \ - taler-merchant-httpd_patch-private-units-UNIT.c \ - taler-merchant-httpd_patch-private-units-UNIT.h \ - taler-merchant-httpd_patch-management-instances-INSTANCE.c \ - taler-merchant-httpd_patch-management-instances-INSTANCE.h \ - taler-merchant-httpd_patch-private-orders-ORDER_ID-forget.c \ - taler-merchant-httpd_patch-private-orders-ORDER_ID-forget.h \ - taler-merchant-httpd_patch-private-otp-devices-DEVICE_ID.c \ - taler-merchant-httpd_patch-private-otp-devices-DEVICE_ID.h \ - taler-merchant-httpd_patch-private-products-PRODUCT_ID.c \ - taler-merchant-httpd_patch-private-products-PRODUCT_ID.h \ - taler-merchant-httpd_patch-private-templates-TEMPLATE_ID.c \ - taler-merchant-httpd_patch-private-templates-TEMPLATE_ID.h \ - taler-merchant-httpd_patch-private-tokenfamilies-TOKEN_FAMILY_SLUG.c \ - taler-merchant-httpd_patch-private-tokenfamilies-TOKEN_FAMILY_SLUG.h \ - taler-merchant-httpd_patch-private-webhooks-WEBHOOK_ID.c \ - taler-merchant-httpd_patch-private-webhooks-WEBHOOK_ID.h \ - taler-merchant-httpd_post-private-accounts.c \ - taler-merchant-httpd_post-private-accounts.h \ - taler-merchant-httpd_post-private-categories.c \ - taler-merchant-httpd_post-private-categories.h \ - taler-merchant-httpd_post-private-units.c \ - taler-merchant-httpd_post-private-units.h \ - taler-merchant-httpd_post-management-instances.c \ - taler-merchant-httpd_post-management-instances.h \ - taler-merchant-httpd_post-management-instances-INSTANCE-auth.c \ - taler-merchant-httpd_post-management-instances-INSTANCE-auth.h \ - taler-merchant-httpd_post-private-token.c \ - taler-merchant-httpd_post-private-token.h \ - taler-merchant-httpd_post-private-orders-ORDER_ID-refund.c \ - taler-merchant-httpd_post-private-orders-ORDER_ID-refund.h \ - taler-merchant-httpd_post-private-orders.c \ - taler-merchant-httpd_post-private-orders.h \ - taler-merchant-httpd_post-private-products.c \ - taler-merchant-httpd_post-private-products.h \ - taler-merchant-httpd_post-private-otp-devices.c \ - taler-merchant-httpd_post-private-otp-devices.h \ - taler-merchant-httpd_post-private-products-PRODUCT_ID-lock.c \ - taler-merchant-httpd_post-private-products-PRODUCT_ID-lock.h \ - taler-merchant-httpd_post-private-templates.c \ - taler-merchant-httpd_post-private-templates.h \ - taler-merchant-httpd_post-private-tokenfamilies.c \ - taler-merchant-httpd_post-private-tokenfamilies.h \ - taler-merchant-httpd_post-private-transfers.c \ - taler-merchant-httpd_post-private-transfers.h \ - taler-merchant-httpd_post-private-webhooks.c \ - taler-merchant-httpd_post-private-webhooks.h \ - taler-merchant-httpd_post-private-accounts-H_WIRE-kycauth.c \ - taler-merchant-httpd_post-private-accounts-H_WIRE-kycauth.h \ - taler-merchant-httpd_post-challenge-ID.c \ - taler-merchant-httpd_post-challenge-ID.h \ - taler-merchant-httpd_post-challenge-ID-confirm.c \ - taler-merchant-httpd_post-challenge-ID-confirm.h \ - taler-merchant-httpd_post-orders-ORDER_ID-abort.c \ - taler-merchant-httpd_post-orders-ORDER_ID-abort.h \ - taler-merchant-httpd_post-orders-ORDER_ID-claim.c \ - taler-merchant-httpd_post-orders-ORDER_ID-claim.h \ - taler-merchant-httpd_post-orders-ORDER_ID-pay.c \ - taler-merchant-httpd_post-orders-ORDER_ID-pay.h \ - taler-merchant-httpd_post-orders-ORDER_ID-paid.c \ - taler-merchant-httpd_post-orders-ORDER_ID-paid.h \ - taler-merchant-httpd_post-orders-ORDER_ID-refund.c \ - taler-merchant-httpd_post-orders-ORDER_ID-refund.h \ - taler-merchant-httpd_post-orders-ORDER_ID-unclaim.c \ - taler-merchant-httpd_post-orders-ORDER_ID-unclaim.h \ - taler-merchant-httpd_post-templates-TEMPLATE_ID.c \ - taler-merchant-httpd_post-templates-TEMPLATE_ID.h \ - taler-merchant-httpd_post-reports-REPORT_ID.c \ - taler-merchant-httpd_post-reports-REPORT_ID.h \ - taler-merchant-httpd_get-private-statistics-amount-SLUG.c \ - taler-merchant-httpd_get-private-statistics-amount-SLUG.h \ - taler-merchant-httpd_get-private-statistics-counter-SLUG.c \ - taler-merchant-httpd_get-private-statistics-counter-SLUG.h \ - taler-merchant-httpd_get-private-statistics-report-transactions.c \ - taler-merchant-httpd_get-private-statistics-report-transactions.h \ - taler-merchant-httpd_qr.c \ - taler-merchant-httpd_qr.h \ - taler-merchant-httpd_get-webui.c \ - taler-merchant-httpd_get-webui.h \ - taler-merchant-httpd_delete-private-reports-REPORT_ID.c \ - taler-merchant-httpd_delete-private-reports-REPORT_ID.h \ - taler-merchant-httpd_get-private-reports-REPORT_ID.c \ - taler-merchant-httpd_get-private-reports-REPORT_ID.h \ - taler-merchant-httpd_get-private-reports.c \ - taler-merchant-httpd_get-private-reports.h \ - taler-merchant-httpd_patch-private-reports-REPORT_ID.c \ - taler-merchant-httpd_patch-private-reports-REPORT_ID.h \ - taler-merchant-httpd_post-private-reports.c \ - taler-merchant-httpd_post-private-reports.h \ - taler-merchant-httpd_delete-private-pots-POT_ID.c \ - taler-merchant-httpd_delete-private-pots-POT_ID.h \ - taler-merchant-httpd_get-private-pots-POT_ID.c \ - taler-merchant-httpd_get-private-pots-POT_ID.h \ - taler-merchant-httpd_get-private-pots.c \ - taler-merchant-httpd_get-private-pots.h \ - taler-merchant-httpd_patch-private-pots-POT_ID.c \ - taler-merchant-httpd_patch-private-pots-POT_ID.h \ - taler-merchant-httpd_post-private-pots.c \ - taler-merchant-httpd_post-private-pots.h \ - taler-merchant-httpd_delete-private-groups-GROUP_ID.c \ - taler-merchant-httpd_delete-private-groups-GROUP_ID.h \ - taler-merchant-httpd_get-private-groups.c \ - taler-merchant-httpd_get-private-groups.h \ - taler-merchant-httpd_patch-private-groups-GROUP_ID.c \ - taler-merchant-httpd_patch-private-groups-GROUP_ID.h \ - taler-merchant-httpd_post-private-groups.c \ - taler-merchant-httpd_post-private-groups.h \ - taler-merchant-httpd_statics.c \ - taler-merchant-httpd_statics.h \ - taler-merchant-httpd_get-private-donau.c \ - taler-merchant-httpd_get-private-donau.h \ - taler-merchant-httpd_post-private-donau.c \ - taler-merchant-httpd_post-private-donau.h \ - taler-merchant-httpd_delete-private-donau-DONAU_SERIAL.c \ - taler-merchant-httpd_delete-private-donau-DONAU_SERIAL.h - -taler_merchant_httpd_LDADD = \ - $(top_builddir)/src/backenddb/libtalermerchantdb.la \ - $(top_builddir)/src/bank/libtalermerchantbank.la \ - $(top_builddir)/src/util/libtalermerchantutil.la \ - -ldonau \ - -ldonaujson \ - -ltalerexchange \ - -ltalertemplating \ - -ltalermhd \ - -ltalerbank \ - -ltalerkyclogic \ - -ltalerjson \ - -ltalerutil \ - -ltalerpq \ - -lmicrohttpd \ - -ljansson \ - -lgnunetcurl \ - -lgnunetjson \ - -lgnunetutil \ - @QR_LIBS@ \ - $(XLIB) - - -taler_merchant_httpd_CFLAGS = \ - @QR_CFLAGS@ \ - $(AM_CFLAGS) - - -taler_merchant_kyccheck_SOURCES = \ - taler-merchant-kyccheck.c -taler_merchant_kyccheck_LDADD = \ - $(top_builddir)/src/backenddb/libtalermerchantdb.la \ - $(top_builddir)/src/util/libtalermerchantutil.la \ - -ltalerexchange \ - -ltalerjson \ - -ltalerutil \ - -ltalerpq \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -lcurl \ - $(XLIB) -taler_merchant_kyccheck_CFLAGS = \ - $(AM_CFLAGS) - - -taler_merchant_reconciliation_SOURCES = \ - taler-merchant-reconciliation.c -taler_merchant_reconciliation_LDADD = \ - $(top_builddir)/src/backenddb/libtalermerchantdb.la \ - $(top_builddir)/src/util/libtalermerchantutil.la \ - -ltalerexchange \ - -ltalerjson \ - -ltalerutil \ - -ltalerpq \ - -lgnunetpq \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -lcurl \ - $(XLIB) -taler_merchant_reconciliation_CFLAGS = \ - $(AM_CFLAGS) - - -taler_merchant_report_generator_SOURCES = \ - taler-merchant-report-generator.c -taler_merchant_report_generator_LDADD = \ - $(top_builddir)/src/backenddb/libtalermerchantdb.la \ - $(top_builddir)/src/util/libtalermerchantutil.la \ - -ltalerexchange \ - -ltalerjson \ - -ltalercurl \ - -ltalerutil \ - -ltalerpq \ - -lgnunetpq \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -lcurl \ - $(XLIB) -taler_merchant_report_generator_CFLAGS = \ - $(AM_CFLAGS) - - - -taler_merchant_webhook_SOURCES = \ - taler-merchant-webhook.c -taler_merchant_webhook_LDADD = \ - $(top_builddir)/src/backenddb/libtalermerchantdb.la \ - $(top_builddir)/src/util/libtalermerchantutil.la \ - -ltalertemplating \ - -ltalermhd \ - -ltalerjson \ - -ltalerutil \ - -ltalerpq \ - -ljansson \ - -lgnunetcurl \ - -lgnunetjson \ - -lgnunetutil \ - -lcurl \ - $(XLIB) -taler_merchant_webhook_CFLAGS = \ - $(AM_CFLAGS) - - -taler_merchant_wirewatch_SOURCES = \ - taler-merchant-wirewatch.c -taler_merchant_wirewatch_LDADD = \ - $(top_builddir)/src/bank/libtalermerchantbank.la \ - $(top_builddir)/src/backenddb/libtalermerchantdb.la \ - $(top_builddir)/src/util/libtalermerchantutil.la \ - -ltalermhd \ - -ltalerjson \ - -ltalerutil \ - -ltalerpq \ - -ljansson \ - -lgnunetcurl \ - -lgnunetjson \ - -lgnunetutil \ - -lcurl \ - $(XLIB) -taler_merchant_wirewatch_CFLAGS = \ - $(AM_CFLAGS) - - -if HAVE_DONAU - taler_merchant_donaukeyupdate_SOURCES = \ - taler-merchant-donaukeyupdate.c - taler_merchant_donaukeyupdate_LDADD = \ - $(top_builddir)/src/util/libtalermerchantutil.la \ - $(top_builddir)/src/backenddb/libtalermerchantdb.la \ - -ltalerexchange \ - -ltalerjson \ - -ltalerutil \ - -ltalerpq \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -lcurl \ - -ldonau \ - $(XLIB) - taler_merchant_donaukeyupdate_CFLAGS = \ - $(AM_CFLAGS) -endif diff --git a/src/backend/meson.build b/src/backend/meson.build @@ -0,0 +1,347 @@ +# This build file is in the public domain +install_data('kudos.conf', 'merchant.conf', 'tops.conf', install_dir: pkgcfgdir) + + +configure_file( + input: 'taler-merchant-report-generator-email', + output: 'taler-merchant-report-generator-email', + install: true, + copy: true, + install_dir: get_option('bindir'), +) + +configure_file( + input: 'taler-merchant-report-generator-file', + output: 'taler-merchant-report-generator-file', + install: true, + copy: true, + install_dir: get_option('bindir'), +) + + +executable( + 'taler-merchant-depositcheck', + ['taler-merchant-depositcheck.c'], + dependencies: [ + libtalermerchantutil_dep, + talerutil_dep, + talerjson_dep, + libtalermerchantdb_dep, + talerpq_dep, + talerexchange_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + curl_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-merchant-exchangekeyupdate', + ['taler-merchant-exchangekeyupdate.c'], + dependencies: [ + libtalermerchantutil_dep, + talerutil_dep, + talerjson_dep, + libtalermerchantdb_dep, + talerpq_dep, + talerexchange_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + curl_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + + +taler_merchant_httpd_SOURCES = [ + 'taler-merchant-httpd.c', + 'taler-merchant-httpd_auth.c', + 'taler-merchant-httpd_contract.c', + 'taler-merchant-httpd_dispatcher.c', + 'taler-merchant-httpd_exchanges.c', + 'taler-merchant-httpd_get-orders-ORDER_ID.c', + 'taler-merchant-httpd_get-sessions-SESSION_ID.c', + 'taler-merchant-httpd_get-products-IMAGE_HASH-image.c', + 'taler-merchant-httpd_get-config.c', + 'taler-merchant-httpd_get-exchanges.c', + 'taler-merchant-httpd_get-templates-TEMPLATE_ID.c', + 'taler-merchant-httpd_helper.c', + 'taler-merchant-httpd_mhd.c', + 'taler-merchant-httpd_get-terms.c', + 'taler-merchant-httpd_mfa.c', + 'taler-merchant-httpd_delete-private-accounts-H_WIRE.c', + 'taler-merchant-httpd_delete-private-categories-CATEGORY_ID.c', + 'taler-merchant-httpd_delete-private-units-UNIT.c', + 'taler-merchant-httpd_delete-management-instances-INSTANCE.c', + 'taler-merchant-httpd_delete-private-token.c', + 'taler-merchant-httpd_delete-private-tokens-SERIAL.c', + 'taler-merchant-httpd_delete-private-products-PRODUCT_ID.c', + 'taler-merchant-httpd_delete-private-orders-ORDER_ID.c', + 'taler-merchant-httpd_delete-private-otp-devices-DEVICE_ID.c', + 'taler-merchant-httpd_delete-private-templates-TEMPLATE_ID.c', + 'taler-merchant-httpd_delete-private-tokenfamilies-TOKEN_FAMILY_SLUG.c', + 'taler-merchant-httpd_delete-private-transfers-TID.c', + 'taler-merchant-httpd_delete-private-webhooks-WEBHOOK_ID.c', + 'taler-merchant-httpd_get-private-accounts.c', + 'taler-merchant-httpd_get-private-accounts-H_WIRE.c', + 'taler-merchant-httpd_get-private-categories.c', + 'taler-merchant-httpd_get-private-units.c', + 'taler-merchant-httpd_get-private-categories-CATEGORY_ID.c', + 'taler-merchant-httpd_get-private-units-UNIT.c', + 'taler-merchant-httpd_get-management-instances.c', + 'taler-merchant-httpd_get-management-instances-INSTANCE.c', + 'taler-merchant-httpd_get-private-kyc.c', + 'taler-merchant-httpd_get-private-tokens.c', + 'taler-merchant-httpd_get-private-pos.c', + 'taler-merchant-httpd_get-private-products.c', + 'taler-merchant-httpd_get-private-products-PRODUCT_ID.c', + 'taler-merchant-httpd_get-private-orders.c', + 'taler-merchant-httpd_get-private-orders-ORDER_ID.c', + 'taler-merchant-httpd_get-private-otp-devices.c', + 'taler-merchant-httpd_get-private-otp-devices-DEVICE_ID.c', + 'taler-merchant-httpd_get-private-incoming.c', + 'taler-merchant-httpd_get-private-incoming-ID.c', + 'taler-merchant-httpd_get-private-transfers.c', + 'taler-merchant-httpd_get-private-templates.c', + 'taler-merchant-httpd_get-private-templates-TEMPLATE_ID.c', + 'taler-merchant-httpd_get-private-tokenfamilies.c', + 'taler-merchant-httpd_get-private-tokenfamilies-TOKEN_FAMILY_SLUG.c', + 'taler-merchant-httpd_get-private-webhooks.c', + 'taler-merchant-httpd_get-private-webhooks-WEBHOOK_ID.c', + 'taler-merchant-httpd_patch-private-accounts-H_WIRE.c', + 'taler-merchant-httpd_patch-private-categories-CATEGORY_ID.c', + 'taler-merchant-httpd_patch-private-units-UNIT.c', + 'taler-merchant-httpd_patch-management-instances-INSTANCE.c', + 'taler-merchant-httpd_patch-private-orders-ORDER_ID-forget.c', + 'taler-merchant-httpd_patch-private-otp-devices-DEVICE_ID.c', + 'taler-merchant-httpd_patch-private-products-PRODUCT_ID.c', + 'taler-merchant-httpd_patch-private-templates-TEMPLATE_ID.c', + 'taler-merchant-httpd_patch-private-tokenfamilies-TOKEN_FAMILY_SLUG.c', + 'taler-merchant-httpd_patch-private-webhooks-WEBHOOK_ID.c', + 'taler-merchant-httpd_post-private-accounts.c', + 'taler-merchant-httpd_post-private-categories.c', + 'taler-merchant-httpd_post-private-units.c', + 'taler-merchant-httpd_post-management-instances.c', + 'taler-merchant-httpd_post-management-instances-INSTANCE-auth.c', + 'taler-merchant-httpd_post-private-token.c', + 'taler-merchant-httpd_post-private-orders-ORDER_ID-refund.c', + 'taler-merchant-httpd_post-private-orders.c', + 'taler-merchant-httpd_post-private-products.c', + 'taler-merchant-httpd_post-private-otp-devices.c', + 'taler-merchant-httpd_post-private-products-PRODUCT_ID-lock.c', + 'taler-merchant-httpd_post-private-templates.c', + 'taler-merchant-httpd_post-private-tokenfamilies.c', + 'taler-merchant-httpd_post-private-transfers.c', + 'taler-merchant-httpd_post-private-webhooks.c', + 'taler-merchant-httpd_post-private-accounts-H_WIRE-kycauth.c', + 'taler-merchant-httpd_post-challenge-ID.c', + 'taler-merchant-httpd_post-challenge-ID-confirm.c', + 'taler-merchant-httpd_post-orders-ORDER_ID-abort.c', + 'taler-merchant-httpd_post-orders-ORDER_ID-claim.c', + 'taler-merchant-httpd_post-orders-ORDER_ID-pay.c', + 'taler-merchant-httpd_post-orders-ORDER_ID-paid.c', + 'taler-merchant-httpd_post-orders-ORDER_ID-refund.c', + 'taler-merchant-httpd_post-orders-ORDER_ID-unclaim.c', + 'taler-merchant-httpd_post-templates-TEMPLATE_ID.c', + 'taler-merchant-httpd_post-reports-REPORT_ID.c', + 'taler-merchant-httpd_get-private-statistics-amount-SLUG.c', + 'taler-merchant-httpd_get-private-statistics-counter-SLUG.c', + 'taler-merchant-httpd_get-private-statistics-report-transactions.c', + 'taler-merchant-httpd_qr.c', + 'taler-merchant-httpd_get-webui.c', + 'taler-merchant-httpd_delete-private-reports-REPORT_ID.c', + 'taler-merchant-httpd_get-private-reports-REPORT_ID.c', + 'taler-merchant-httpd_get-private-reports.c', + 'taler-merchant-httpd_patch-private-reports-REPORT_ID.c', + 'taler-merchant-httpd_post-private-reports.c', + 'taler-merchant-httpd_delete-private-pots-POT_ID.c', + 'taler-merchant-httpd_get-private-pots-POT_ID.c', + 'taler-merchant-httpd_get-private-pots.c', + 'taler-merchant-httpd_patch-private-pots-POT_ID.c', + 'taler-merchant-httpd_post-private-pots.c', + 'taler-merchant-httpd_delete-private-groups-GROUP_ID.c', + 'taler-merchant-httpd_get-private-groups.c', + 'taler-merchant-httpd_patch-private-groups-GROUP_ID.c', + 'taler-merchant-httpd_post-private-groups.c', + 'taler-merchant-httpd_statics.c', + 'taler-merchant-httpd_get-private-donau.c', + 'taler-merchant-httpd_post-private-donau.c', + 'taler-merchant-httpd_delete-private-donau-DONAU_SERIAL.c', +] + +executable( + 'taler-merchant-httpd', + taler_merchant_httpd_SOURCES, + dependencies: [ + donau_dep, + donaujson_dep, + libtalermerchantutil_dep, + libtalermerchantbank_dep, + talerutil_dep, + talerjson_dep, + libtalermerchantdb_dep, + talerpq_dep, + talerkyclogic_dep, + talerbank_dep, + talermhd_dep, + talerexchange_dep, + talertemplating_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + mhd_dep, + json_dep, + qrencode_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + + +executable( + 'taler-merchant-kyccheck', + ['taler-merchant-kyccheck.c'], + dependencies: [ + libtalermerchantutil_dep, + talerutil_dep, + talerjson_dep, + libtalermerchantdb_dep, + talerpq_dep, + talerexchange_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + curl_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + + +executable( + 'taler-merchant-reconciliation', + ['taler-merchant-reconciliation.c'], + dependencies: [ + libtalermerchantutil_dep, + talerutil_dep, + talerjson_dep, + libtalermerchantdb_dep, + talerpq_dep, + talerexchange_dep, + gnunetpq_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + curl_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + + +executable( + 'taler-merchant-report-generator', + ['taler-merchant-report-generator.c'], + dependencies: [ + libtalermerchantutil_dep, + talerutil_dep, + talerjson_dep, + libtalermerchantdb_dep, + talerpq_dep, + talercurl_dep, + talerexchange_dep, + gnunetpq_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + curl_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + + +executable( + 'taler-merchant-webhook', + ['taler-merchant-webhook.c'], + dependencies: [ + libtalermerchantutil_dep, + talerutil_dep, + talerjson_dep, + libtalermerchantdb_dep, + talermhd_dep, + talerpq_dep, + talerexchange_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + curl_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-merchant-wirewatch', + ['taler-merchant-wirewatch.c'], + dependencies: [ + libtalermerchantutil_dep, + libtalermerchantbank_dep, + talerutil_dep, + talerjson_dep, + libtalermerchantdb_dep, + talermhd_dep, + talerpq_dep, + talerexchange_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + curl_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + + +if donau_dep.found() + executable( + 'taler-merchant-donaukeyupdate', + ['taler-merchant-donaukeyupdate.c'], + dependencies: [ + libtalermerchantutil_dep, + talerutil_dep, + talerjson_dep, + libtalermerchantdb_dep, + talermhd_dep, + talerpq_dep, + talerexchange_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + curl_dep, + donau_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + ) + +endif diff --git a/src/backenddb/Makefile.am b/src/backenddb/Makefile.am @@ -1,339 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include - -plugindir = $(libdir)/taler-merchant - -pkgcfgdir = $(prefix)/share/taler-merchant/config.d/ - -pkgcfg_DATA = \ - merchantdb-postgres.conf - -sqldir = $(prefix)/share/taler-merchant/sql/ - -sqlinputs = \ - pg_*.sql \ - procedures.sql.in - -sql_DATA = \ - versioning.sql \ - procedures.sql \ - merchant-0001.sql \ - merchant-0002.sql \ - merchant-0003.sql \ - merchant-0004.sql \ - merchant-0005.sql \ - merchant-0006.sql \ - merchant-0007.sql \ - merchant-0008.sql \ - merchant-0009.sql \ - merchant-0010.sql \ - merchant-0011.sql \ - merchant-0012.sql \ - merchant-0013.sql \ - merchant-0014.sql \ - merchant-0015.sql \ - merchant-0016.sql \ - merchant-0017.sql \ - merchant-0018.sql \ - merchant-0019.sql \ - merchant-0020.sql \ - merchant-0021.sql \ - merchant-0022.sql \ - merchant-0023.sql \ - merchant-0024.sql \ - merchant-0025.sql \ - merchant-0026.sql \ - merchant-0027.sql \ - merchant-0028.sql \ - merchant-0029.sql \ - merchant-0030.sql \ - merchant-0031.sql \ - merchant-0032.sql \ - merchant-0033.sql \ - merchant-0034.sql \ - drop.sql - -BUILT_SOURCES = \ - procedures.sql - -procedures.sql: procedures.sql.in pg_*.sql - chmod +w $@ || true - gcc -E -P -undef - < procedures.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ - chmod ugo-w $@ - - -if HAVE_POSTGRESQL -if HAVE_GNUNETPQ -plugin_LTLIBRARIES = \ - libtaler_plugin_merchantdb_postgres.la -endif -endif - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -lib_LTLIBRARIES = \ - libtalermerchantdb.la - -libtalermerchantdb_la_SOURCES = \ - merchantdb_plugin.c \ - merchantdb_helper.c - -libtalermerchantdb_la_LIBADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/util/libtalermerchantutil.la \ - -ltalerutil \ - -ltalerpq \ - -lgnunetutil \ - -lltdl \ - $(XLIB) - -libtalermerchantdb_la_LDFLAGS = \ - $(POSTGRESQL_LDFLAGS) \ - -version-info 4:1:2 \ - -no-undefined - -libtaler_plugin_merchantdb_postgres_la_SOURCES = \ - pg_account_kyc_get_outdated.h pg_account_kyc_get_outdated.c \ - pg_account_kyc_get_status.h pg_account_kyc_get_status.c \ - pg_account_kyc_set_failed.h pg_account_kyc_set_failed.c \ - pg_account_kyc_set_status.h pg_account_kyc_set_status.c \ - pg_activate_account.h pg_activate_account.c \ - pg_check_transfer_exists.h pg_check_transfer_exists.c \ - pg_delete_category.h pg_delete_category.c \ - pg_delete_contract_terms.h pg_delete_contract_terms.c \ - pg_delete_exchange_accounts.h pg_delete_exchange_accounts.c \ - pg_delete_instance_private_key.h pg_delete_instance_private_key.c \ - pg_delete_login_token.h pg_delete_login_token.c \ - pg_delete_order.h pg_delete_order.c \ - pg_delete_otp.h pg_delete_otp.c \ - pg_delete_pending_webhook.h pg_delete_pending_webhook.c \ - pg_delete_product.h pg_delete_product.c \ - pg_delete_template.h pg_delete_template.c \ - pg_delete_token_family.h pg_delete_token_family.c \ - pg_delete_transfer.h pg_delete_transfer.c \ - pg_delete_webhook.h pg_delete_webhook.c \ - pg_expire_locks.h pg_expire_locks.c \ - pg_gc.h pg_gc.c \ - pg_get_kyc_limits.h pg_get_kyc_limits.c \ - pg_get_kyc_status.h pg_get_kyc_status.c \ - pg_helper.h pg_helper.c \ - pg_inactivate_account.h pg_inactivate_account.c \ - pg_increase_refund.h pg_increase_refund.c \ - pg_increment_money_pots.h pg_increment_money_pots.c \ - pg_insert_account.h pg_insert_account.c \ - pg_insert_category.h pg_insert_category.c \ - pg_insert_unit.h pg_insert_unit.c \ - pg_insert_contract_terms.h pg_insert_contract_terms.c \ - pg_insert_deposit.h pg_insert_deposit.c \ - pg_insert_deposit_confirmation.h pg_insert_deposit_confirmation.c \ - pg_insert_deposit_to_transfer.h pg_insert_deposit_to_transfer.c \ - pg_insert_exchange_account.h pg_insert_exchange_account.c \ - pg_insert_exchange_keys.h pg_insert_exchange_keys.c \ - pg_insert_exchange_signkey.h pg_insert_exchange_signkey.c \ - pg_insert_instance.h pg_insert_instance.c \ - pg_insert_issued_token.h pg_insert_issued_token.c \ - pg_insert_login_token.h pg_insert_login_token.c \ - pg_insert_order.h pg_insert_order.c \ - pg_insert_order_lock.h pg_insert_order_lock.c \ - pg_insert_otp.h pg_insert_otp.c \ - pg_insert_pending_webhook.h pg_insert_pending_webhook.c \ - pg_insert_product.h pg_insert_product.c \ - pg_insert_refund_proof.h pg_insert_refund_proof.c \ - pg_insert_spent_token.h pg_insert_spent_token.c \ - pg_insert_template.h pg_insert_template.c \ - pg_update_unit.h pg_update_unit.c \ - pg_insert_token_family.h pg_insert_token_family.c \ - pg_insert_token_family_key.h pg_insert_token_family_key.c \ - pg_insert_transfer.h pg_insert_transfer.c \ - pg_insert_transfer_details.h pg_insert_transfer_details.c \ - pg_insert_webhook.h pg_insert_webhook.c \ - pg_delete_unit.h pg_delete_unit.c \ - pg_lookup_units.h pg_lookup_units.c \ - pg_lookup_custom_units_by_names.h pg_lookup_custom_units_by_names.c \ - pg_select_unit.h pg_select_unit.c \ - pg_lookup_mfa_challenge.h pg_lookup_mfa_challenge.c \ - pg_solve_mfa_challenge.h pg_solve_mfa_challenge.c \ - pg_update_mfa_challenge.h pg_update_mfa_challenge.c \ - pg_create_mfa_challenge.h pg_create_mfa_challenge.c \ - pg_insert_report.h pg_insert_report.c \ - pg_delete_report.h pg_delete_report.c \ - pg_update_report.h pg_update_report.c \ - pg_check_report.h pg_check_report.c \ - pg_select_reports.h pg_select_reports.c \ - pg_lookup_reports_pending.h pg_lookup_reports_pending.c \ - pg_update_report_status.h pg_update_report_status.c \ - pg_select_report.h pg_select_report.c \ - pg_insert_product_group.h pg_insert_product_group.c \ - pg_delete_product_group.h pg_delete_product_group.c \ - pg_update_product_group.h pg_update_product_group.c \ - pg_select_product_groups.h pg_select_product_groups.c \ - pg_insert_unclaim_signature.h pg_insert_unclaim_signature.c \ - pg_lookup_reconciliation_details.h pg_lookup_reconciliation_details.c \ - pg_lookup_expected_transfer.h pg_lookup_expected_transfer.c \ - pg_insert_money_pot.h pg_insert_money_pot.c \ - pg_delete_money_pot.h pg_delete_money_pot.c \ - pg_update_money_pot.h pg_update_money_pot.c \ - pg_check_money_pots.h pg_check_money_pots.c \ - pg_select_money_pots.h pg_select_money_pots.c \ - pg_select_money_pot.h pg_select_money_pot.c \ - pg_lock_product.h pg_lock_product.c \ - pg_lookup_account.h pg_lookup_account.c \ - pg_lookup_all_products.h pg_lookup_all_products.c \ - pg_lookup_categories.h pg_lookup_categories.c \ - pg_lookup_categories_by_ids.h pg_lookup_categories_by_ids.c \ - pg_lookup_contract_terms.h pg_lookup_contract_terms.c \ - pg_lookup_contract_terms2.h pg_lookup_contract_terms2.c \ - pg_lookup_contract_terms3.h pg_lookup_contract_terms3.c \ - pg_lookup_deposits.h pg_lookup_deposits.c \ - pg_lookup_deposits_by_contract_and_coin.h pg_lookup_deposits_by_contract_and_coin.c \ - pg_lookup_deposits_by_order.h pg_lookup_deposits_by_order.c \ - pg_lookup_expected_transfers.h pg_lookup_expected_transfers.c \ - pg_lookup_instance_auth.h pg_lookup_instance_auth.c \ - pg_lookup_instances.h pg_lookup_instances.c \ - pg_lookup_inventory_products.h pg_lookup_inventory_products.c \ - pg_lookup_inventory_products_filtered.h pg_lookup_inventory_products_filtered.c \ - pg_lookup_login_tokens.h pg_lookup_login_tokens.c \ - pg_lookup_order.h pg_lookup_order.c \ - pg_lookup_order_by_fulfillment.h pg_lookup_order_by_fulfillment.c \ - pg_lookup_order_status.h pg_lookup_order_status.c \ - pg_lookup_order_status_by_serial.h pg_lookup_order_status_by_serial.c \ - pg_lookup_order_summary.h pg_lookup_order_summary.c \ - pg_lookup_orders.h pg_lookup_orders.c \ - pg_lookup_otp_devices.h pg_lookup_otp_devices.c \ - pg_lookup_pending_deposits.h pg_lookup_pending_deposits.c \ - pg_lookup_pending_webhooks.h pg_lookup_pending_webhooks.c \ - pg_lookup_product.h pg_lookup_product.c \ - pg_lookup_product_image.h pg_lookup_product_image.c \ - pg_lookup_products.h pg_lookup_products.c \ - pg_lookup_refund_proof.h pg_lookup_refund_proof.c \ - pg_lookup_refunds.h pg_lookup_refunds.c \ - pg_lookup_refunds_detailed.h pg_lookup_refunds_detailed.c \ - pg_lookup_spent_tokens_by_order.h pg_lookup_spent_tokens_by_order.c \ - pg_lookup_statistics_amount_by_bucket2.h pg_lookup_statistics_amount_by_bucket2.c \ - pg_lookup_statistics_counter_by_bucket2.h pg_lookup_statistics_counter_by_bucket2.c \ - pg_lookup_template.h pg_lookup_template.c \ - pg_lookup_templates.h pg_lookup_templates.c \ - pg_lookup_token_families.h pg_lookup_token_families.c \ - pg_lookup_token_family.h pg_lookup_token_family.c \ - pg_lookup_token_family_key.h pg_lookup_token_family_key.c \ - pg_lookup_token_family_keys.h pg_lookup_token_family_keys.c \ - pg_lookup_transfer_details.h pg_lookup_transfer_details.c \ - pg_lookup_transfer_details_by_order.h pg_lookup_transfer_details_by_order.c \ - pg_lookup_transfer_summary.h pg_lookup_transfer_summary.c \ - pg_lookup_transfers.h pg_lookup_transfers.c \ - pg_lookup_webhook.h pg_lookup_webhook.c \ - pg_lookup_webhook_by_event.h pg_lookup_webhook_by_event.c \ - pg_lookup_webhooks.h pg_lookup_webhooks.c \ - pg_lookup_wire_fee.h pg_lookup_wire_fee.c \ - pg_mark_contract_paid.h pg_mark_contract_paid.c \ - pg_mark_order_wired.h pg_mark_order_wired.c \ - pg_select_order_blinded_sigs.h pg_select_order_blinded_sigs.c \ - pg_purge_instance.h pg_purge_instance.c \ - pg_refund_coin.h pg_refund_coin.c \ - pg_select_account.h pg_select_account.c \ - pg_select_account_by_uri.h pg_select_account_by_uri.c \ - pg_select_accounts.h pg_select_accounts.c \ - pg_select_accounts_by_exchange.h pg_select_accounts_by_exchange.c \ - pg_select_category.h pg_select_category.c \ - pg_select_category_by_name.h pg_select_category_by_name.c \ - pg_select_exchange_keys.h pg_select_exchange_keys.c \ - pg_select_exchanges.h pg_select_exchanges.c \ - pg_select_login_token.h pg_select_login_token.c \ - pg_select_open_transfers.h pg_select_open_transfers.c \ - pg_select_otp.h pg_select_otp.c \ - pg_select_otp_serial.h pg_select_otp_serial.c \ - pg_select_wirewatch_accounts.h pg_select_wirewatch_accounts.c \ - pg_store_wire_fee_by_exchange.h pg_store_wire_fee_by_exchange.c \ - pg_unlock_inventory.h pg_unlock_inventory.c \ - pg_update_account.h pg_update_account.c \ - pg_update_category.h pg_update_category.c \ - pg_update_contract_session.h pg_update_contract_session.c \ - pg_update_contract_terms.h pg_update_contract_terms.c \ - pg_update_deposit_confirmation_status.h pg_update_deposit_confirmation_status.c \ - pg_update_donau_instance_receipts_amount.h pg_update_donau_instance_receipts_amount.c \ - pg_update_instance.h pg_update_instance.c \ - pg_update_instance_auth.h pg_update_instance_auth.c \ - pg_update_otp.h pg_update_otp.c \ - pg_update_pending_webhook.h pg_update_pending_webhook.c \ - pg_update_product.h pg_update_product.c \ - pg_update_template.h pg_update_template.c \ - pg_update_token_family.h pg_update_token_family.c \ - pg_update_transfer_status.h pg_update_transfer_status.c \ - pg_finalize_transfer_status.h pg_finalize_transfer_status.c \ - pg_delete_donau_instance.h pg_delete_donau_instance.c \ - pg_insert_order_blinded_sigs.h pg_insert_order_blinded_sigs.c \ - pg_update_webhook.h pg_update_webhook.c \ - pg_update_wirewatch_progress.h pg_update_wirewatch_progress.c \ - pg_lookup_statistics_counter_by_bucket.h pg_lookup_statistics_counter_by_bucket.c \ - pg_lookup_statistics_counter_by_interval.h pg_lookup_statistics_counter_by_interval.c \ - pg_lookup_statistics_amount_by_bucket.h pg_lookup_statistics_amount_by_bucket.c \ - pg_lookup_statistics_amount_by_interval.h pg_lookup_statistics_amount_by_interval.c \ - plugin_merchantdb_postgres.c \ - pg_insert_donau_instance.h pg_insert_donau_instance.c \ - pg_check_donau_instance.h pg_check_donau_instance.c \ - pg_select_donau_instances.h pg_select_donau_instances.c \ - pg_select_all_donau_instances.h pg_select_all_donau_instances.c \ - pg_select_donau_instances_filtered.h pg_select_donau_instances_filtered.c \ - pg_select_donau_instance_by_serial.h pg_select_donau_instance_by_serial.c \ - pg_lookup_donau_keys.h pg_lookup_donau_keys.c \ - pg_lookup_order_charity.h pg_lookup_order_charity.c \ - pg_upsert_donau_keys.h pg_upsert_donau_keys.c \ - pg_update_donau_instance.h pg_update_donau_instance.c - -libtaler_plugin_merchantdb_postgres_la_LIBADD = \ - $(LTLIBINTL) -libtaler_plugin_merchantdb_postgres_la_LDFLAGS = \ - $(TALER_PLUGIN_LDFLAGS) \ - $(top_builddir)/src/util/libtalermerchantutil.la \ - -ldonau \ - -ltalerexchange \ - -ltalerpq \ - -ltalerutil \ - -ltalerjson \ - -ltalermhd \ - -lgnunetpq \ - -lgnunetjson \ - -lpq \ - -lgnunetutil \ - $(XLIB) - -if HAVE_POSTGRESQL -if HAVE_GNUNETPQ -check_PROGRAMS = \ - test-merchantdb-postgres -endif -endif - -test_merchantdb_postgres_SOURCES = \ - test_merchantdb.c - -test_merchantdb_postgres_LDFLAGS = \ - -ltalerutil \ - -ltalerjson \ - -lgnunetjson \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -check_SCRIPTS = \ - test_webhook_trigger.sh - -test_merchantdb_postgres_LDADD = \ - $(top_builddir)/src/util/libtalermerchantutil.la \ - $(top_builddir)/src/backenddb/libtalermerchantdb.la - -AM_TESTS_ENVIRONMENT=export TALER_MERCHANT_PREFIX=$${TALER_MERCHANT_PREFIX:-@libdir@};export PATH=$${TALER_MERCHANT_PREFIX:-@prefix@}/bin:$$PATH; - -TESTS = \ - $(check_PROGRAMS) \ - $(check_SCRIPTS) - -EXTRA_DIST = \ - test-merchantdb-postgres.conf \ - merchantdb-postgres.conf \ - $(sqlinputs) \ - $(sql_DATA) \ - $(check_SCRIPTS) diff --git a/src/backenddb/Makefile.sql b/src/backenddb/Makefile.sql @@ -0,0 +1,11 @@ +procedures.sql: procedures.sql.in pg_*.sql + gcc -E -P -undef - < procedures.sql.in 2>/dev/null | sed -e "s/--.*//" | awk 'NF' - >$@ + + +CLEANFILES = \ + procedures.sql + +all: ${CLEANFILES} + +clean: + rm ${CLEANFILES} diff --git a/src/backenddb/meson.build b/src/backenddb/meson.build @@ -0,0 +1,330 @@ +# This build file is in the public domain + +install_data('merchantdb-postgres.conf', install_dir: pkgcfgdir) + + +sqldir = get_option('datadir') / 'taler-merchant' / 'sql' +plugindir = get_option('libdir') / 'taler-merchant' + +# FIXME possibly provide this output in the tgz through dist script +run_command('make', '-f', 'Makefile.sql', 'all', check: true) + +sqlfiles = [ + 'versioning.sql', + 'procedures.sql', + 'merchant-0001.sql', + 'merchant-0002.sql', + 'merchant-0003.sql', + 'merchant-0004.sql', + 'merchant-0005.sql', + 'merchant-0006.sql', + 'merchant-0007.sql', + 'merchant-0008.sql', + 'merchant-0009.sql', + 'merchant-0010.sql', + 'merchant-0011.sql', + 'merchant-0012.sql', + 'merchant-0013.sql', + 'merchant-0014.sql', + 'merchant-0015.sql', + 'merchant-0016.sql', + 'merchant-0017.sql', + 'merchant-0018.sql', + 'merchant-0019.sql', + 'merchant-0020.sql', + 'merchant-0021.sql', + 'merchant-0022.sql', + 'merchant-0023.sql', + 'merchant-0024.sql', + 'merchant-0025.sql', + 'merchant-0026.sql', + 'merchant-0027.sql', + 'merchant-0028.sql', + 'merchant-0029.sql', + 'merchant-0030.sql', + 'merchant-0031.sql', + 'merchant-0032.sql', + 'merchant-0033.sql', + 'merchant-0034.sql', + 'drop.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 + +if pq_dep.found() and gnunetpq_dep.found() + libtaler_plugin_merchantdb_postgres_SOURCES = [ + 'pg_account_kyc_get_outdated.c', + 'pg_account_kyc_get_status.c', + 'pg_account_kyc_set_failed.c', + 'pg_account_kyc_set_status.c', + 'pg_activate_account.c', + 'pg_check_transfer_exists.c', + 'pg_delete_category.c', + 'pg_delete_contract_terms.c', + 'pg_delete_exchange_accounts.c', + 'pg_delete_instance_private_key.c', + 'pg_delete_login_token.c', + 'pg_delete_order.c', + 'pg_delete_otp.c', + 'pg_delete_pending_webhook.c', + 'pg_delete_product.c', + 'pg_delete_template.c', + 'pg_delete_token_family.c', + 'pg_delete_transfer.c', + 'pg_delete_webhook.c', + 'pg_expire_locks.c', + 'pg_gc.c', + 'pg_get_kyc_limits.c', + 'pg_get_kyc_status.c', + 'pg_helper.c', + 'pg_inactivate_account.c', + 'pg_increase_refund.c', + 'pg_increment_money_pots.c', + 'pg_insert_account.c', + 'pg_insert_category.c', + 'pg_insert_unit.c', + 'pg_insert_contract_terms.c', + 'pg_insert_deposit.c', + 'pg_insert_deposit_confirmation.c', + 'pg_insert_deposit_to_transfer.c', + 'pg_insert_exchange_account.c', + 'pg_insert_exchange_keys.c', + 'pg_insert_exchange_signkey.c', + 'pg_insert_instance.c', + 'pg_insert_issued_token.c', + 'pg_insert_login_token.c', + 'pg_insert_order.c', + 'pg_insert_order_lock.c', + 'pg_insert_otp.c', + 'pg_insert_pending_webhook.c', + 'pg_insert_product.c', + 'pg_insert_refund_proof.c', + 'pg_insert_spent_token.c', + 'pg_insert_template.c', + 'pg_update_unit.c', + 'pg_insert_token_family.c', + 'pg_insert_token_family_key.c', + 'pg_insert_transfer.c', + 'pg_insert_transfer_details.c', + 'pg_insert_webhook.c', + 'pg_delete_unit.c', + 'pg_lookup_units.c', + 'pg_lookup_custom_units_by_names.c', + 'pg_select_unit.c', + 'pg_lookup_mfa_challenge.c', + 'pg_solve_mfa_challenge.c', + 'pg_update_mfa_challenge.c', + 'pg_create_mfa_challenge.c', + 'pg_insert_report.c', + 'pg_delete_report.c', + 'pg_update_report.c', + 'pg_check_report.c', + 'pg_select_reports.c', + 'pg_lookup_reports_pending.c', + 'pg_update_report_status.c', + 'pg_select_report.c', + 'pg_insert_product_group.c', + 'pg_delete_product_group.c', + 'pg_update_product_group.c', + 'pg_select_product_groups.c', + 'pg_insert_unclaim_signature.c', + 'pg_lookup_reconciliation_details.c', + 'pg_lookup_expected_transfer.c', + 'pg_insert_money_pot.c', + 'pg_delete_money_pot.c', + 'pg_update_money_pot.c', + 'pg_check_money_pots.c', + 'pg_select_money_pots.c', + 'pg_select_money_pot.c', + 'pg_lock_product.c', + 'pg_lookup_account.c', + 'pg_lookup_all_products.c', + 'pg_lookup_categories.c', + 'pg_lookup_categories_by_ids.c', + 'pg_lookup_contract_terms.c', + 'pg_lookup_contract_terms2.c', + 'pg_lookup_contract_terms3.c', + 'pg_lookup_deposits.c', + 'pg_lookup_deposits_by_contract_and_coin.c', + 'pg_lookup_deposits_by_order.c', + 'pg_lookup_expected_transfers.c', + 'pg_lookup_instance_auth.c', + 'pg_lookup_instances.c', + 'pg_lookup_inventory_products.c', + 'pg_lookup_inventory_products_filtered.c', + 'pg_lookup_login_tokens.c', + 'pg_lookup_order.c', + 'pg_lookup_order_by_fulfillment.c', + 'pg_lookup_order_status.c', + 'pg_lookup_order_status_by_serial.c', + 'pg_lookup_order_summary.c', + 'pg_lookup_orders.c', + 'pg_lookup_otp_devices.c', + 'pg_lookup_pending_deposits.c', + 'pg_lookup_pending_webhooks.c', + 'pg_lookup_product.c', + 'pg_lookup_product_image.c', + 'pg_lookup_products.c', + 'pg_lookup_refund_proof.c', + 'pg_lookup_refunds.c', + 'pg_lookup_refunds_detailed.c', + 'pg_lookup_spent_tokens_by_order.c', + 'pg_lookup_statistics_amount_by_bucket2.c', + 'pg_lookup_statistics_counter_by_bucket2.c', + 'pg_lookup_template.c', + 'pg_lookup_templates.c', + 'pg_lookup_token_families.c', + 'pg_lookup_token_family.c', + 'pg_lookup_token_family_key.c', + 'pg_lookup_token_family_keys.c', + 'pg_lookup_transfer_details.c', + 'pg_lookup_transfer_details_by_order.c', + 'pg_lookup_transfer_summary.c', + 'pg_lookup_transfers.c', + 'pg_lookup_webhook.c', + 'pg_lookup_webhook_by_event.c', + 'pg_lookup_webhooks.c', + 'pg_lookup_wire_fee.c', + 'pg_mark_contract_paid.c', + 'pg_mark_order_wired.c', + 'pg_select_order_blinded_sigs.c', + 'pg_purge_instance.c', + 'pg_refund_coin.c', + 'pg_select_account.c', + 'pg_select_account_by_uri.c', + 'pg_select_accounts.c', + 'pg_select_accounts_by_exchange.c', + 'pg_select_category.c', + 'pg_select_category_by_name.c', + 'pg_select_exchange_keys.c', + 'pg_select_exchanges.c', + 'pg_select_login_token.c', + 'pg_select_open_transfers.c', + 'pg_select_otp.c', + 'pg_select_otp_serial.c', + 'pg_select_wirewatch_accounts.c', + 'pg_store_wire_fee_by_exchange.c', + 'pg_unlock_inventory.c', + 'pg_update_account.c', + 'pg_update_category.c', + 'pg_update_contract_session.c', + 'pg_update_contract_terms.c', + 'pg_update_deposit_confirmation_status.c', + 'pg_update_donau_instance_receipts_amount.c', + 'pg_update_instance.c', + 'pg_update_instance_auth.c', + 'pg_update_otp.c', + 'pg_update_pending_webhook.c', + 'pg_update_product.c', + 'pg_update_template.c', + 'pg_update_token_family.c', + 'pg_update_transfer_status.c', + 'pg_finalize_transfer_status.c', + 'pg_delete_donau_instance.c', + 'pg_insert_order_blinded_sigs.c', + 'pg_update_webhook.c', + 'pg_update_wirewatch_progress.c', + 'pg_lookup_statistics_counter_by_bucket.c', + 'pg_lookup_statistics_counter_by_interval.c', + 'pg_lookup_statistics_amount_by_bucket.c', + 'pg_lookup_statistics_amount_by_interval.c', + 'plugin_merchantdb_postgres.c', + 'pg_insert_donau_instance.c', + 'pg_check_donau_instance.c', + 'pg_select_donau_instances.c', + 'pg_select_all_donau_instances.c', + 'pg_select_donau_instances_filtered.c', + 'pg_select_donau_instance_by_serial.c', + 'pg_lookup_donau_keys.c', + 'pg_lookup_order_charity.c', + 'pg_upsert_donau_keys.c', + 'pg_update_donau_instance.c', + ] + + shared_module( + 'taler_plugin_merchantdb_postgres', + libtaler_plugin_merchantdb_postgres_SOURCES, + install_rpath: rpath_option, + dependencies: [ + libtalermerchantutil_dep, + donau_dep, + talerexchange_dep, + talerutil_dep, + talerpq_dep, + talerjson_dep, + talermhd_dep, + gnunetpq_dep, + gnunetutil_dep, + gnunetjson_dep, + pq_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: plugindir, + ) + +endif + +libtalermerchantdb = library( + 'talermerchantdb', + ['merchantdb_helper.c', 'merchantdb_plugin.c'], + soversion: solibversions['libtalermerchantdb']['soversion'], + version: solibversions['libtalermerchantdb']['soversion'], + install_rpath: rpath_option, + dependencies: [ + libtalermerchantutil_dep, + talerpq_dep, + talerutil_dep, + gnunetutil_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalermerchantdb_dep = declare_dependency(link_with: libtalermerchantdb) +pkg.generate( + libtalermerchantdb, + url: 'https://taler.net', + description: 'GNU Taler merchant DB library', +) + + +if pq_dep.found() and gnunetpq_dep.found() + test_mdb_postgres = executable( + 'test-merchantdb-postgres', + ['test_merchantdb.c'], + install_rpath: rpath_option, + dependencies: [ + libtalermerchantdb_dep, + libtalermerchantutil_dep, + talerutil_dep, + talerjson_dep, + gnunetutil_dep, + gnunetjson_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: false, + ) + test( + 'test-merchantdb-postgres', + test_mdb_postgres, + workdir: meson.current_build_dir(), + suite: ['backenddb', 'installcheck'], + is_parallel: false, + ) +endif + +configure_file( + input: 'test-merchantdb-postgres.conf', + output: 'test-merchantdb-postgres.conf', + copy: true, +) diff --git a/src/bank/Makefile.am b/src/bank/Makefile.am @@ -1,28 +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 = \ - libtalermerchantbank.la - -libtalermerchantbank_la_LDFLAGS = \ - -version-info 0:1:0 \ - -no-undefined -libtalermerchantbank_la_SOURCES = \ - mb_common.c mb_common.h \ - mb_credit.c \ - mb_parse.c -libtalermerchantbank_la_LIBADD = \ - -ltalerjson \ - -ltalercurl \ - -ltalerutil \ - -lgnunetcurl \ - -lgnunetjson \ - -lgnunetutil \ - -ljansson \ - -lcurl \ - $(XLIB) diff --git a/src/bank/meson.build b/src/bank/meson.build @@ -0,0 +1,29 @@ +# This build file is in the public domain + +libtalermerchantbank = library( + 'talermerchantbank', + ['mb_common.c', 'mb_credit.c', 'mb_parse.c'], + soversion: solibversions['libtalermerchantbank']['soversion'], + version: solibversions['libtalermerchantbank']['soversion'], + install_rpath: rpath_option, + dependencies: [ + gnunetutil_dep, + gnunetcurl_dep, + gnunetjson_dep, + talerutil_dep, + talerjson_dep, + talercurl_dep, + json_dep, + curl_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalermerchantbank_dep = declare_dependency(link_with: libtalermerchantbank) +pkg.generate( + libtalermerchantbank, + url: 'https://taler.net', + description: 'GNU Taler bank utilities library', +) diff --git a/src/include/Makefile.am b/src/include/Makefile.am @@ -1,2 +0,0 @@ -# This Makefile.am is in the public domain -SUBDIRS = taler . diff --git a/src/include/meson.build b/src/include/meson.build @@ -0,0 +1,2 @@ +# This build file is in the public domain +subdir('taler') diff --git a/src/include/taler/Makefile.am b/src/include/taler/Makefile.am @@ -1,15 +0,0 @@ -# This Makefile.am is in the public domain -SUBDIRS = merchant . -EXTRA_DIST = \ - platform.h - -talerincludedir = $(includedir)/taler - -talerinclude_HEADERS = \ - taler_merchant_bank_lib.h \ - taler_merchantdb_lib.h \ - taler_merchantdb_plugin.h \ - taler_merchant_util.h \ - taler_merchant_service.h \ - taler_merchant_pay_service.h \ - taler_merchant_testing_lib.h diff --git a/src/include/taler/merchant/Makefile.am b/src/include/taler/merchant/Makefile.am @@ -1,74 +0,0 @@ -# This Makefile.am is in the public domain -SUBDIRS = . -talermerchantincludedir = $(includedir)/taler/merchant - -talermerchantinclude_HEADERS = \ - common.h \ - delete-management-instances-INSTANCE.h \ - delete-private-accounts-H_WIRE.h \ - delete-private-donau-DONAU_SERIAL.h \ - delete-private-orders-ORDER_ID.h \ - delete-private-otp-devices-DEVICE_ID.h \ - delete-private-products-PRODUCT_ID.h \ - delete-private-templates-TEMPLATE_ID.h \ - delete-private-token.h \ - delete-private-tokens-SERIAL.h \ - delete-private-transfers-TID.h \ - delete-private-units-UNIT.h \ - delete-private-webhooks-WEBHOOK_ID.h \ - get-config.h \ - get-management-instances.h \ - get-management-instances-INSTANCE.h \ - get-private-kyc.h \ - get-private-statistics-amount-SLUG.h \ - get-private-statistics-counter-SLUG.h \ - get-orders-ORDER_ID.h \ - get-private-accounts.h \ - get-private-accounts-H_WIRE.h \ - get-private-donau.h \ - get-private-orders.h \ - get-private-orders-ORDER_ID.h \ - get-private-otp-devices.h \ - get-private-otp-devices-DEVICE_ID.h \ - get-private-products.h \ - get-private-products-PRODUCT_ID.h \ - get-private-templates.h \ - get-private-templates-TEMPLATE_ID.h \ - get-private-tokenfamilies-TOKEN_FAMILY_SLUG.h \ - get-private-transfers.h \ - get-private-units.h \ - get-private-units-UNIT.h \ - get-private-webhooks.h \ - get-private-webhooks-WEBHOOK_ID.h \ - get-products-IMAGE_HASH-image.h \ - get-templates-TEMPLATE_ID.h \ - patch-management-instances-INSTANCE.h \ - patch-private-accounts-H_WIRE.h \ - patch-private-otp-devices-DEVICE_ID.h \ - patch-private-orders-ORDER_ID-forget.h \ - patch-private-products-PRODUCT_ID.h \ - patch-private-templates-TEMPLATE_ID.h \ - patch-private-units-UNIT.h \ - patch-private-webhooks-WEBHOOK_ID.h \ - post-management-instances.h \ - post-management-instances-INSTANCE-auth.h \ - post-orders-ORDER_ID-abort.h \ - post-orders-ORDER_ID-claim.h \ - post-orders-ORDER_ID-paid.h \ - post-orders-ORDER_ID-pay.h \ - post-orders-ORDER_ID-refund.h \ - post-private-accounts.h \ - post-private-categories.h \ - post-private-donau.h \ - post-private-orders.h \ - post-private-orders-ORDER_ID-refund.h \ - post-private-otp-devices.h \ - post-private-products.h \ - post-private-products-PRODUCT_ID-lock.h \ - post-private-templates.h \ - post-private-tokenfamilies.h \ - post-private-token.h \ - post-private-transfers.h \ - post-private-units.h \ - post-private-webhooks.h \ - post-templates-TEMPLATE_ID.h diff --git a/src/include/taler/merchant/meson.build b/src/include/taler/merchant/meson.build @@ -0,0 +1,84 @@ +# This Makefile.am is in the public domain + +talermerchantinclude_HEADERS = [ + 'common.h', + 'delete-management-instances-INSTANCE.h', + 'delete-private-accounts-H_WIRE.h', + 'delete-private-donau-DONAU_SERIAL.h', + 'delete-private-orders-ORDER_ID.h', + 'delete-private-otp-devices-DEVICE_ID.h', + 'delete-private-products-PRODUCT_ID.h', + 'delete-private-templates-TEMPLATE_ID.h', + 'delete-private-token.h', + 'delete-private-tokens-SERIAL.h', + 'delete-private-transfers-TID.h', + 'delete-private-units-UNIT.h', + 'delete-private-webhooks-WEBHOOK_ID.h', + 'get-config.h', + 'get-management-instances.h', + 'get-management-instances-INSTANCE.h', + 'get-private-kyc.h', + 'get-private-statistics-amount-SLUG.h', + 'get-private-statistics-counter-SLUG.h', + 'get-orders-ORDER_ID.h', + 'get-private-accounts.h', + 'get-private-accounts-H_WIRE.h', + 'get-private-donau.h', + 'get-private-orders.h', + 'get-private-orders-ORDER_ID.h', + 'get-private-otp-devices.h', + 'get-private-otp-devices-DEVICE_ID.h', + 'get-private-products.h', + 'get-private-products-PRODUCT_ID.h', + 'get-private-templates.h', + 'get-private-templates-TEMPLATE_ID.h', + 'get-private-tokenfamilies-TOKEN_FAMILY_SLUG.h', + 'get-private-transfers.h', + 'get-private-units.h', + 'get-private-units-UNIT.h', + 'get-private-webhooks.h', + 'get-private-webhooks-WEBHOOK_ID.h', + 'get-products-IMAGE_HASH-image.h', + 'get-templates-TEMPLATE_ID.h', + 'patch-management-instances-INSTANCE.h', + 'patch-private-accounts-H_WIRE.h', + 'patch-private-otp-devices-DEVICE_ID.h', + 'patch-private-orders-ORDER_ID-forget.h', + 'patch-private-products-PRODUCT_ID.h', + 'patch-private-templates-TEMPLATE_ID.h', + 'patch-private-units-UNIT.h', + 'patch-private-webhooks-WEBHOOK_ID.h', + 'post-management-instances.h', + 'post-management-instances-INSTANCE-auth.h', + 'post-orders-ORDER_ID-abort.h', + 'post-orders-ORDER_ID-claim.h', + 'post-orders-ORDER_ID-paid.h', + 'post-orders-ORDER_ID-pay.h', + 'post-orders-ORDER_ID-refund.h', + 'post-private-accounts.h', + 'post-private-categories.h', + 'post-private-donau.h', + 'post-private-orders.h', + 'post-private-orders-ORDER_ID-refund.h', + 'post-private-otp-devices.h', + 'post-private-products.h', + 'post-private-products-PRODUCT_ID-lock.h', + 'post-private-templates.h', + 'post-private-tokenfamilies.h', + 'post-private-token.h', + 'post-private-transfers.h', + 'post-private-units.h', + 'post-private-webhooks.h', + 'post-templates-TEMPLATE_ID.h', +] + +foreach h : talermerchantinclude_HEADERS + + install_headers( + h, + install_dir: get_option('includedir') / 'taler' / 'taler-merchant', + ) + +endforeach + + diff --git a/src/include/taler/meson.build b/src/include/taler/meson.build @@ -0,0 +1,20 @@ +# This build file is in the public domain +subdir('taler-merchant') + +talerinclude_HEADERS = [ + 'taler_merchant_bank_lib.h', + 'taler_merchantdb_lib.h', + 'taler_merchantdb_plugin.h', + 'taler_merchant_util.h', + 'taler_merchant_service.h', + 'taler_merchant_pay_service.h', + 'taler_merchant_testing_lib.h', +] + +foreach h : talerinclude_HEADERS + + install_headers(h, install_dir: get_option('includedir') / 'taler') + +endforeach + + diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am @@ -1,114 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/backend - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - -lib_LTLIBRARIES = \ - libtalermerchant.la - -libtalermerchant_la_LDFLAGS = \ - -version-info 9:0:1 \ - -no-undefined - -libtalermerchant_la_SOURCES = \ - merchant_api_curl_defaults.c merchant_api_curl_defaults.h \ - merchant_api_common.c merchant_api_common.h \ - merchant_api_common_mfa_challenge.c \ - merchant_api_delete-management-instances-INSTANCE.c \ - merchant_api_delete-private-accounts-H_WIRE.c \ - merchant_api_delete-private-orders-ORDER_ID.c \ - merchant_api_delete-private-otp-devices-DEVICE_ID.c \ - merchant_api_delete-private-products-PRODUCT_ID.c \ - merchant_api_delete-private-templates-TEMPLATE_ID.c \ - merchant_api_delete-private-token.c \ - merchant_api_delete-private-tokens-SERIAL.c \ - merchant_api_delete-private-transfers-TID.c \ - merchant_api_delete-private-units-UNIT.c \ - merchant_api_delete-private-webhooks-WEBHOOK_ID.c \ - merchant_api_get-config.c \ - merchant_api_get-management-instances.c \ - merchant_api_get-management-instances-INSTANCE.c \ - merchant_api_get-orders-ORDER_ID.c \ - merchant_api_get-private-accounts.c \ - merchant_api_get-private-accounts-H_WIRE.c \ - merchant_api_get-private-kyc.c \ - merchant_api_get-private-orders.c \ - merchant_api_get-private-orders-ORDER_ID.c \ - merchant_api_get-private-otp-devices.c \ - merchant_api_get-private-otp-devices-DEVICE_ID.c \ - merchant_api_get-private-products.c \ - merchant_api_get-private-products-PRODUCT_ID.c \ - merchant_api_get-private-statistics-amount-SLUG.c \ - merchant_api_get-private-statistics-counter-SLUG.c \ - merchant_api_get-private-templates.c \ - merchant_api_get-private-templates-TEMPLATE_ID.c \ - merchant_api_get-private-tokenfamilies-TOKEN_FAMILY_SLUG.c \ - merchant_api_get-private-transfers.c \ - merchant_api_get-private-units.c \ - merchant_api_get-private-units-UNIT.c \ - merchant_api_get-private-webhooks.c \ - merchant_api_get-private-webhooks-WEBHOOK_ID.c \ - merchant_api_get-products-IMAGE_HASH-image.c \ - merchant_api_get-templates-TEMPLATE_ID.c \ - merchant_api_patch-management-instances-INSTANCE.c \ - merchant_api_patch-private-accounts-H_WIRE.c \ - merchant_api_patch-private-orders-ORDER_ID-forget.c \ - merchant_api_patch-private-otp-devices-DEVICE_ID.c \ - merchant_api_patch-private-products-PRODUCT_ID.c \ - merchant_api_patch-private-templates-TEMPLATE_ID.c \ - merchant_api_patch-private-units-UNIT.c \ - merchant_api_patch-private-webhooks-WEBHOOK_ID.c \ - merchant_api_post-management-instances.c \ - merchant_api_post-management-instances-INSTANCE-auth.c \ - merchant_api_post-orders-ORDER_ID-abort.c \ - merchant_api_post-orders-ORDER_ID-claim.c \ - merchant_api_post-orders-ORDER_ID-paid.c \ - merchant_api_post-orders-ORDER_ID-pay.c \ - merchant_api_post-orders-ORDER_ID-refund.c \ - merchant_api_post-private-accounts.c \ - merchant_api_post-private-categories.c \ - merchant_api_post-private-orders.c \ - merchant_api_post-private-orders-ORDER_ID-refund.c \ - merchant_api_post-private-otp-devices.c \ - merchant_api_post-private-products.c \ - merchant_api_post-private-products-PRODUCT_ID-lock.c \ - merchant_api_post-private-templates.c \ - merchant_api_post-private-token.c \ - merchant_api_post-private-tokenfamilies.c \ - merchant_api_post-private-transfers.c \ - merchant_api_post-private-units.c \ - merchant_api_post-private-webhooks.c \ - merchant_api_get-private-donau.c \ - merchant_api_post-private-donau.c \ - merchant_api_delete-private-donau-DONAU_SERIAL.c \ - merchant_api_post-templates-TEMPLATE_ID.c - -libtalermerchant_la_LIBADD = \ - -ldonaujson \ - -ldonau \ - -ltalerexchange \ - -ltalercurl \ - -ltalerjson \ - -ltalerkyclogic \ - -ltalerutil \ - -lgnunetcurl \ - -lgnunetjson \ - -lgnunetutil \ - -ljansson \ - -lcurl \ - $(XLIB) - -check_PROGRAMS = \ - test_merchant_api_common - -TESTS = \ - $(check_PROGRAMS) - -test_merchant_api_common_SOURCES = \ - test_merchant_api_common.c -test_merchant_api_common_LDADD = \ - $(top_srcdir)/src/lib/libtalermerchant.la \ - -lgnunetutil diff --git a/src/lib/meson.build b/src/lib/meson.build @@ -0,0 +1,152 @@ +# This build file is in the public domain + +libtalermerchant_la_SOURCES = [ + 'merchant_api_curl_defaults.c', + 'merchant_api_common.c', + 'merchant_api_common_mfa_challenge.c', + 'merchant_api_delete-management-instances-INSTANCE.c', + 'merchant_api_delete-private-accounts-H_WIRE.c', + 'merchant_api_delete-private-orders-ORDER_ID.c', + 'merchant_api_delete-private-otp-devices-DEVICE_ID.c', + 'merchant_api_delete-private-products-PRODUCT_ID.c', + 'merchant_api_delete-private-templates-TEMPLATE_ID.c', + 'merchant_api_delete-private-token.c', + 'merchant_api_delete-private-tokens-SERIAL.c', + 'merchant_api_delete-private-transfers-TID.c', + 'merchant_api_delete-private-units-UNIT.c', + 'merchant_api_delete-private-webhooks-WEBHOOK_ID.c', + 'merchant_api_get-config.c', + 'merchant_api_get-management-instances.c', + 'merchant_api_get-management-instances-INSTANCE.c', + 'merchant_api_get-orders-ORDER_ID.c', + 'merchant_api_get-private-accounts.c', + 'merchant_api_get-private-accounts-H_WIRE.c', + 'merchant_api_get-private-kyc.c', + 'merchant_api_get-private-orders.c', + 'merchant_api_get-private-orders-ORDER_ID.c', + 'merchant_api_get-private-otp-devices.c', + 'merchant_api_get-private-otp-devices-DEVICE_ID.c', + 'merchant_api_get-private-products.c', + 'merchant_api_get-private-products-PRODUCT_ID.c', + 'merchant_api_get-private-statistics-amount-SLUG.c', + 'merchant_api_get-private-statistics-counter-SLUG.c', + 'merchant_api_get-private-templates.c', + 'merchant_api_get-private-templates-TEMPLATE_ID.c', + 'merchant_api_get-private-tokenfamilies-TOKEN_FAMILY_SLUG.c', + 'merchant_api_get-private-transfers.c', + 'merchant_api_get-private-units.c', + 'merchant_api_get-private-units-UNIT.c', + 'merchant_api_get-private-webhooks.c', + 'merchant_api_get-private-webhooks-WEBHOOK_ID.c', + 'merchant_api_get-products-IMAGE_HASH-image.c', + 'merchant_api_get-templates-TEMPLATE_ID.c', + 'merchant_api_patch-management-instances-INSTANCE.c', + 'merchant_api_patch-private-accounts-H_WIRE.c', + 'merchant_api_patch-private-orders-ORDER_ID-forget.c', + 'merchant_api_patch-private-otp-devices-DEVICE_ID.c', + 'merchant_api_patch-private-products-PRODUCT_ID.c', + 'merchant_api_patch-private-templates-TEMPLATE_ID.c', + 'merchant_api_patch-private-units-UNIT.c', + 'merchant_api_patch-private-webhooks-WEBHOOK_ID.c', + 'merchant_api_post-management-instances.c', + 'merchant_api_post-management-instances-INSTANCE-auth.c', + 'merchant_api_post-orders-ORDER_ID-abort.c', + 'merchant_api_post-orders-ORDER_ID-claim.c', + 'merchant_api_post-orders-ORDER_ID-paid.c', + 'merchant_api_post-orders-ORDER_ID-pay.c', + 'merchant_api_post-orders-ORDER_ID-refund.c', + 'merchant_api_post-private-accounts.c', + 'merchant_api_post-private-categories.c', + 'merchant_api_post-private-orders.c', + 'merchant_api_post-private-orders-ORDER_ID-refund.c', + 'merchant_api_post-private-otp-devices.c', + 'merchant_api_post-private-products.c', + 'merchant_api_post-private-products-PRODUCT_ID-lock.c', + 'merchant_api_post-private-templates.c', + 'merchant_api_post-private-token.c', + 'merchant_api_post-private-tokenfamilies.c', + 'merchant_api_post-private-transfers.c', + 'merchant_api_post-private-units.c', + 'merchant_api_post-private-webhooks.c', + 'merchant_api_get-private-donau.c', + 'merchant_api_post-private-donau.c', + 'merchant_api_delete-private-donau-DONAU_SERIAL.c', + 'merchant_api_post-templates-TEMPLATE_ID.c', +] + +libtalermerchant = library( + 'talermerchant', + libtalermerchant_la_SOURCES, + soversion: solibversions['libtalermerchant']['soversion'], + version: solibversions['libtalermerchant']['soversion'], + install_rpath: rpath_option, + dependencies: [ + donau_dep, + donaujson_dep, + talerexchange_dep, + talercurl_dep, + talerkyclogic_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + talerutil_dep, + talerjson_dep, + json_dep, + curl_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalermerchant_dep = declare_dependency(link_with: libtalermerchant) +pkg.generate( + libtalermerchant, + url: 'https://taler.net', + description: 'GNU Taler merchant utilities library', +) + + +talermerchant_tests = ['test_merchant_api_common'] + +talermerchant_tests_installcheck = [] + +foreach t : talermerchant_tests + + test_tmp = executable( + t, + ['@0@.c'.format(t)], + dependencies: [gnunetutil_dep, libtalermerchant_dep], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + t, + test_tmp, + workdir: meson.current_build_dir(), + suite: ['merchant'], + is_parallel: false, + ) +endforeach + +foreach t : talermerchant_tests_installcheck + + test_tmp = executable( + t, + ['@0@.c'.format(t)], + dependencies: [gnunetutil_dep, libtalermerchant_dep, json_dep], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + t, + test_tmp, + workdir: meson.current_build_dir(), + suite: ['merchant', 'installcheck'], + is_parallel: false, + ) + + +endforeach diff --git a/src/merchant-tools/Makefile.am b/src/merchant-tools/Makefile.am @@ -1,65 +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-merchant-dbinit \ - taler-merchant-passwd \ - taler-merchant-benchmark - -bin_SCRIPTS = \ - taler-merchant-rproxy-setup - -EXTRA_DIST = \ - benchmark-common.conf \ - benchmark-cs.conf \ - benchmark-rsa.conf \ - coins-cs.conf \ - coins-rsa.conf \ - $(bin_SCRIPTS) - -taler_merchant_benchmark_SOURCES = \ - taler-merchant-benchmark.c -taler_merchant_benchmark_LDADD = \ - $(top_srcdir)/src/backenddb/libtalermerchantdb.la \ - $(top_srcdir)/src/lib/libtalermerchant.la \ - $(top_srcdir)/src/testing/libtalermerchanttesting.la \ - $(top_srcdir)/src/util/libtalermerchantutil.la \ - $(LIBGCRYPT_LIBS) \ - -ltalertesting \ - -ltalerfakebank \ - -ltalerbank \ - -ltalerexchange \ - -ltalerjson \ - -ltalerutil \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -taler_merchant_dbinit_SOURCES = \ - taler-merchant-dbinit.c -taler_merchant_dbinit_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/backenddb/libtalermerchantdb.la \ - $(top_srcdir)/src/util/libtalermerchantutil.la \ - -ltalerutil \ - -ltalerpq \ - -lgnunetutil \ - $(XLIB) - -taler_merchant_passwd_SOURCES = \ - taler-merchant-passwd.c -taler_merchant_passwd_LDADD = \ - $(LIBGCRYPT_LIBS) \ - $(top_builddir)/src/backenddb/libtalermerchantdb.la \ - $(top_srcdir)/src/util/libtalermerchantutil.la \ - -ltalerutil \ - -ltalerpq \ - -lgnunetutil \ - $(XLIB) diff --git a/src/merchant-tools/meson.build b/src/merchant-tools/meson.build @@ -0,0 +1,77 @@ +# This build file is in the public domain + +configure_file( + input: 'taler-merchant-rproxy-setup', + output: 'taler-merchant-rproxy-setup', + install: true, + copy: true, + install_dir: get_option('bindir'), +) + +EXTRA_DIST = [ + 'benchmark-common.conf', + 'benchmark-cs.conf', + 'benchmark-rsa.conf', + 'coins-cs.conf', + 'coins-rsa.conf', +] + +foreach f : EXTRA_DIST + configure_file(input: f, output: f, copy: true) +endforeach + +executable( + 'taler-merchant-benchmark', + ['taler-merchant-benchmark.c'], + dependencies: [ + libtalermerchant_dep, + libtalermerchanttesting_dep, + libtalermerchantutil_dep, + libtalermerchantdb_dep, + talerutil_dep, + talertesting_dep, + talerfakebank_dep, + talerbank_dep, + talerexchange_dep, + talerjson_dep, + gnunetjson_dep, + gnunetcurl_dep, + gnunetutil_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + + +executable( + 'taler-merchant-dbinit', + ['taler-merchant-dbinit.c'], + dependencies: [ + libtalermerchantutil_dep, + libtalermerchantdb_dep, + talerutil_dep, + talerpq_dep, + gnunetutil_dep, + gcrypt_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) + +executable( + 'taler-merchant-passwd', + ['taler-merchant-passwd.c'], + dependencies: [ + libtalermerchantutil_dep, + libtalermerchantdb_dep, + talerutil_dep, + talerpq_dep, + gnunetutil_dep, + gcrypt_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, +) diff --git a/src/meson.build b/src/meson.build @@ -0,0 +1,9 @@ +# This build file is in the public domain +subdir('include') +subdir('util') +subdir('bank') +subdir('backenddb') +subdir('backend') +subdir('lib') +subdir('testing') +subdir('merchant-tools') diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am @@ -1,285 +0,0 @@ -# This Makefile.am is in the public domain -AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/backend -I$(top_srcdir)/src/lib - -if USE_COVERAGE - AM_CFLAGS = --coverage -O0 - XLIB = -lgcov -endif - - -check_SCRIPTS = \ - test_merchant_instance_auth.sh \ - test_merchant_instance_creation.sh \ - test_merchant_instance_response.sh \ - test_merchant_instance_purge.sh \ - test_merchant_kyc.sh \ - test_merchant_order_creation.sh \ - test_merchant_order_autocleanup.sh \ - test_merchant_product_creation.sh \ - test_merchant_statistics.sh \ - test_merchant_templates.sh \ - test_merchant_transfer_tracking.sh \ - test-merchant-walletharness.sh \ - test_merchant_wirewatch.sh - -lib_LTLIBRARIES = \ - libtalermerchanttesting.la - -libtalermerchanttesting_la_LDFLAGS = \ - -version-info 4:1:1 \ - -no-undefined - -libtalermerchanttesting_la_SOURCES = \ - testing_api_cmd_config.c \ - testing_api_cmd_abort_order.c \ - testing_api_cmd_claim_order.c \ - testing_api_cmd_depositcheck.c \ - testing_api_cmd_get_instance.c \ - testing_api_cmd_get_instances.c \ - testing_api_cmd_get_orders.c \ - testing_api_cmd_get_otp_device.c \ - testing_api_cmd_get_otp_devices.c \ - testing_api_cmd_get_product.c \ - testing_api_cmd_get_product_image.c \ - testing_api_cmd_get_products.c \ - testing_api_cmd_get_statisticsamount.c \ - testing_api_cmd_get_statisticscounter.c \ - testing_api_cmd_get_transfers.c \ - testing_api_cmd_get_templates.c \ - testing_api_cmd_get_template.c \ - testing_api_cmd_get_unit.c \ - testing_api_cmd_get_units.c \ - testing_api_cmd_get_webhooks.c \ - testing_api_cmd_get_webhook.c \ - testing_api_cmd_delete_account.c \ - testing_api_cmd_delete_instance.c \ - testing_api_cmd_delete_order.c \ - testing_api_cmd_delete_otp_device.c \ - testing_api_cmd_delete_product.c \ - testing_api_cmd_delete_template.c \ - testing_api_cmd_delete_unit.c \ - testing_api_cmd_delete_webhook.c \ - testing_api_cmd_delete_transfer.c \ - testing_api_cmd_exec_donaukeyupdate.c \ - testing_api_cmd_forget_order.c \ - testing_api_cmd_kyc_get.c \ - testing_api_cmd_lock_product.c \ - testing_api_cmd_instance_auth.c \ - testing_api_cmd_instance_token.c \ - testing_api_cmd_merchant_get_order.c \ - testing_api_cmd_patch_instance.c \ - testing_api_cmd_patch_otp_device.c \ - testing_api_cmd_patch_product.c \ - testing_api_cmd_patch_template.c \ - testing_api_cmd_patch_unit.c \ - testing_api_cmd_patch_webhook.c \ - testing_api_cmd_pay_order.c \ - testing_api_cmd_post_account.c \ - testing_api_cmd_post_instances.c \ - testing_api_cmd_post_orders_paid.c \ - testing_api_cmd_post_orders.c \ - testing_api_cmd_post_otp_devices.c \ - testing_api_cmd_post_categories.c \ - testing_api_cmd_post_products.c \ - testing_api_cmd_post_transfers.c \ - testing_api_cmd_post_templates.c \ - testing_api_cmd_post_units.c \ - testing_api_cmd_post_tokenfamilies.c \ - testing_api_cmd_post_using_templates.c \ - testing_api_cmd_post_webhooks.c \ - testing_api_cmd_refund_order.c \ - testing_api_cmd_tme.c \ - testing_api_cmd_wallet_get_order.c \ - testing_api_cmd_wallet_get_template.c \ - testing_api_cmd_wallet_post_orders_refund.c \ - testing_api_cmd_webhook.c \ - testing_api_cmd_testserver.c \ - testing_api_cmd_checkserver.c \ - testing_api_helpers.c \ - testing_api_traits.c \ - testing_api_cmd_post_donau_charity_merchant.c \ - testing_api_cmd_post_donau_instances.c \ - testing_api_cmd_get_donau_instances.c \ - testing_api_cmd_delete_donau_instances.c - -libtalermerchanttesting_la_LIBADD = \ - $(top_srcdir)/src/lib/libtalermerchant.la \ - -ldonautesting \ - -ltalerbank \ - -ltalerexchange \ - -ltalerjson \ - -ltalermhd \ - -ltalerutil \ - -lgnunetcurl \ - -lgnunetjson \ - -lgnunetutil \ - -ljansson \ - -lmicrohttpd \ - -ltalertesting \ - -lm \ - $(XLIB) - -if HAVE_TALERFAKEBANK -check_PROGRAMS = \ - test_reconciliation_rsa \ - test_merchant_api_cs \ - test_merchant_api_rsa \ - test_kyc_api - -if HAVE_TWISTER -check_PROGRAMS += \ - test_merchant_api_twisted_cs \ - test_merchant_api_twisted_rsa -endif -endif - -TESTS = \ - $(check_PROGRAMS) \ - $(check_SCRIPTS) - -AM_TESTS_ENVIRONMENT=export TALER_MERCHANT_PREFIX=$${TALER_MERCHANT_PREFIX:-@libdir@};export PATH=$${TALER_MERCHANT_PREFIX:-@prefix@}/bin:$$PATH; - -test_merchant_api_twisted_cs_SOURCES = \ - test_merchant_api_twisted.c -test_merchant_api_twisted_cs_LDADD = \ - $(top_srcdir)/src/backenddb/libtalermerchantdb.la \ - $(top_srcdir)/src/lib/libtalermerchant.la \ - $(top_srcdir)/src/util/libtalermerchantutil.la \ - $(LIBGCRYPT_LIBS) \ - -ltalertesting \ - -ltalermerchanttesting \ - -ltalertwistertesting \ - -ltalerfakebank \ - -ltalerbank \ - -ltalerexchange \ - -ltalerjson \ - -ltalerutil \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - -ltalertwister \ - $(XLIB) - -test_merchant_api_twisted_rsa_SOURCES = \ - test_merchant_api_twisted.c -test_merchant_api_twisted_rsa_LDADD = \ - $(top_srcdir)/src/backenddb/libtalermerchantdb.la \ - $(top_srcdir)/src/lib/libtalermerchant.la \ - $(top_srcdir)/src/util/libtalermerchantutil.la \ - $(LIBGCRYPT_LIBS) \ - -ltalertesting \ - -ltalermerchanttesting \ - -ltalertwistertesting \ - -ltalerfakebank \ - -ltalerbank \ - -ltalerexchange \ - -ltalerjson \ - -ltalerutil \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - -ltalertwister \ - $(XLIB) - -test_merchant_api_cs_SOURCES = \ - test_merchant_api.c -test_merchant_api_cs_LDADD = \ - libtalermerchanttesting.la \ - $(top_srcdir)/src/backenddb/libtalermerchantdb.la \ - $(top_srcdir)/src/lib/libtalermerchant.la \ - $(top_srcdir)/src/util/libtalermerchantutil.la \ - $(LIBGCRYPT_LIBS) \ - -ldonautesting \ - -ltalertesting \ - -ltalerfakebank \ - -ltalerbank \ - -ltalerexchange \ - -ltalerjson \ - -ltalerutil \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_merchant_api_rsa_SOURCES = \ - test_merchant_api.c -test_merchant_api_rsa_LDADD = \ - libtalermerchanttesting.la \ - $(top_srcdir)/src/util/libtalermerchantutil.la \ - $(top_srcdir)/src/backenddb/libtalermerchantdb.la \ - $(top_srcdir)/src/lib/libtalermerchant.la \ - $(LIBGCRYPT_LIBS) \ - -ldonautesting \ - -ltalertesting \ - -ltalerfakebank \ - -ltalerbank \ - -ltalerexchange \ - -ltalerjson \ - -ltalerutil \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_reconciliation_rsa_SOURCES = \ - test_reconciliation.c -test_reconciliation_rsa_LDADD = \ - libtalermerchanttesting.la \ - $(top_srcdir)/src/util/libtalermerchantutil.la \ - $(top_srcdir)/src/backenddb/libtalermerchantdb.la \ - $(top_srcdir)/src/lib/libtalermerchant.la \ - $(LIBGCRYPT_LIBS) \ - -ltalertesting \ - -ltalerfakebank \ - -ltalerbank \ - -ltalerexchange \ - -ltalerjson \ - -ltalerutil \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -test_kyc_api_SOURCES = \ - test_kyc_api.c -test_kyc_api_LDADD = \ - libtalermerchanttesting.la \ - $(top_srcdir)/src/util/libtalermerchantutil.la \ - $(top_srcdir)/src/backenddb/libtalermerchantdb.la \ - $(top_srcdir)/src/lib/libtalermerchant.la \ - $(LIBGCRYPT_LIBS) \ - -ltalertesting \ - -ltalerfakebank \ - -ltalerbank \ - -ltalerexchange \ - -ltalerjson \ - -ltalerutil \ - -lgnunetjson \ - -lgnunetcurl \ - -lgnunetutil \ - -ljansson \ - $(XLIB) - -EXTRA_DIST = \ - setup.sh \ - test_key_rotation.conf \ - test_kyc_api.conf \ - test_merchant_api.conf \ - test_merchant_api-cs.conf \ - test_merchant_api-rsa.conf \ - test_merchant_api_twisted-cs.conf \ - test_merchant_api_twisted-rsa.conf \ - test_merchant_api_proxy_merchant.conf \ - test_merchant_api_proxy_exchange.conf \ - test_merchant.priv \ - test_template.conf \ - $(check_SCRIPTS) - - -MOSTLYCLEANFILES = \ - test_merchant_api_home/.local/share/taler/exchange/offline-keys/secm_tofus.pub diff --git a/src/testing/meson.build b/src/testing/meson.build @@ -0,0 +1,369 @@ +# This build file is in the public domain + + +check_SCRIPTS = [ + 'test_merchant_instance_auth', + 'test_merchant_instance_creation', + 'test_merchant_instance_response', + 'test_merchant_instance_purge', + 'test_merchant_kyc', + 'test_merchant_order_creation', + 'test_merchant_order_autocleanup', + 'test_merchant_product_creation', + 'test_merchant_statistics', + 'test_merchant_templates', + 'test_merchant_transfer_tracking', + 'test-merchant-walletharness', + 'test_merchant_wirewatch', +] + +foreach f : check_SCRIPTS + f_sh = '@0@.sh'.format(f) + s = configure_file(input: f_sh, output: f_sh, copy: true) + test( + f, + s, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], + is_parallel: false, + ) + +endforeach + + +libtalermerchanttesting_la_SOURCES = [ + 'testing_api_cmd_config.c', + 'testing_api_cmd_abort_order.c', + 'testing_api_cmd_claim_order.c', + 'testing_api_cmd_depositcheck.c', + 'testing_api_cmd_get_instance.c', + 'testing_api_cmd_get_instances.c', + 'testing_api_cmd_get_orders.c', + 'testing_api_cmd_get_otp_device.c', + 'testing_api_cmd_get_otp_devices.c', + 'testing_api_cmd_get_product.c', + 'testing_api_cmd_get_product_image.c', + 'testing_api_cmd_get_products.c', + 'testing_api_cmd_get_statisticsamount.c', + 'testing_api_cmd_get_statisticscounter.c', + 'testing_api_cmd_get_transfers.c', + 'testing_api_cmd_get_templates.c', + 'testing_api_cmd_get_template.c', + 'testing_api_cmd_get_unit.c', + 'testing_api_cmd_get_units.c', + 'testing_api_cmd_get_webhooks.c', + 'testing_api_cmd_get_webhook.c', + 'testing_api_cmd_delete_account.c', + 'testing_api_cmd_delete_instance.c', + 'testing_api_cmd_delete_order.c', + 'testing_api_cmd_delete_otp_device.c', + 'testing_api_cmd_delete_product.c', + 'testing_api_cmd_delete_template.c', + 'testing_api_cmd_delete_unit.c', + 'testing_api_cmd_delete_webhook.c', + 'testing_api_cmd_delete_transfer.c', + 'testing_api_cmd_exec_donaukeyupdate.c', + 'testing_api_cmd_forget_order.c', + 'testing_api_cmd_kyc_get.c', + 'testing_api_cmd_lock_product.c', + 'testing_api_cmd_instance_auth.c', + 'testing_api_cmd_instance_token.c', + 'testing_api_cmd_merchant_get_order.c', + 'testing_api_cmd_patch_instance.c', + 'testing_api_cmd_patch_otp_device.c', + 'testing_api_cmd_patch_product.c', + 'testing_api_cmd_patch_template.c', + 'testing_api_cmd_patch_unit.c', + 'testing_api_cmd_patch_webhook.c', + 'testing_api_cmd_pay_order.c', + 'testing_api_cmd_post_account.c', + 'testing_api_cmd_post_instances.c', + 'testing_api_cmd_post_orders_paid.c', + 'testing_api_cmd_post_orders.c', + 'testing_api_cmd_post_otp_devices.c', + 'testing_api_cmd_post_categories.c', + 'testing_api_cmd_post_products.c', + 'testing_api_cmd_post_transfers.c', + 'testing_api_cmd_post_templates.c', + 'testing_api_cmd_post_units.c', + 'testing_api_cmd_post_tokenfamilies.c', + 'testing_api_cmd_post_using_templates.c', + 'testing_api_cmd_post_webhooks.c', + 'testing_api_cmd_refund_order.c', + 'testing_api_cmd_tme.c', + 'testing_api_cmd_wallet_get_order.c', + 'testing_api_cmd_wallet_get_template.c', + 'testing_api_cmd_wallet_post_orders_refund.c', + 'testing_api_cmd_webhook.c', + 'testing_api_cmd_testserver.c', + 'testing_api_cmd_checkserver.c', + 'testing_api_helpers.c', + 'testing_api_traits.c', + 'testing_api_cmd_post_donau_charity_merchant.c', + 'testing_api_cmd_post_donau_instances.c', + 'testing_api_cmd_get_donau_instances.c', + 'testing_api_cmd_delete_donau_instances.c', +] + + +libtalermerchanttesting = library( + 'talermerchanttesting', + libtalermerchanttesting_la_SOURCES, + soversion: solibversions['libtalermerchanttesting']['soversion'], + version: solibversions['libtalermerchanttesting']['soversion'], + install_rpath: rpath_option, + dependencies: [ + donau_dep, + donauutil_dep, + libtalermerchant_dep, + donautesting_dep, + talerexchange_dep, + talermhd_dep, + talerbank_dep, + talertesting_dep, + talerjson_dep, + talerutil_dep, + gnunetutil_dep, + gnunetcurl_dep, + gnunetjson_dep, + json_dep, + mhd_dep, + m_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalermerchanttesting_dep = declare_dependency( + link_with: libtalermerchanttesting, +) +pkg.generate( + libtalermerchanttesting, + url: 'https://taler.net', + description: 'GNU Taler merchant testing library', +) + +if talerfakebank_dep.found() + if twister_dep.found() + test_merchant_api_twisted_cs = executable( + 'test_merchant_api_twisted_cs', + ['test_merchant_api_twisted.c'], + dependencies: [ + talertesting_dep, + libtalermerchant_dep, + libtalermerchantutil_dep, + libtalermerchantdb_dep, + libtalermerchanttesting_dep, + talertwistertesting_dep, + twister_dep, + talerexchange_dep, + talerbank_dep, + talerfakebank_dep, + talerjson_dep, + talerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + 'test_merchant_api_twisted_cs', + test_merchant_api_twisted_cs, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], + is_parallel: false, + ) + + + test_merchant_api_twisted_rsa = executable( + 'test_merchant_api_twisted_rsa', + ['test_merchant_api_twisted.c'], + dependencies: [ + talertesting_dep, + libtalermerchant_dep, + libtalermerchantutil_dep, + libtalermerchantdb_dep, + libtalermerchanttesting_dep, + talertwistertesting_dep, + twister_dep, + talerexchange_dep, + talerbank_dep, + talerfakebank_dep, + talerjson_dep, + talerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + 'test_merchant_api_twisted_rsa', + test_merchant_api_twisted_rsa, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], + is_parallel: false, + ) + + endif + + test_merchant_api_cs = executable( + 'test_merchant_api_cs', + ['test_merchant_api.c'], + dependencies: [ + donautesting_dep, + talertesting_dep, + libtalermerchant_dep, + libtalermerchantutil_dep, + libtalermerchantdb_dep, + libtalermerchanttesting_dep, + talerexchange_dep, + talerbank_dep, + talerfakebank_dep, + talerjson_dep, + talerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + 'test_merchant_api_cs', + test_merchant_api_cs, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], + is_parallel: false, + ) + + test_merchant_api_rsa = executable( + 'test_merchant_api_rsa', + ['test_merchant_api.c'], + dependencies: [ + donautesting_dep, + talertesting_dep, + libtalermerchant_dep, + libtalermerchantutil_dep, + libtalermerchantdb_dep, + libtalermerchanttesting_dep, + talerexchange_dep, + talerbank_dep, + talerfakebank_dep, + talerjson_dep, + talerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + 'test_merchant_api_rsa', + test_merchant_api_rsa, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], + is_parallel: false, + ) + + test_reconciliation_rsa = executable( + 'test_reconciliation_rsa', + ['test_reconciliation.c'], + dependencies: [ + talertesting_dep, + libtalermerchant_dep, + libtalermerchantutil_dep, + libtalermerchantdb_dep, + libtalermerchanttesting_dep, + talerexchange_dep, + talerbank_dep, + talerfakebank_dep, + talerjson_dep, + talerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_dep, + ], + include_directories: [incdir, configuration_inc], + build_by_default: false, + install: false, + ) + test( + 'test_reconciliation_rsa', + test_reconciliation_rsa, + workdir: meson.current_build_dir(), + suite: ['testing', 'integrationtests'], + is_parallel: false, + ) + + test_kyc_api = executable( + 'test_kyc_api', + ['test_kyc_api.c'], + dependencies: [ + talertesting_dep, + libtalermerchant_dep, + libtalermerchantutil_dep, + libtalermerchantdb_dep, + libtalermerchanttesting_dep, + talerexchange_dep, + talerbank_dep, + talerfakebank_dep, + talerjson_dep, + talerutil_dep, + json_dep, + gcrypt_dep, + gnunetutil_dep, + gnunetjson_dep, + gnunetcurl_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'], + is_parallel: false, + ) + + +endif + +EXTRA_DIST = [ + 'setup.sh', + 'test_key_rotation.conf', + 'test_kyc_api.conf', + 'test_merchant_api.conf', + 'test_merchant_api-cs.conf', + 'test_merchant_api-rsa.conf', + 'test_merchant_api_twisted-cs.conf', + 'test_merchant_api_twisted-rsa.conf', + 'test_merchant_api_proxy_merchant.conf', + 'test_merchant_api_proxy_exchange.conf', + 'test_merchant.priv', + 'test_template.conf', +] +foreach f : EXTRA_DIST + configure_file(input: f, output: f, copy: true) +endforeach diff --git a/src/testing/test_merchant_accounts.sh b/src/testing/test_merchant_accounts.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is part of TALER # Copyright (C) 2014-2023 Taler Systems SA # diff --git a/src/testing/test_merchant_instance_auth.sh b/src/testing/test_merchant_instance_auth.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is part of TALER # Copyright (C) 2014-2023 Taler Systems SA # diff --git a/src/testing/test_merchant_instance_creation.sh b/src/testing/test_merchant_instance_creation.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is part of TALER # Copyright (C) 2014-2023 Taler Systems SA # diff --git a/src/testing/test_merchant_instance_purge.sh b/src/testing/test_merchant_instance_purge.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is part of TALER # Copyright (C) 2014-2023 Taler Systems SA # diff --git a/src/testing/test_merchant_instance_response.sh b/src/testing/test_merchant_instance_response.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is part of TALER # Copyright (C) 2014-2023 Taler Systems SA # diff --git a/src/testing/test_merchant_kyc.sh b/src/testing/test_merchant_kyc.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is part of TALER # Copyright (C) 2014-2023 Taler Systems SA # diff --git a/src/testing/test_merchant_mfa.sh b/src/testing/test_merchant_mfa.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is part of TALER # Copyright (C) 2025 Taler Systems SA # diff --git a/src/testing/test_merchant_order_autocleanup.sh b/src/testing/test_merchant_order_autocleanup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is in the public domain. set -eu diff --git a/src/testing/test_merchant_order_creation.sh b/src/testing/test_merchant_order_creation.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is in the public domain. set -eu diff --git a/src/testing/test_merchant_order_refund.sh b/src/testing/test_merchant_order_refund.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is in the public domain. set -eu diff --git a/src/testing/test_merchant_product_creation.sh b/src/testing/test_merchant_product_creation.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is part of TALER # Copyright (C) 2014-2023 Taler Systems SA # diff --git a/src/testing/test_merchant_statistics.sh b/src/testing/test_merchant_statistics.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is in the public domain. set -eu diff --git a/src/testing/test_merchant_templates.sh b/src/testing/test_merchant_templates.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is in the public domain. set -eu diff --git a/src/testing/test_merchant_tokenfamilies.sh b/src/testing/test_merchant_tokenfamilies.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is part of TALER # Copyright (C) 2026 Taler Systems SA # diff --git a/src/testing/test_merchant_transfer_tracking.sh b/src/testing/test_merchant_transfer_tracking.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is part of TALER # Copyright (C) 2014-2026 Taler Systems SA # diff --git a/src/testing/test_merchant_wirewatch.sh b/src/testing/test_merchant_wirewatch.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is part of TALER # Copyright (C) 2014-2023 Taler Systems SA # diff --git a/src/util/Makefile.am b/src/util/Makefile.am @@ -1,72 +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 - - -pkgcfgdir = $(prefix)/share/taler-merchant/config.d/ - -pkgcfg_DATA = \ - currencies.conf \ - merchant-paths.conf - -bin_PROGRAMS = \ - taler-merchant-config - -AM_TESTS_ENVIRONMENT=export TALER_PREFIX=$${TALER_PREFIX:-@libdir@};export PATH=$${TALER_PREFIX:-@prefix@}/bin:$$PATH; - -check_PROGRAMS = \ - test_contract \ - test_validators - -TESTS = \ - $(check_PROGRAMS) - -taler_merchant_config_SOURCES = \ - taler-merchant-config.c -taler_merchant_config_LDADD = \ - libtalermerchantutil.la \ - -lgnunetutil \ - $(XLIB) - -EXTRA_DIST = \ - $(bin_SCRIPTS) \ - $(pkgcfg_DATA) - -lib_LTLIBRARIES = \ - libtalermerchantutil.la - -libtalermerchantutil_la_SOURCES = \ - amount_quantity.c \ - contract_parse.c \ - contract_serialize.c \ - json.c \ - mfa.c \ - os_installation.c \ - template_parse.c \ - value_kinds.c \ - validators.c -libtalermerchantutil_la_LIBADD = \ - -lgnunetjson \ - -lgnunetutil \ - -ltalerjson \ - -ltalerutil \ - $(XLIB) -libtalermerchantutil_la_LDFLAGS = \ - -version-info 1:1:1 \ - -export-dynamic -no-undefined - -test_contract_SOURCES = \ - test_contract.c -test_contract_LDADD = \ - -lgnunetutil \ - libtalermerchantutil.la - -test_validators_SOURCES = \ - test_contract.c -test_validators_LDADD = \ - -lgnunetutil \ - libtalermerchantutil.la diff --git a/src/util/meson.build b/src/util/meson.build @@ -0,0 +1,106 @@ +# This build file is in the public domain +exchange_configs = ['currencies.conf', 'merchant-paths.conf'] + + +foreach c : exchange_configs + configure_file( + input: c, + output: c, + configuration: cdata, + install: true, + install_dir: pkgcfgdir, + ) +endforeach + + +libtalermerchantutil_SOURCES = [ + 'amount_quantity.c', + 'contract_parse.c', + 'contract_serialize.c', + 'json.c', + 'mfa.c', + 'os_installation.c', + 'template_parse.c', + 'value_kinds.c', + 'validators.c', +] + +libtalermerchantutil = library( + 'talermerchantutil', + libtalermerchantutil_SOURCES, + soversion: solibversions['libtalermerchantutil']['soversion'], + version: solibversions['libtalermerchantutil']['soversion'], + install_rpath: rpath_option, + dependencies: [ + gnunetutil_dep, + gnunetjson_dep, + talerutil_dep, + talerjson_dep, + json_dep, + ], + include_directories: [incdir, configuration_inc], + install: true, + install_dir: get_option('libdir'), +) + +libtalermerchantutil_dep = declare_dependency(link_with: libtalermerchantutil) +pkg.generate( + libtalermerchantutil, + url: 'https://taler.net', + description: 'GNU Taler merchant utilities library', +) + +executable( + 'taler-merchant-config', + ['taler-merchant-config.c'], + dependencies: [libtalermerchantutil_dep, gnunetutil_dep], + include_directories: [incdir, configuration_inc], + install: true, +) + +talermerchantutil_tests = [ + 'test_contract', + # FTBFS 'test_validators', +] + +talermerchantutil_tests_installcheck = [] + +foreach t : talermerchantutil_tests + + test_tmp = executable( + t, + ['@0@.c'.format(t)], + dependencies: [gnunetutil_dep, libtalermerchantutil_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'], + is_parallel: false, + ) +endforeach + +foreach t : talermerchantutil_tests_installcheck + + test_tmp = executable( + t, + ['@0@.c'.format(t)], + dependencies: [gnunetutil_dep, libtalermerchantutil_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'], + is_parallel: false, + ) + + +endforeach