aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-03-10 17:35:49 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-03-10 17:35:49 +0000
commit091633c9af89efaf1d93944b90f931b119af2462 (patch)
treec3ef979699fba1ee2169022be1cc17dd00851170
parent83940fa64f41f0cdba8e52326c91c8dca1588b68 (diff)
downloadrspamd-091633c9af89efaf1d93944b90f931b119af2462.tar.gz
rspamd-091633c9af89efaf1d93944b90f931b119af2462.zip
[Feature] Add LOCAL_CONFDIR option
-rw-r--r--CMakeLists.txt5
-rw-r--r--config.h.in1
-rw-r--r--src/libserver/cfg_utils.c5
3 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f8ae533eb..5a81f80ec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -83,6 +83,7 @@ ENDIF()
# Now CMAKE_INSTALL_PREFIX is a base prefix for everything
# CONFDIR - for configuration
+# LOCAL_CONFDIR - for local configuration
# MANDIR - for manual pages
# RUNDIR - for runtime files
# DBDIR - for static files
@@ -93,6 +94,10 @@ IF(NOT CONFDIR)
SET(CONFDIR "${CMAKE_INSTALL_PREFIX}/etc/rspamd")
ENDIF(NOT CONFDIR)
+IF(NOT LOCAL_CONFDIR)
+ SET(LOCAL_CONFDIR "${CONFDIR}")
+ENDIF(NOT LOCAL_CONFDIR)
+
IF(NOT MANDIR)
SET(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
ENDIF(NOT MANDIR)
diff --git a/config.h.in b/config.h.in
index db1a63d97..50a17c0a5 100644
--- a/config.h.in
+++ b/config.h.in
@@ -174,6 +174,7 @@
#define uthash_free(ptr,sz) g_slice_free1(sz, ptr)
#define RSPAMD_CONFDIR "${CONFDIR}"
+#define RSPAMD_LOCAL_CONFDIR "${LOCAL_CONFDIR}"
#define RSPAMD_RUNDIR "${RUNDIR}"
#define RSPAMD_LOGDIR "${LOGDIR}"
#define RSPAMD_DBDIR "${DBDIR}"
diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
index 8bd633929..01aca11ef 100644
--- a/src/libserver/cfg_utils.c
+++ b/src/libserver/cfg_utils.c
@@ -927,6 +927,7 @@ rspamd_include_map_handler (const guchar *data, gsize len,
/*
* Variables:
* $CONFDIR - configuration directory
+ * $LOCAL_CONFDIR - local configuration directory
* $RUNDIR - local states directory
* $DBDIR - databases dir
* $LOGDIR - logs dir
@@ -936,6 +937,7 @@ rspamd_include_map_handler (const guchar *data, gsize len,
*/
#define RSPAMD_CONFDIR_MACRO "CONFDIR"
+#define RSPAMD_LOCAL_CONFDIR_MACRO "LOCAL_CONFDIR"
#define RSPAMD_RUNDIR_MACRO "RUNDIR"
#define RSPAMD_DBDIR_MACRO "DBDIR"
#define RSPAMD_LOGDIR_MACRO "LOGDIR"
@@ -958,6 +960,9 @@ rspamd_ucl_add_conf_variables (struct ucl_parser *parser, GHashTable *vars)
ucl_parser_register_variable (parser,
RSPAMD_CONFDIR_MACRO,
RSPAMD_CONFDIR);
+ ucl_parser_register_variable (parser,
+ RSPAMD_LOCAL_CONFDIR_MACRO,
+ RSPAMD_LOCAL_CONFDIR);
ucl_parser_register_variable (parser, RSPAMD_RUNDIR_MACRO,
RSPAMD_RUNDIR);
ucl_parser_register_variable (parser, RSPAMD_DBDIR_MACRO,