Browse Source

[Feature] Add LOCAL_CONFDIR option

tags/1.2.0
Vsevolod Stakhov 8 years ago
parent
commit
091633c9af
3 changed files with 11 additions and 0 deletions
  1. 5
    0
      CMakeLists.txt
  2. 1
    0
      config.h.in
  3. 5
    0
      src/libserver/cfg_utils.c

+ 5
- 0
CMakeLists.txt View File

@@ -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)

+ 1
- 0
config.h.in View File

@@ -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}"

+ 5
- 0
src/libserver/cfg_utils.c View File

@@ -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,

Loading…
Cancel
Save