anastasis

Credential backup and recovery protocol and service
Log | Files | Refs | Submodules | README | LICENSE

meson.build (4110B)


      1 # This Makefile.am is in the public domain
      2 
      3 plugindir = get_option('libdir') / 'anastasis'
      4 sqldir = get_option('datadir') / 'anastasis' / 'sql'
      5 
      6 install_data(
      7     'versioning.sql',
      8     'stasis-0001.sql',
      9     'stasis-0002.sql',
     10     'drop.sql',
     11     install_dir: sqldir,
     12 )
     13 
     14 # Stored procedures are not schema: they are dropped and recreated on every
     15 # anastasis-dbinit, so fixing one does not need a new migration.  Keep the
     16 # list in the same order as libanastasisdb_SOURCES.
     17 procedures_sql = [
     18     'procedures-prelude.sql',
     19     'do_gc.sql',
     20     'do_insert_recdoc_payment.sql',
     21     'do_update_account_lifetime.sql',
     22     'commit.sql',
     23 ]
     24 
     25 custom_target(
     26     'gen-stasis-procedures.sql',
     27     input: procedures_sql,
     28     output: 'procedures.sql',
     29     capture: true,
     30     command: ['./amalgamate-sql.sh', '@INPUT@'],
     31     install: true,
     32     install_dir: sqldir,
     33 )
     34 
     35 install_data('stasis-postgres.conf', install_dir: pkgcfgdir)
     36 
     37 libanastasisdb_SOURCES = [
     38     'anastasis-db_pg.c',
     39     'preflight.c',
     40     'create_tables.c',
     41     'drop_tables.c',
     42     'do_gc.c',
     43     'get_challenge_payment.c',
     44     'get_recdoc_payment.c',
     45     'get_truth_payment.c',
     46     'insert_challenge_code.c',
     47     'get_truth.c',
     48     'get_truth_key_share.c',
     49     'get_last_auth_iban_in_row.c',
     50     'get_latest_recovery_document.c',
     51     'get_recovery_document.c',
     52     'iterate_recovery_meta_data.c',
     53     'get_account.c',
     54     'get_pending_challenge_payment.c',
     55     'update_to_challenge_code_satisfied.c',
     56     'update_totp_counter.c',
     57     'update_to_challenge_code_sent.c',
     58     'insert_auth_iban_in.c',
     59     'insert_challenge_payment.c',
     60     'update_to_challenge_payment_refunded.c',
     61     'do_insert_recdoc_payment.c',
     62     'insert_truth_payment.c',
     63     'do_insert_recovery_document.c',
     64     'insert_truth.c',
     65     'iterate_auth_iban_transfers.c',
     66     'get_exists_challenge_code_satisfied.c',
     67     'update_to_challenge_payment_paid.c',
     68     'do_update_account_lifetime.c',
     69     'do_verify_challenge_code.c',
     70 ]
     71 
     72 libanastasisdb = library(
     73     'anastasisdb',
     74     libanastasisdb_SOURCES,
     75     soversion: solibversions['libanastasisdb']['soversion'],
     76     version: solibversions['libanastasisdb']['soversion'],
     77     install_rpath: rpath_option,
     78     dependencies: [
     79         gnunetutil_dep,
     80         gnunetpq_dep,
     81         pq_dep,
     82         talerpq_dep,
     83         talerutil_dep,
     84         libanastasisutil_dep,
     85     ],
     86     include_directories: [incdir, configuration_inc],
     87     install: true,
     88     install_dir: get_option('libdir'),
     89 )
     90 
     91 libanastasisdb_dep = declare_dependency(link_with: libanastasisdb)
     92 pkg.generate(
     93     libanastasisdb,
     94     url: 'https://taler.net',
     95     description: 'GNU Taler anastasis DB utilities library',
     96 )
     97 
     98 
     99 executable(
    100     'anastasis-dbinit',
    101     ['anastasis-dbinit.c'],
    102     dependencies: [
    103         libanastasisutil_dep,
    104         libanastasisdb_dep,
    105         gnunetutil_dep,
    106         gcrypt_dep,
    107         talerutil_dep,
    108         talerpq_dep,
    109     ],
    110     include_directories: [incdir, configuration_inc],
    111     install: true,
    112 )
    113 
    114 test_anastasis_db_postgres = executable(
    115     'test_anastasis_db-postgres',
    116     ['test_anastasis_db.c'],
    117     dependencies: [
    118         libanastasisutil_dep,
    119         libanastasisdb_dep,
    120         gnunetutil_dep,
    121         talerutil_dep,
    122         talerpq_dep,
    123         gnunetpq_dep,
    124         json_dep,
    125     ],
    126     include_directories: [incdir, configuration_inc],
    127     build_by_default: false,
    128     install: false,
    129 )
    130 test(
    131     'test_anastasis_db_postgres',
    132     test_anastasis_db_postgres,
    133     workdir: meson.current_build_dir(),
    134     suite: ['stasis'],
    135     is_parallel: false,
    136 )
    137 
    138 
    139 configure_file(
    140     input: 'test_anastasis_db_postgres.conf',
    141     output: 'test_anastasis_db_postgres.conf',
    142     copy: true,
    143 )
    144 
    145 
    146 # Enforce the database layer naming convention (see contrib/check-db-naming.py
    147 # and the rules it implements).  Needs no database, only the sources.
    148 python3_bin = find_program('python3', required: false)
    149 if python3_bin.found()
    150     test(
    151         'check_db_naming',
    152         python3_bin,
    153         args: [meson.project_source_root() / 'contrib' / 'check-db-naming.py'],
    154         workdir: meson.project_source_root(),
    155         suite: ['stasis'],
    156     )
    157 endif