commit 6c9380144f0d37c2fd3fbc74824918089f2390dd
parent 960ab5516bdfa9bedc79b7e62fea9fcc4dd3db58
Author: Christian Grothoff <christian@grothoff.org>
Date: Fri, 17 Sep 2021 11:28:41 +0200
-try to fix Debian package and other issues
Diffstat:
8 files changed, 48 insertions(+), 45 deletions(-)
diff --git a/debian/db/install/pgsql b/debian/db/install/pgsql
@@ -13,7 +13,7 @@ if [ -f /etc/dbconfig-common/sync-httpd.conf ]; then
echo -e "# Config file auto-generated by Debian.\n[sync]\nDB=postgres\n\n" > \
$conf_override
# We assume ident auth here. We might support password auth later.
- echo -e "[stasis-postgres]\nCONFIG=postgres:///${dbc_dbname}\n\n" > \
+ echo -e "# Config file auto-generated by Debian.\n[syncdb-postgres]\nCONFIG=postgres:///${dbc_dbname}\n\n" > \
$conf_sync_db
# Allow the taler-merchant-httpd user to create schemas, needed by dbinit
diff --git a/debian/sync-httpd.config b/debian/sync-httpd.config
@@ -10,6 +10,7 @@ _GROUPNAME=www-data
# For now, we only support postgres
dbc_dbtypes=pgsql
dbc_dbuser=${_USERNAME}
+dbc_dbname="sync"
dbc_authmethod_user=ident
dbc_authmethod_admin=ident
diff --git a/src/sync/sync.conf b/src/sync/sync.conf
@@ -42,43 +42,3 @@ PAYMENT_BACKEND_URL = http://localhost:9966/
# API key to pass when accessing the merchant backend.
# API_KEY = SECRET_VALUE
-
-# Configuration for postgres database.
-[syncdb-postgres]
-CONFIG = postgres:///sync
-
-
-[PATHS]
-# The PATHS section is special, as filenames including $-expression are
-# expanded using the values from PATHS or the system environment (PATHS
-# is checked first). libgnunetutil supports expanding $-expressions using
-# defaults with the syntax "${VAR:-default}". Here, "default" can again
-# be a $-expression.
-#
-# We usually want $HOME for $SYNC_HOME
-#
-SYNC_HOME = ${HOME:-${USERPROFILE}}
-
-# see XDG Base Directory Specification at
-# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
-# for how these should be used.
-
-# Persistent data storage
-SYNC_DATA_HOME = ${XDG_DATA_HOME:-$SYNC_HOME/.local/share}/sync/
-
-# Configuration files
-SYNC_CONFIG_HOME = ${XDG_CONFIG_HOME:-$SYNC_HOME/.config}/sync/
-
-# Cached data, no big deal if lost
-SYNC_CACHE_HOME = ${XDG_CACHE_HOME:-$SYNC_HOME/.cache}/sync/
-
-# Runtime data (i.e UNIX domain sockets, locks, always lost on system boot)
-SYNC_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/sync-runtime/
-
-# Directory to use for temporary files.
-SYNC_TMP = ${TMPDIR:-${TMP:-/tmp}}/sync/
-
-# DEFAULTCONFIG = /etc/sync.conf
-# If 'DEFAULTCONFIG' is not defined, the current
-# configuration file is assumed to be the default,
-# which is what we want by default...
diff --git a/src/syncdb/Makefile.am b/src/syncdb/Makefile.am
@@ -1,6 +1,11 @@
# This Makefile.am is in the public domain
AM_CPPFLAGS = -I$(top_srcdir)/src/include
+pkgcfgdir = $(prefix)/share/sync/config.d/
+
+pkgcfg_DATA = \
+ sync_db_postgres.conf
+
plugindir = $(libdir)/sync
if HAVE_POSTGRESQL
@@ -80,4 +85,5 @@ TESTS = \
test_sync_db-postgres
EXTRA_DIST = \
+ $(pkgcfg_DATA) \
test_sync_db_postgres.conf
diff --git a/src/syncdb/sync-dbinit.c b/src/syncdb/sync-dbinit.c
@@ -85,6 +85,7 @@ run (void *cls,
struct GNUNET_TIME_Absolute ancient;
now = GNUNET_TIME_absolute_get ();
+ (void) GNUNET_TIME_round_abs (&now);
ancient = GNUNET_TIME_absolute_subtract (now,
GNUNET_TIME_relative_multiply (
GNUNET_TIME_UNIT_YEARS,
diff --git a/src/syncdb/sync_db_postgres.conf b/src/syncdb/sync_db_postgres.conf
@@ -1,7 +1,3 @@
-[anastasis]
-#The DB plugin to use
-DB = postgres
-
[syncdb-postgres]
#The connection string the plugin has to use for connecting to the database
CONFIG = postgres:///sync
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
@@ -9,11 +9,16 @@ endif
pkgcfgdir = $(prefix)/share/sync/config.d/
+pkgcfg_DATA = \
+ paths.conf
+
+
bin_SCRIPTS = \
sync-config
EXTRA_DIST = \
$(bin_SCRIPTS) \
+ $(pkgcfg_DATA) \
sync-config.in
edit_script = $(SED) -e 's,%libdir%,$(libdir),'g $(NULL)
diff --git a/src/util/paths.conf b/src/util/paths.conf
@@ -0,0 +1,34 @@
+[PATHS]
+# The PATHS section is special, as filenames including $-expression are
+# expanded using the values from PATHS or the system environment (PATHS
+# is checked first). libgnunetutil supports expanding $-expressions using
+# defaults with the syntax "${VAR:-default}". Here, "default" can again
+# be a $-expression.
+#
+# We usually want $HOME for $SYNC_HOME
+#
+SYNC_HOME = ${HOME:-${USERPROFILE}}
+
+# see XDG Base Directory Specification at
+# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+# for how these should be used.
+
+# Persistent data storage
+SYNC_DATA_HOME = ${XDG_DATA_HOME:-$SYNC_HOME/.local/share}/sync/
+
+# Configuration files
+SYNC_CONFIG_HOME = ${XDG_CONFIG_HOME:-$SYNC_HOME/.config}/sync/
+
+# Cached data, no big deal if lost
+SYNC_CACHE_HOME = ${XDG_CACHE_HOME:-$SYNC_HOME/.cache}/sync/
+
+# Runtime data (i.e UNIX domain sockets, locks, always lost on system boot)
+SYNC_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/sync-runtime/
+
+# Directory to use for temporary files.
+SYNC_TMP = ${TMPDIR:-${TMP:-/tmp}}/sync/
+
+# DEFAULTCONFIG = /etc/sync.conf
+# If 'DEFAULTCONFIG' is not defined, the current
+# configuration file is assumed to be the default,
+# which is what we want by default...