[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: DATASTORE: Move DB plugins to plugin dir
From: |
gnunet |
Subject: |
[gnunet] branch master updated: DATASTORE: Move DB plugins to plugin dir |
Date: |
Fri, 20 Oct 2023 09:29:00 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new f0ae86342 DATASTORE: Move DB plugins to plugin dir
f0ae86342 is described below
commit f0ae8634283ae86af1800c7a3a4fc6417c193172
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Fri Oct 20 09:28:54 2023 +0200
DATASTORE: Move DB plugins to plugin dir
---
configure.ac | 2 +
po/POTFILES.in | 16 +--
src/plugin/Makefile.am | 2 +
src/plugin/datacache/Makefile.am | 76 +++++++++++++
.../datacache/datacache-0001.sql | 0
.../datacache/datacache-drop.sql | 0
src/plugin/datacache/meson.build | 30 ++++++
.../datacache/plugin_datacache_heap.c | 0
.../datacache/plugin_datacache_postgres.c | 0
.../datacache/plugin_datacache_sqlite.c | 0
.../datacache/plugin_datacache_template.c | 0
src/{service => plugin}/datastore/Makefile.am | 103 ------------------
.../datastore/datastore-0001.sql | 0
.../datastore/datastore-drop.sql | 0
src/plugin/datastore/meson.build | 75 +++++++++++++
.../datastore/perf_plugin_datastore.c | 0
.../datastore/perf_plugin_datastore_data_heap.conf | 0
.../perf_plugin_datastore_data_postgres.conf | 0
.../perf_plugin_datastore_data_sqlite.conf | 0
.../datastore/plugin_datastore_heap.c | 0
.../datastore/plugin_datastore_postgres.c | 0
.../datastore/plugin_datastore_sqlite.c | 0
.../datastore/plugin_datastore_template.c | 0
.../datastore/test_plugin_datastore.c | 0
.../datastore/test_plugin_datastore_data_heap.conf | 0
.../test_plugin_datastore_data_postgres.conf | 0
.../test_plugin_datastore_data_sqlite.conf | 0
src/plugin/meson.build | 2 +
src/service/datacache/Makefile.am | 68 +-----------
src/service/datacache/meson.build | 33 ------
src/service/datastore/Makefile.am | 117 +--------------------
src/service/datastore/meson.build | 70 ------------
32 files changed, 199 insertions(+), 395 deletions(-)
diff --git a/configure.ac b/configure.ac
index aa96b55d5..d0d165f4e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1238,6 +1238,8 @@ src/lib/pq/Makefile
src/lib/sq/Makefile
src/plugin/Makefile
src/plugin/block/Makefile
+src/plugin/datacache/Makefile
+src/plugin/datastore/Makefile
src/plugin/fs/Makefile
src/plugin/gns/Makefile
src/plugin/gnsrecord/Makefile
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 88eaf10da..fbf8a8477 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -208,6 +208,14 @@ src/lib/util/tun.c
src/lib/util/uri.c
src/plugin/block/plugin_block_template.c
src/plugin/block/plugin_block_test.c
+src/plugin/datacache/plugin_datacache_heap.c
+src/plugin/datacache/plugin_datacache_postgres.c
+src/plugin/datacache/plugin_datacache_sqlite.c
+src/plugin/datacache/plugin_datacache_template.c
+src/plugin/datastore/plugin_datastore_heap.c
+src/plugin/datastore/plugin_datastore_postgres.c
+src/plugin/datastore/plugin_datastore_sqlite.c
+src/plugin/datastore/plugin_datastore_template.c
src/plugin/fs/plugin_block_fs.c
src/plugin/gns/plugin_block_gns.c
src/plugin/gns/plugin_gnsrecord_gns.c
@@ -254,16 +262,8 @@ src/service/core/gnunet-service-core_kx.c
src/service/core/gnunet-service-core_sessions.c
src/service/core/gnunet-service-core_typemap.c
src/service/datacache/datacache.c
-src/service/datacache/plugin_datacache_heap.c
-src/service/datacache/plugin_datacache_postgres.c
-src/service/datacache/plugin_datacache_sqlite.c
-src/service/datacache/plugin_datacache_template.c
src/service/datastore/datastore_api.c
src/service/datastore/gnunet-service-datastore.c
-src/service/datastore/plugin_datastore_heap.c
-src/service/datastore/plugin_datastore_postgres.c
-src/service/datastore/plugin_datastore_sqlite.c
-src/service/datastore/plugin_datastore_template.c
src/service/dht/dht_api.c
src/service/dht/dht_test_lib.c
src/service/dht/gnunet-service-dht.c
diff --git a/src/plugin/Makefile.am b/src/plugin/Makefile.am
index c04ecd5a6..cc07120b3 100644
--- a/src/plugin/Makefile.am
+++ b/src/plugin/Makefile.am
@@ -1,6 +1,8 @@
SUBDIRS = \
block \
gnsrecord \
+ datacache \
+ datastore \
namecache \
namestore \
revocation \
diff --git a/src/plugin/datacache/Makefile.am b/src/plugin/datacache/Makefile.am
new file mode 100644
index 000000000..b9ae06975
--- /dev/null
+++ b/src/plugin/datacache/Makefile.am
@@ -0,0 +1,76 @@
+# This Makefile.am is in the public domain
+AM_CPPFLAGS = -I$(top_srcdir)/src/include
+
+plugindir = $(libdir)/gnunet
+
+pkgcfgdir= $(pkgdatadir)/config.d/
+
+sqldir = $(prefix)/share/gnunet/sql/
+
+sql_DATA = \
+ datacache-0001.sql \
+ datacache-drop.sql
+
+
+if USE_COVERAGE
+ AM_CFLAGS = --coverage -O0
+ XLIBS = -lgcov
+endif
+
+if HAVE_SQLITE
+ SQLITE_PLUGIN = libgnunet_plugin_datacache_sqlite.la
+endif
+if HAVE_POSTGRESQL
+ POSTGRES_PLUGIN = libgnunet_plugin_datacache_postgres.la
+endif
+
+plugin_LTLIBRARIES = \
+ $(SQLITE_PLUGIN) \
+ $(POSTGRES_PLUGIN) \
+ libgnunet_plugin_datacache_heap.la
+
+# Real plugins should of course go into
+# plugin_LTLIBRARIES
+noinst_LTLIBRARIES = \
+ libgnunet_plugin_datacache_template.la
+
+
+libgnunet_plugin_datacache_sqlite_la_SOURCES = \
+ plugin_datacache_sqlite.c
+libgnunet_plugin_datacache_sqlite_la_LIBADD = \
+ $(top_builddir)/src/lib/sq/libgnunetsq.la \
+ $(top_builddir)/src/lib/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
+ $(LTLIBINTL)
+libgnunet_plugin_datacache_sqlite_la_LDFLAGS = \
+ $(GN_PLUGIN_LDFLAGS)
+
+libgnunet_plugin_datacache_heap_la_SOURCES = \
+ plugin_datacache_heap.c
+libgnunet_plugin_datacache_heap_la_LIBADD = \
+ $(top_builddir)/src/lib/util/libgnunetutil.la $(XLIBS) \
+ $(LTLIBINTL)
+libgnunet_plugin_datacache_heap_la_LDFLAGS = \
+ $(GN_PLUGIN_LDFLAGS)
+
+libgnunet_plugin_datacache_postgres_la_SOURCES = \
+ plugin_datacache_postgres.c
+libgnunet_plugin_datacache_postgres_la_LIBADD = \
+ $(top_builddir)/src/lib/pq/libgnunetpq.la \
+ $(top_builddir)/src/lib/util/libgnunetutil.la \
+ $(GN_PLUGIN_LDFLAGS) -lpq
+libgnunet_plugin_datacache_postgres_la_CPPFLAGS = \
+ $(POSTGRESQL_CPPFLAGS) $(AM_CPPFLAGS)
+libgnunet_plugin_datacache_postgres_la_LDFLAGS = \
+ $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
+
+libgnunet_plugin_datacache_template_la_SOURCES = \
+ plugin_datacache_template.c
+libgnunet_plugin_datacache_template_la_LIBADD = \
+ $(top_builddir)/src/lib/util/libgnunetutil.la $(XLIBS) \
+ $(LTLIBINTL)
+libgnunet_plugin_datacache_template_la_LDFLAGS = \
+ $(GN_PLUGIN_LDFLAGS)
+
+
+EXTRA_DIST = \
+ $(sql_DATA)
diff --git a/src/service/datacache/datacache-0001.sql
b/src/plugin/datacache/datacache-0001.sql
similarity index 100%
rename from src/service/datacache/datacache-0001.sql
rename to src/plugin/datacache/datacache-0001.sql
diff --git a/src/service/datacache/datacache-drop.sql
b/src/plugin/datacache/datacache-drop.sql
similarity index 100%
rename from src/service/datacache/datacache-drop.sql
rename to src/plugin/datacache/datacache-drop.sql
diff --git a/src/plugin/datacache/meson.build b/src/plugin/datacache/meson.build
new file mode 100644
index 000000000..3c9e7d330
--- /dev/null
+++ b/src/plugin/datacache/meson.build
@@ -0,0 +1,30 @@
+install_data ('datacache-0001.sql',
+ 'datacache-drop.sql',
+ install_dir: get_option('datadir')/'gnunet'/'sql')
+
+shared_module('gnunet_plugin_datacache_sqlite',
+ ['plugin_datacache_sqlite.c'],
+ dependencies: [libgnunetutil_dep,
+ sqlite_dep,
+ libgnunetsq_dep],
+ include_directories: [incdir, configuration_inc],
+ install: true,
+ install_dir: get_option('libdir')/'gnunet')
+
+shared_module('gnunet_plugin_datacache_heap',
+ ['plugin_datacache_heap.c'],
+ dependencies: [libgnunetutil_dep],
+ include_directories: [incdir, configuration_inc],
+ install: true,
+ install_dir: get_option('libdir')/'gnunet')
+
+if pq_dep.found()
+ shared_module('gnunet_plugin_datacache_postgres',
+ ['plugin_datacache_postgres.c'],
+ dependencies: [libgnunetutil_dep,
+ pq_dep,
+ libgnunetpq_dep],
+ include_directories: [incdir, configuration_inc],
+ install: true,
+ install_dir: get_option('libdir')/'gnunet')
+endif
diff --git a/src/service/datacache/plugin_datacache_heap.c
b/src/plugin/datacache/plugin_datacache_heap.c
similarity index 100%
rename from src/service/datacache/plugin_datacache_heap.c
rename to src/plugin/datacache/plugin_datacache_heap.c
diff --git a/src/service/datacache/plugin_datacache_postgres.c
b/src/plugin/datacache/plugin_datacache_postgres.c
similarity index 100%
rename from src/service/datacache/plugin_datacache_postgres.c
rename to src/plugin/datacache/plugin_datacache_postgres.c
diff --git a/src/service/datacache/plugin_datacache_sqlite.c
b/src/plugin/datacache/plugin_datacache_sqlite.c
similarity index 100%
rename from src/service/datacache/plugin_datacache_sqlite.c
rename to src/plugin/datacache/plugin_datacache_sqlite.c
diff --git a/src/service/datacache/plugin_datacache_template.c
b/src/plugin/datacache/plugin_datacache_template.c
similarity index 100%
rename from src/service/datacache/plugin_datacache_template.c
rename to src/plugin/datacache/plugin_datacache_template.c
diff --git a/src/service/datastore/Makefile.am
b/src/plugin/datastore/Makefile.am
similarity index 55%
copy from src/service/datastore/Makefile.am
copy to src/plugin/datastore/Makefile.am
index 9ae5004c6..1f4ab59c8 100644
--- a/src/service/datastore/Makefile.am
+++ b/src/plugin/datastore/Makefile.am
@@ -7,9 +7,6 @@ pkgcfgdir= $(pkgdatadir)/config.d/
libexecdir= $(pkglibdir)/libexec/
-pkgcfg_DATA = \
- datastore.conf
-
sqldir = $(prefix)/share/gnunet/sql/
sql_DATA = \
@@ -22,39 +19,13 @@ if USE_COVERAGE
endif
-lib_LTLIBRARIES = \
- libgnunetdatastore.la
-
-libgnunetdatastore_la_SOURCES = \
- datastore_api.c datastore.h
-libgnunetdatastore_la_LIBADD = \
- $(top_builddir)/src/service/statistics/libgnunetstatistics.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la \
- $(GN_LIBINTL)
-libgnunetdatastore_la_LDFLAGS = \
- $(GN_LIB_LDFLAGS) \
- -version-info 1:0:0
-
-libexec_PROGRAMS = \
- gnunet-service-datastore
-
-gnunet_service_datastore_SOURCES = \
- gnunet-service-datastore.c
-gnunet_service_datastore_LDADD = \
- $(top_builddir)/src/service/statistics/libgnunetstatistics.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la \
- $(GN_LIBINTL)
-
if HAVE_SQLITE
SQLITE_PLUGIN = libgnunet_plugin_datastore_sqlite.la
if HAVE_BENCHMARKS
SQLITE_BENCHMARKS = \
- perf_datastore_api_sqlite \
perf_plugin_datastore_sqlite
endif
SQLITE_TESTS = \
- test_datastore_api_sqlite \
- test_datastore_api_management_sqlite \
test_plugin_datastore_sqlite \
$(SQLITE_BENCHMARKS)
endif
@@ -62,12 +33,9 @@ if HAVE_POSTGRESQL
POSTGRES_PLUGIN = libgnunet_plugin_datastore_postgres.la
if HAVE_BENCHMARKS
POSTGRES_BENCHMARKS = \
- perf_datastore_api_postgres \
perf_plugin_datastore_postgres
endif
POSTGRES_TESTS = \
- test_datastore_api_postgres \
- test_datastore_api_management_postgres \
test_plugin_datastore_postgres \
$(POSTGRES_BENCHMARKS)
endif
@@ -87,7 +55,6 @@ libgnunet_plugin_datastore_sqlite_la_SOURCES = \
plugin_datastore_sqlite.c
libgnunet_plugin_datastore_sqlite_la_LIBADD = \
$(top_builddir)/src/lib/sq/libgnunetsq.la \
- $(top_builddir)/src/service/statistics/libgnunetstatistics.la \
$(top_builddir)/src/lib/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
$(LTLIBINTL)
libgnunet_plugin_datastore_sqlite_la_LDFLAGS = \
@@ -106,7 +73,6 @@ libgnunet_plugin_datastore_heap_la_LDFLAGS = \
libgnunet_plugin_datastore_postgres_la_SOURCES = \
plugin_datastore_postgres.c
libgnunet_plugin_datastore_postgres_la_LIBADD = \
- $(top_builddir)/src/service/statistics/libgnunetstatistics.la \
$(top_builddir)/src/lib/pq/libgnunetpq.la \
$(top_builddir)/src/lib/util/libgnunetutil.la $(XLIBS) -lpq
libgnunet_plugin_datastore_postgres_la_LDFLAGS = \
@@ -124,9 +90,6 @@ libgnunet_plugin_datastore_template_la_LDFLAGS = \
$(GN_PLUGIN_LDFLAGS)
check_PROGRAMS = \
- test_datastore_api_heap \
- test_datastore_api_management_heap \
- perf_datastore_api_heap \
perf_plugin_datastore_heap \
test_plugin_datastore_heap \
$(SQLITE_TESTS) \
@@ -137,27 +100,6 @@ AM_TESTS_ENVIRONMENT=export
GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PAT
TESTS = $(check_PROGRAMS)
endif
-test_datastore_api_heap_SOURCES = \
- test_datastore_api.c
-test_datastore_api_heap_LDADD = \
- $(top_builddir)/src/service/testing/libgnunettesting.la \
- libgnunetdatastore.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la
-
-test_datastore_api_management_heap_SOURCES = \
- test_datastore_api_management.c
-test_datastore_api_management_heap_LDADD = \
- $(top_builddir)/src/service/testing/libgnunettesting.la \
- libgnunetdatastore.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la
-
-perf_datastore_api_heap_SOURCES = \
- perf_datastore_api.c
-perf_datastore_api_heap_LDADD = \
- $(top_builddir)/src/service/testing/libgnunettesting.la \
- libgnunetdatastore.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la
-
perf_plugin_datastore_heap_SOURCES = \
perf_plugin_datastore.c
perf_plugin_datastore_heap_LDADD = \
@@ -171,27 +113,6 @@ test_plugin_datastore_heap_LDADD = \
$(top_builddir)/src/lib/util/libgnunetutil.la
-test_datastore_api_sqlite_SOURCES = \
- test_datastore_api.c
-test_datastore_api_sqlite_LDADD = \
- $(top_builddir)/src/service/testing/libgnunettesting.la \
- libgnunetdatastore.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la
-
-test_datastore_api_management_sqlite_SOURCES = \
- test_datastore_api_management.c
-test_datastore_api_management_sqlite_LDADD = \
- $(top_builddir)/src/service/testing/libgnunettesting.la \
- libgnunetdatastore.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la
-
-perf_datastore_api_sqlite_SOURCES = \
- perf_datastore_api.c
-perf_datastore_api_sqlite_LDADD = \
- $(top_builddir)/src/service/testing/libgnunettesting.la \
- libgnunetdatastore.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la
-
perf_plugin_datastore_sqlite_SOURCES = \
perf_plugin_datastore.c
perf_plugin_datastore_sqlite_LDADD = \
@@ -205,27 +126,6 @@ test_plugin_datastore_sqlite_LDADD = \
$(top_builddir)/src/lib/util/libgnunetutil.la
-test_datastore_api_postgres_SOURCES = \
- test_datastore_api.c
-test_datastore_api_postgres_LDADD = \
- $(top_builddir)/src/service/testing/libgnunettesting.la \
- libgnunetdatastore.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la
-
-test_datastore_api_management_postgres_SOURCES = \
- test_datastore_api_management.c
-test_datastore_api_management_postgres_LDADD = \
- $(top_builddir)/src/service/testing/libgnunettesting.la \
- libgnunetdatastore.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la
-
-perf_datastore_api_postgres_SOURCES = \
- perf_datastore_api.c
-perf_datastore_api_postgres_LDADD = \
- $(top_builddir)/src/service/testing/libgnunettesting.la \
- libgnunetdatastore.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la
-
test_plugin_datastore_postgres_SOURCES = \
test_plugin_datastore.c
test_plugin_datastore_postgres_LDADD = \
@@ -241,13 +141,10 @@ perf_plugin_datastore_postgres_LDADD = \
EXTRA_DIST = \
test_defaults.conf \
- test_datastore_api_data_sqlite.conf \
perf_plugin_datastore_data_sqlite.conf \
test_plugin_datastore_data_sqlite.conf \
- test_datastore_api_data_heap.conf \
perf_plugin_datastore_data_heap.conf \
test_plugin_datastore_data_heap.conf \
- test_datastore_api_data_postgres.conf \
perf_plugin_datastore_data_postgres.conf \
test_plugin_datastore_data_postgres.conf \
$(sql_DATA)
diff --git a/src/service/datastore/datastore-0001.sql
b/src/plugin/datastore/datastore-0001.sql
similarity index 100%
rename from src/service/datastore/datastore-0001.sql
rename to src/plugin/datastore/datastore-0001.sql
diff --git a/src/service/datastore/datastore-drop.sql
b/src/plugin/datastore/datastore-drop.sql
similarity index 100%
rename from src/service/datastore/datastore-drop.sql
rename to src/plugin/datastore/datastore-drop.sql
diff --git a/src/plugin/datastore/meson.build b/src/plugin/datastore/meson.build
new file mode 100644
index 000000000..6769cb78b
--- /dev/null
+++ b/src/plugin/datastore/meson.build
@@ -0,0 +1,75 @@
+install_data ('datastore-0001.sql',
+ 'datastore-drop.sql',
+ install_dir: get_option('datadir')/'gnunet'/'sql')
+
+shared_module('gnunet_plugin_datastore_sqlite',
+ ['plugin_datastore_sqlite.c'],
+ dependencies: [libgnunetutil_dep,
+ sqlite_dep,
+ libgnunetsq_dep],
+ include_directories: [incdir, configuration_inc],
+ install: true,
+ install_dir: get_option('libdir')/'gnunet')
+
+shared_module('gnunet_plugin_datastore_heap',
+ ['plugin_datastore_heap.c'],
+ dependencies: [libgnunetutil_dep],
+ include_directories: [incdir, configuration_inc],
+ install: true,
+ install_dir: get_option('libdir')/'gnunet')
+
+if pq_dep.found()
+ shared_module('gnunet_plugin_datastore_postgres',
+ ['plugin_datastore_postgres.c'],
+ dependencies: [libgnunetutil_dep,
+ pq_dep,
+ libgnunetpq_dep],
+ include_directories: [incdir, configuration_inc],
+ install: true,
+ install_dir: get_option('libdir')/'gnunet')
+endif
+
+testds_plugin_sqlite = executable ('test_plugin_datastore_sqlite',
+ ['test_plugin_datastore.c'],
+ dependencies: [
+ libgnunetutil_dep,
+ ],
+ include_directories: [incdir, configuration_inc],
+ install: false)
+
+testds_plugin_heap = executable ('test_plugin_datastore_heap',
+ ['test_plugin_datastore.c'],
+ dependencies: [
+ libgnunetutil_dep,
+ ],
+ include_directories: [incdir, configuration_inc],
+ install: false)
+
+testds_plugin_pq = executable ('test_plugin_datastore_postgres',
+ ['test_plugin_datastore.c'],
+ dependencies: [
+ libgnunetutil_dep,
+ ],
+ include_directories: [incdir, configuration_inc],
+ install: false)
+
+configure_file(input : 'test_defaults.conf',
+ output : 'test_defaults.conf',
+ copy: true)
+configure_file(input : 'test_plugin_datastore_data_sqlite.conf',
+ output : 'test_plugin_datastore_data_sqlite.conf',
+ copy: true)
+configure_file(input : 'test_plugin_datastore_data_heap.conf',
+ output : 'test_plugin_datastore_data_heap.conf',
+ copy: true)
+configure_file(input : 'test_plugin_datastore_data_postgres.conf',
+ output : 'test_plugin_datastore_data_postgres.conf',
+ copy: true)
+
+test('test_plugin_datastore_sqlite', testds_plugin_sqlite,
+ suite: 'datastore', workdir: meson.current_build_dir())
+test('test_plugin_datastore_heap', testds_plugin_heap,
+ suite: 'datastore', workdir: meson.current_build_dir())
+test('test_plugin_datastore_postgres', testds_plugin_pq,
+ suite: 'datastore', workdir: meson.current_build_dir())
+
diff --git a/src/service/datastore/perf_plugin_datastore.c
b/src/plugin/datastore/perf_plugin_datastore.c
similarity index 100%
rename from src/service/datastore/perf_plugin_datastore.c
rename to src/plugin/datastore/perf_plugin_datastore.c
diff --git a/src/service/datastore/perf_plugin_datastore_data_heap.conf
b/src/plugin/datastore/perf_plugin_datastore_data_heap.conf
similarity index 100%
rename from src/service/datastore/perf_plugin_datastore_data_heap.conf
rename to src/plugin/datastore/perf_plugin_datastore_data_heap.conf
diff --git a/src/service/datastore/perf_plugin_datastore_data_postgres.conf
b/src/plugin/datastore/perf_plugin_datastore_data_postgres.conf
similarity index 100%
rename from src/service/datastore/perf_plugin_datastore_data_postgres.conf
rename to src/plugin/datastore/perf_plugin_datastore_data_postgres.conf
diff --git a/src/service/datastore/perf_plugin_datastore_data_sqlite.conf
b/src/plugin/datastore/perf_plugin_datastore_data_sqlite.conf
similarity index 100%
rename from src/service/datastore/perf_plugin_datastore_data_sqlite.conf
rename to src/plugin/datastore/perf_plugin_datastore_data_sqlite.conf
diff --git a/src/service/datastore/plugin_datastore_heap.c
b/src/plugin/datastore/plugin_datastore_heap.c
similarity index 100%
rename from src/service/datastore/plugin_datastore_heap.c
rename to src/plugin/datastore/plugin_datastore_heap.c
diff --git a/src/service/datastore/plugin_datastore_postgres.c
b/src/plugin/datastore/plugin_datastore_postgres.c
similarity index 100%
rename from src/service/datastore/plugin_datastore_postgres.c
rename to src/plugin/datastore/plugin_datastore_postgres.c
diff --git a/src/service/datastore/plugin_datastore_sqlite.c
b/src/plugin/datastore/plugin_datastore_sqlite.c
similarity index 100%
rename from src/service/datastore/plugin_datastore_sqlite.c
rename to src/plugin/datastore/plugin_datastore_sqlite.c
diff --git a/src/service/datastore/plugin_datastore_template.c
b/src/plugin/datastore/plugin_datastore_template.c
similarity index 100%
rename from src/service/datastore/plugin_datastore_template.c
rename to src/plugin/datastore/plugin_datastore_template.c
diff --git a/src/service/datastore/test_plugin_datastore.c
b/src/plugin/datastore/test_plugin_datastore.c
similarity index 100%
rename from src/service/datastore/test_plugin_datastore.c
rename to src/plugin/datastore/test_plugin_datastore.c
diff --git a/src/service/datastore/test_plugin_datastore_data_heap.conf
b/src/plugin/datastore/test_plugin_datastore_data_heap.conf
similarity index 100%
rename from src/service/datastore/test_plugin_datastore_data_heap.conf
rename to src/plugin/datastore/test_plugin_datastore_data_heap.conf
diff --git a/src/service/datastore/test_plugin_datastore_data_postgres.conf
b/src/plugin/datastore/test_plugin_datastore_data_postgres.conf
similarity index 100%
rename from src/service/datastore/test_plugin_datastore_data_postgres.conf
rename to src/plugin/datastore/test_plugin_datastore_data_postgres.conf
diff --git a/src/service/datastore/test_plugin_datastore_data_sqlite.conf
b/src/plugin/datastore/test_plugin_datastore_data_sqlite.conf
similarity index 100%
rename from src/service/datastore/test_plugin_datastore_data_sqlite.conf
rename to src/plugin/datastore/test_plugin_datastore_data_sqlite.conf
diff --git a/src/plugin/meson.build b/src/plugin/meson.build
index d0e0806da..81366b016 100644
--- a/src/plugin/meson.build
+++ b/src/plugin/meson.build
@@ -1,5 +1,7 @@
subdir('block')
subdir('gnsrecord')
+subdir('datacache')
+subdir('datastore')
subdir('namecache')
subdir('namestore')
subdir('revocation')
diff --git a/src/service/datacache/Makefile.am
b/src/service/datacache/Makefile.am
index 9caeac543..022b45253 100644
--- a/src/service/datacache/Makefile.am
+++ b/src/service/datacache/Makefile.am
@@ -8,25 +8,11 @@ pkgcfgdir= $(pkgdatadir)/config.d/
dist_pkgcfg_DATA = \
datacache.conf
-sqldir = $(prefix)/share/gnunet/sql/
-
-sql_DATA = \
- datacache-0001.sql \
- datacache-drop.sql
-
-
if USE_COVERAGE
AM_CFLAGS = --coverage -O0
XLIBS = -lgcov
endif
-if HAVE_SQLITE
- SQLITE_PLUGIN = libgnunet_plugin_datacache_sqlite.la
-endif
-if HAVE_POSTGRESQL
- POSTGRES_PLUGIN = libgnunet_plugin_datacache_postgres.la
-endif
-
lib_LTLIBRARIES = \
libgnunetdatacache.la
@@ -41,57 +27,6 @@ libgnunetdatacache_la_LDFLAGS = \
-version-info 0:1:0
-plugin_LTLIBRARIES = \
- $(SQLITE_PLUGIN) \
- $(POSTGRES_PLUGIN) \
- libgnunet_plugin_datacache_heap.la
-
-# Real plugins should of course go into
-# plugin_LTLIBRARIES
-noinst_LTLIBRARIES = \
- libgnunet_plugin_datacache_template.la
-
-
-libgnunet_plugin_datacache_sqlite_la_SOURCES = \
- plugin_datacache_sqlite.c
-libgnunet_plugin_datacache_sqlite_la_LIBADD = \
- $(top_builddir)/src/service/statistics/libgnunetstatistics.la \
- $(top_builddir)/src/lib/sq/libgnunetsq.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
- $(LTLIBINTL)
-libgnunet_plugin_datacache_sqlite_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS)
-
-libgnunet_plugin_datacache_heap_la_SOURCES = \
- plugin_datacache_heap.c
-libgnunet_plugin_datacache_heap_la_LIBADD = \
- $(top_builddir)/src/service/statistics/libgnunetstatistics.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL)
-libgnunet_plugin_datacache_heap_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS)
-
-libgnunet_plugin_datacache_postgres_la_SOURCES = \
- plugin_datacache_postgres.c
-libgnunet_plugin_datacache_postgres_la_LIBADD = \
- $(top_builddir)/src/lib/pq/libgnunetpq.la \
- $(top_builddir)/src/service/statistics/libgnunetstatistics.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la \
- $(GN_PLUGIN_LDFLAGS) -lpq
-libgnunet_plugin_datacache_postgres_la_CPPFLAGS = \
- $(POSTGRESQL_CPPFLAGS) $(AM_CPPFLAGS)
-libgnunet_plugin_datacache_postgres_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
-
-libgnunet_plugin_datacache_template_la_SOURCES = \
- plugin_datacache_template.c
-libgnunet_plugin_datacache_template_la_LIBADD = \
- $(top_builddir)/src/lib/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL)
-libgnunet_plugin_datacache_template_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS)
-
-
if HAVE_SQLITE
SQLITE_TESTS = \
test_datacache_sqlite \
@@ -166,5 +101,4 @@ test_datacache_quota_postgres_LDADD = \
EXTRA_DIST = \
test_datacache_data_sqlite.conf \
test_datacache_data_heap.conf \
- test_datacache_data_postgres.conf \
- $(sql_DATA)
+ test_datacache_data_postgres.conf
diff --git a/src/service/datacache/meson.build
b/src/service/datacache/meson.build
index 528885c0d..f50036c03 100644
--- a/src/service/datacache/meson.build
+++ b/src/service/datacache/meson.build
@@ -5,9 +5,6 @@ configure_file(input : 'datacache.conf',
configuration : cdata,
install: true,
install_dir: pkgcfgdir)
-install_data ('datacache-0001.sql',
- 'datacache-drop.sql',
- install_dir: get_option('datadir')/'gnunet'/'sql')
if get_option('monolith')
foreach p : libgnunetdatacache_src
@@ -27,36 +24,6 @@ libgnunetdatacache_dep = declare_dependency(link_with :
libgnunetdatacache)
pkg.generate(libgnunetdatacache, url: 'https://www.gnunet.org',
description : 'Provides datacache API for temporary storage to
disk')
-shared_module('gnunet_plugin_datacache_sqlite',
- ['plugin_datacache_sqlite.c'],
- dependencies: [libgnunetutil_dep,
- libgnunetdatacache_dep,
- sqlite_dep,
- libgnunetsq_dep],
- include_directories: [incdir, configuration_inc],
- install: true,
- install_dir: get_option('libdir')/'gnunet')
-
-shared_module('gnunet_plugin_datacache_heap',
- ['plugin_datacache_heap.c'],
- dependencies: [libgnunetutil_dep,
- libgnunetdatacache_dep],
- include_directories: [incdir, configuration_inc],
- install: true,
- install_dir: get_option('libdir')/'gnunet')
-
-if pq_dep.found()
- shared_module('gnunet_plugin_datacache_postgres',
- ['plugin_datacache_postgres.c'],
- dependencies: [libgnunetutil_dep,
- libgnunetdatacache_dep,
- pq_dep,
- libgnunetpq_dep],
- include_directories: [incdir, configuration_inc],
- install: true,
- install_dir: get_option('libdir')/'gnunet')
-endif
-
testdc_sqlite = executable ('test_datacache_sqlite',
['test_datacache.c'],
dependencies: [
diff --git a/src/service/datastore/Makefile.am
b/src/service/datastore/Makefile.am
index 9ae5004c6..22f98482a 100644
--- a/src/service/datastore/Makefile.am
+++ b/src/service/datastore/Makefile.am
@@ -10,12 +10,6 @@ libexecdir= $(pkglibdir)/libexec/
pkgcfg_DATA = \
datastore.conf
-sqldir = $(prefix)/share/gnunet/sql/
-
-sql_DATA = \
- datastore-0001.sql \
- datastore-drop.sql
-
if USE_COVERAGE
AM_CFLAGS = --coverage -O0
XLIBS = -lgcov
@@ -46,89 +40,30 @@ gnunet_service_datastore_LDADD = \
$(GN_LIBINTL)
if HAVE_SQLITE
- SQLITE_PLUGIN = libgnunet_plugin_datastore_sqlite.la
if HAVE_BENCHMARKS
SQLITE_BENCHMARKS = \
- perf_datastore_api_sqlite \
- perf_plugin_datastore_sqlite
+ perf_datastore_api_sqlite
endif
SQLITE_TESTS = \
test_datastore_api_sqlite \
test_datastore_api_management_sqlite \
- test_plugin_datastore_sqlite \
$(SQLITE_BENCHMARKS)
endif
if HAVE_POSTGRESQL
- POSTGRES_PLUGIN = libgnunet_plugin_datastore_postgres.la
if HAVE_BENCHMARKS
POSTGRES_BENCHMARKS = \
- perf_datastore_api_postgres \
- perf_plugin_datastore_postgres
+ perf_datastore_api_postgres
endif
POSTGRES_TESTS = \
test_datastore_api_postgres \
test_datastore_api_management_postgres \
- test_plugin_datastore_postgres \
$(POSTGRES_BENCHMARKS)
endif
-plugin_LTLIBRARIES = \
- $(SQLITE_PLUGIN) \
- $(POSTGRES_PLUGIN) \
- libgnunet_plugin_datastore_heap.la
-
-# Real plugins should of course go into
-# plugin_LTLIBRARIES
-noinst_LTLIBRARIES = \
- libgnunet_plugin_datastore_template.la
-
-
-libgnunet_plugin_datastore_sqlite_la_SOURCES = \
- plugin_datastore_sqlite.c
-libgnunet_plugin_datastore_sqlite_la_LIBADD = \
- $(top_builddir)/src/lib/sq/libgnunetsq.la \
- $(top_builddir)/src/service/statistics/libgnunetstatistics.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
- $(LTLIBINTL)
-libgnunet_plugin_datastore_sqlite_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS)
-
-
-libgnunet_plugin_datastore_heap_la_SOURCES = \
- plugin_datastore_heap.c
-libgnunet_plugin_datastore_heap_la_LIBADD = \
- $(top_builddir)/src/lib/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL)
-libgnunet_plugin_datastore_heap_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS)
-
-
-libgnunet_plugin_datastore_postgres_la_SOURCES = \
- plugin_datastore_postgres.c
-libgnunet_plugin_datastore_postgres_la_LIBADD = \
- $(top_builddir)/src/service/statistics/libgnunetstatistics.la \
- $(top_builddir)/src/lib/pq/libgnunetpq.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la $(XLIBS) -lpq
-libgnunet_plugin_datastore_postgres_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
-libgnunet_plugin_datastore_postgres_la_CPPFLAGS = \
- $(POSTGRESQL_CPPFLAGS) $(AM_CPPFLAGS)
-
-
-libgnunet_plugin_datastore_template_la_SOURCES = \
- plugin_datastore_template.c
-libgnunet_plugin_datastore_template_la_LIBADD = \
- $(top_builddir)/src/lib/util/libgnunetutil.la $(XLIBS) \
- $(LTLIBINTL)
-libgnunet_plugin_datastore_template_la_LDFLAGS = \
- $(GN_PLUGIN_LDFLAGS)
-
check_PROGRAMS = \
test_datastore_api_heap \
test_datastore_api_management_heap \
perf_datastore_api_heap \
- perf_plugin_datastore_heap \
- test_plugin_datastore_heap \
$(SQLITE_TESTS) \
$(POSTGRES_TESTS)
@@ -158,19 +93,6 @@ perf_datastore_api_heap_LDADD = \
libgnunetdatastore.la \
$(top_builddir)/src/lib/util/libgnunetutil.la
-perf_plugin_datastore_heap_SOURCES = \
- perf_plugin_datastore.c
-perf_plugin_datastore_heap_LDADD = \
- $(top_builddir)/src/service/testing/libgnunettesting.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la
-
-test_plugin_datastore_heap_SOURCES = \
- test_plugin_datastore.c
-test_plugin_datastore_heap_LDADD = \
- $(top_builddir)/src/service/testing/libgnunettesting.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la
-
-
test_datastore_api_sqlite_SOURCES = \
test_datastore_api.c
test_datastore_api_sqlite_LDADD = \
@@ -192,19 +114,6 @@ perf_datastore_api_sqlite_LDADD = \
libgnunetdatastore.la \
$(top_builddir)/src/lib/util/libgnunetutil.la
-perf_plugin_datastore_sqlite_SOURCES = \
- perf_plugin_datastore.c
-perf_plugin_datastore_sqlite_LDADD = \
- $(top_builddir)/src/service/testing/libgnunettesting.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la
-
-test_plugin_datastore_sqlite_SOURCES = \
- test_plugin_datastore.c
-test_plugin_datastore_sqlite_LDADD = \
- $(top_builddir)/src/service/testing/libgnunettesting.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la
-
-
test_datastore_api_postgres_SOURCES = \
test_datastore_api.c
test_datastore_api_postgres_LDADD = \
@@ -226,28 +135,8 @@ perf_datastore_api_postgres_LDADD = \
libgnunetdatastore.la \
$(top_builddir)/src/lib/util/libgnunetutil.la
-test_plugin_datastore_postgres_SOURCES = \
- test_plugin_datastore.c
-test_plugin_datastore_postgres_LDADD = \
- $(top_builddir)/src/service/testing/libgnunettesting.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la
-
-perf_plugin_datastore_postgres_SOURCES = \
- perf_plugin_datastore.c
-perf_plugin_datastore_postgres_LDADD = \
- $(top_builddir)/src/service/testing/libgnunettesting.la \
- $(top_builddir)/src/lib/util/libgnunetutil.la
-
-
EXTRA_DIST = \
test_defaults.conf \
test_datastore_api_data_sqlite.conf \
- perf_plugin_datastore_data_sqlite.conf \
- test_plugin_datastore_data_sqlite.conf \
test_datastore_api_data_heap.conf \
- perf_plugin_datastore_data_heap.conf \
- test_plugin_datastore_data_heap.conf \
- test_datastore_api_data_postgres.conf \
- perf_plugin_datastore_data_postgres.conf \
- test_plugin_datastore_data_postgres.conf \
- $(sql_DATA)
+ test_datastore_api_data_postgres.conf
diff --git a/src/service/datastore/meson.build
b/src/service/datastore/meson.build
index 9dde488a0..b81d8bb86 100644
--- a/src/service/datastore/meson.build
+++ b/src/service/datastore/meson.build
@@ -8,10 +8,6 @@ configure_file(input : 'datastore.conf.in',
install: true,
install_dir: pkgcfgdir)
-install_data ('datastore-0001.sql',
- 'datastore-drop.sql',
- install_dir: get_option('datadir')/'gnunet'/'sql')
-
if get_option('monolith')
foreach p : libgnunetdatastore_src + gnunetservicedatastore_src
gnunet_src += 'datastore/' + p
@@ -32,36 +28,6 @@ libgnunetdatastore_dep = declare_dependency(link_with :
libgnunetdatastore)
pkg.generate(libgnunetdatastore, url: 'https://www.gnunet.org',
description : 'Management API for the datastore for persistent
storage to disk')
-shared_module('gnunet_plugin_datastore_sqlite',
- ['plugin_datastore_sqlite.c'],
- dependencies: [libgnunetutil_dep,
- libgnunetdatastore_dep,
- sqlite_dep,
- libgnunetsq_dep],
- include_directories: [incdir, configuration_inc],
- install: true,
- install_dir: get_option('libdir')/'gnunet')
-
-shared_module('gnunet_plugin_datastore_heap',
- ['plugin_datastore_heap.c'],
- dependencies: [libgnunetutil_dep,
- libgnunetdatacache_dep],
- include_directories: [incdir, configuration_inc],
- install: true,
- install_dir: get_option('libdir')/'gnunet')
-
-if pq_dep.found()
- shared_module('gnunet_plugin_datastore_postgres',
- ['plugin_datastore_postgres.c'],
- dependencies: [libgnunetutil_dep,
- libgnunetdatastore_dep,
- pq_dep,
- libgnunetpq_dep],
- include_directories: [incdir, configuration_inc],
- install: true,
- install_dir: get_option('libdir')/'gnunet')
-endif
-
executable ('gnunet-service-datastore',
gnunetservicedatastore_src,
dependencies: [libgnunetdatastore_dep,
@@ -92,16 +58,6 @@ testds_mgmt_sqlite = executable
('test_datastore_api_management_sqlite',
include_directories: [incdir, configuration_inc],
install: false)
-testds_plugin_sqlite = executable ('test_plugin_datastore_sqlite',
- ['test_plugin_datastore.c'],
- dependencies: [
- libgnunetdatastore_dep,
- libgnunetutil_dep,
- libgnunettesting_dep
- ],
- include_directories: [incdir, configuration_inc],
- install: false)
-
testds_heap = executable ('test_datastore_api_heap',
['test_datastore_api.c'],
dependencies: [
@@ -122,16 +78,6 @@ testds_mgmt_heap = executable
('test_datastore_api_management_heap',
include_directories: [incdir, configuration_inc],
install: false)
-testds_plugin_heap = executable ('test_plugin_datastore_heap',
- ['test_plugin_datastore.c'],
- dependencies: [
- libgnunetdatastore_dep,
- libgnunetutil_dep,
- libgnunettesting_dep
- ],
- include_directories: [incdir, configuration_inc],
- install: false)
-
testds_pq = executable ('test_datastore_api_postgres',
['test_datastore_api.c'],
dependencies: [
@@ -142,16 +88,6 @@ testds_pq = executable ('test_datastore_api_postgres',
include_directories: [incdir, configuration_inc],
install: false)
-testds_plugin_pq = executable ('test_plugin_datastore_postgres',
- ['test_plugin_datastore.c'],
- dependencies: [
- libgnunetdatastore_dep,
- libgnunetutil_dep,
- libgnunettesting_dep
- ],
- include_directories: [incdir, configuration_inc],
- install: false)
-
testds_mgmt_pq = executable ('test_datastore_api_management_postgres',
['test_datastore_api_management.c'],
dependencies: [
@@ -179,18 +115,12 @@ test('test_datastore_api_sqlite', testds_sqlite,
suite: 'datastore', workdir: meson.current_build_dir())
test('test_datastore_api_management_sqlite', testds_mgmt_sqlite,
suite: 'datastore', workdir: meson.current_build_dir())
-test('test_plugin_datastore_sqlite', testds_plugin_sqlite,
- suite: 'datastore', workdir: meson.current_build_dir())
test('test_datastore_api_heap', testds_heap,
suite: 'datastore', workdir: meson.current_build_dir())
test('test_datastore_api_management_heap', testds_mgmt_heap,
suite: 'datastore', workdir: meson.current_build_dir())
-test('test_plugin_datastore_heap', testds_plugin_heap,
- suite: 'datastore', workdir: meson.current_build_dir())
test('test_datastore_api_postgres', testds_pq,
suite: 'datastore', workdir: meson.current_build_dir())
test('test_datastore_api_management_postgres', testds_mgmt_pq,
suite: 'datastore', workdir: meson.current_build_dir())
-test('test_plugin_datastore_postgres', testds_plugin_pq,
- suite: 'datastore', workdir: meson.current_build_dir())
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: DATASTORE: Move DB plugins to plugin dir,
gnunet <=