From: Vsevolod Stakhov Date: Thu, 10 Mar 2016 17:35:49 +0000 (+0000) Subject: [Feature] Add LOCAL_CONFDIR option X-Git-Tag: 1.2.0~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=091633c9af89efaf1d93944b90f931b119af2462;p=thirdparty%2Frspamd.git [Feature] Add LOCAL_CONFDIR option --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f8ae533eb9..5a81f80ecd 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 db1a63d975..50a17c0a59 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 8bd633929a..01aca11ef9 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,