gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis] branch master updated: add libanastasisutil


From: gnunet
Subject: [taler-anastasis] branch master updated: add libanastasisutil
Date: Thu, 07 Nov 2019 10:02:36 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 1f445a6  add libanastasisutil
1f445a6 is described below

commit 1f445a66a2ba8be507d0e2583e026f749576e9b8
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Nov 7 10:02:33 2019 +0100

    add libanastasisutil
---
 configure.ac               |  1 +
 src/Makefile.am            |  2 +-
 src/util/Makefile.am       | 29 +++++++++++++++++++
 src/util/anastasis-config  | 17 +++++++++++
 src/util/os_installation.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++
 src/util/paths.conf        | 29 +++++++++++++++++++
 6 files changed, 148 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index b261464..48d17cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -300,6 +300,7 @@ AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test 
"x$enable_experimental" = "xyes"])
 AC_CONFIG_FILES([Makefile
 doc/Makefile
 src/Makefile
+src/util/Makefile
 src/backup-db/Makefile
 src/backup/Makefile
 src/include/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 56f5cf4..1a68f8c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,3 +1,3 @@
 # This Makefile is in the public domain
 AM_CPPFLAGS = -I$(top_srcdir)/src/include
-SUBDIRS = include backup-db backup lib
+SUBDIRS = include util backup-db backup lib
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
new file mode 100644
index 0000000..4efc486
--- /dev/null
+++ b/src/util/Makefile.am
@@ -0,0 +1,29 @@
+# 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/anastasis/config.d/
+
+pkgcfg_DATA = \
+  paths.conf
+
+bin_SCRIPTS = \
+  anastasis-config
+
+lib_LTLIBRARIES = \
+  libanastasisutil.la
+
+libanastasisutil_la_SOURCES = \
+  os_installation.c
+libanastasisutil_la_LIBADD = \
+  -lgnunetutil \
+  $(XLIB)
+libanastasisutil_la_LDFLAGS = \
+  -version-info 0:0:0 \
+  -export-dynamic -no-undefined
+
diff --git a/src/util/anastasis-config b/src/util/anastasis-config
new file mode 100644
index 0000000..3031b69
--- /dev/null
+++ b/src/util/anastasis-config
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+set -eu
+
+if ! type gnunet-config >/dev/null; then
+  echo "$0 needs gnunet-config to be installed"
+  exit 1
+fi
+
+# FIXME: not very portable ...
+# FIXME: should use "libdir" instead of prefix/lib, but somehow
+# the recursive expansion does not work ;-(.
+GC=`which gnunet-config`
+ASAN=""
+A=`ldd $GC | grep libasan` && ASAN=`echo $A | awk '{print $3 ":"}'`
+export LD_PRELOAD=${ASAN}${LD_PRELOAD:-}:/home/grothoff/lib/libanastasisutil.so
+exec gnunet-config "$@"
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
new file mode 100644
index 0000000..289db5a
--- /dev/null
+++ b/src/util/os_installation.c
@@ -0,0 +1,71 @@
+/*
+     This file is part of GNU Anastasis.
+     Copyright (C) 2019 Taler Systems SA
+
+     Anastasis 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.
+
+     Anastasis 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 Anastasis; see the file COPYING.  If not, write to the
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
+*/
+
+/**
+ * @file os_installation.c
+ * @brief initialize libgnunet OS subsystem for Anastasis.
+ * @author Christian Grothoff
+ */
+#include "platform.h"
+#include <gnunet/gnunet_util_lib.h>
+
+
+/**
+ * Default project data used for installation path detection
+ * for GNU Anastasis.
+ */
+static const struct GNUNET_OS_ProjectData anastasis_pd = {
+  .libname = "libanastasisutil",
+  .project_dirname = "anastasis",
+  .binary_name = "anastasis-exchange-httpd",
+  .env_varname = "ANASTASIS_PREFIX",
+  .base_config_varname = "ANASTASIS_BASE_CONFIG",
+  .bug_email = "address@hidden",
+  .homepage = "http://www.gnu.org/s/anastasis/";,
+  .config_file = "anastasis.conf",
+  .user_config_file = "~/.config/anastasis.conf",
+  .version = PACKAGE_VERSION,
+  .is_gnu = 1,
+  .gettext_domain = "anastasis",
+  .gettext_path = NULL,
+};
+
+
+/**
+ * Return default project data used by Anastasis.
+ */
+const struct GNUNET_OS_ProjectData *
+ANASTASIS_project_data_default (void)
+{
+  return &anastasis_pd;
+}
+
+
+/**
+ * Initialize libanastasisutil.
+ */
+void __attribute__ ((constructor))
+ANASTASIS_OS_init ()
+{
+  GNUNET_OS_init (&anastasis_pd);
+}
+
+
+/* end of os_installation.c */
diff --git a/src/util/paths.conf b/src/util/paths.conf
new file mode 100644
index 0000000..4b45fc1
--- /dev/null
+++ b/src/util/paths.conf
@@ -0,0 +1,29 @@
+# This file is in the public domain.
+#
+[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).  Anastasis also supports expanding $-expressions using
+# defaults with the syntax "${VAR:-default}".  Here, "default" can again
+# be a $-expression.
+#
+# We usually want $HOME for $ANASTASIS_HOME, but we allow testcases to
+# easily override this by setting $ANASTASIS_TEST_HOME.
+#
+ANASTASIS_HOME = ${ANASTASIS_TEST_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.
+
+# Persistant data storage
+ANASTASIS_DATA_HOME = ${XDG_DATA_HOME:-$ANASTASIS_HOME/.local/share}/anastasis/
+
+# Configuration files
+ANASTASIS_CONFIG_HOME = ${XDG_CONFIG_HOME:-$ANASTASIS_HOME/.config}/anastasis/
+
+# Cached data, no big deal if lost
+ANASTASIS_CACHE_HOME = ${XDG_CACHE_HOME:-$ANASTASIS_HOME/.cache}/anastasis/
+
+# Runtime data (always lost on system boot)
+ANASTASIS_RUNTIME_DIR = ${TMPDIR:-${TMP:-/tmp}}/anastasis-system-runtime/

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]