diff --git a/CMakeLists.txt b/CMakeLists.txt index 5303341b0d..fb5eb39561 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,27 @@ else () CACHE STRING "Installation path for plugins" FORCE) endif () +if ( NOT ZEEK_ETC_INSTALL_DIR ) + set(ZEEK_ETC_INSTALL_DIR ${ZEEK_ROOT_DIR}/etc) +endif () + +if ( NOT ZEEK_STATE_DIR ) + set(ZEEK_STATE_DIR ${ZEEK_ROOT_DIR}/var/lib) +endif () + +if ( NOT ZEEK_SPOOL_DIR ) + set(ZEEK_SPOOL_DIR ${ZEEK_ROOT_DIR}/spool) +endif () + +if ( NOT ZEEK_LOG_DIR ) + set(ZEEK_LOG_DIR ${ZEEK_ROOT_DIR}/logs) +endif () + +install(DIRECTORY DESTINATION ${ZEEK_ETC_INSTALL_DIR}) +install(DIRECTORY DESTINATION ${ZEEK_STATE_DIR}) +install(DIRECTORY DESTINATION ${ZEEK_SPOOL_DIR}) +install(DIRECTORY DESTINATION ${ZEEK_LOG_DIR}) + configure_file(zeek-path-dev.in ${CMAKE_CURRENT_BINARY_DIR}/zeek-path-dev) execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink "${CMAKE_CURRENT_BINARY_DIR}/zeek-wrapper.in" @@ -612,7 +633,7 @@ if ( INSTALL_ZKG ) # An etc/zkg directory for zkg's config file simplifies zkg's # config file code. set(ZEEK_ZKG_CONFIG_DIR "${ZEEK_ETC_INSTALL_DIR}/zkg") - set(ZEEK_ZKG_STATE_DIR "${ZEEK_ROOT_DIR}/var/lib/zkg") + set(ZEEK_ZKG_STATE_DIR "${ZEEK_STATE_DIR}/zkg") configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zkg-config.in @@ -768,10 +789,16 @@ message( "\n" "\nBuild type: ${CMAKE_BUILD_TYPE}" "\nBuild dir: ${PROJECT_BINARY_DIR}" + "\n" "\nInstall prefix: ${CMAKE_INSTALL_PREFIX}" + "\nConfig file dir: ${ZEEK_ETC_INSTALL_DIR}" + "\nLog dir: ${ZEEK_LOG_DIR}" "\nPlugin dir: ${BRO_PLUGIN_INSTALL_PATH}" "\nPython module dir: ${PY_MOD_INSTALL_DIR}" - "\nZeek Script Path: ${ZEEK_SCRIPT_INSTALL_PATH}" + "\nScript dir: ${ZEEK_SCRIPT_INSTALL_PATH}" + "\nSpool dir: ${ZEEK_SPOOL_DIR}" + "\nState dir: ${ZEEK_STATE_DIR}" + "\n" "\nDebug mode: ${ENABLE_DEBUG}" "\nUnit tests: ${ENABLE_ZEEK_UNIT_TESTS}" "\nBuiltin Plugins: ${ZEEK_BUILTIN_PLUGINS}" diff --git a/configure b/configure index 56adde85cb..8d0ee612b3 100755 --- a/configure +++ b/configure @@ -38,13 +38,12 @@ Usage: $0 [OPTION]... [VAR=VALUE]... --localstatedir=PATH when using ZeekControl, path to store log files and run-time data (within log/ and spool/ subdirs) [PREFIX] - --spooldir=PATH when using ZeekControl, path to store run-time data - [PREFIX/spool] - --logdir=PATH when using ZeekControl, path to store log file - [PREFIX/logs] + --spooldir=PATH directory for in-progress logs [PREFIX/spool] + --statedir=PATH directory for variable state [PREFIX/var/lib] + --logdir=PATH directory for finalized logs [PREFIX/logs] --libdir=PATH installation directory for library files [PREFIX/lib] --plugindir=PATH installation directory for plugins [LIBDIR/zeek/plugin] - --conf-files-dir=PATH config files installation directory [PREFIX/etc] + --conf-files-dir=PATH installation directory for config files [PREFIX/etc] --mandir=PATH installation path for man pages [PREFIX/share/man] --python-dir=PATH explicit installation directory for Python modules --python-prefix=PATH versioned installation directory for Python modules, @@ -256,6 +255,9 @@ while [ $# -ne 0 ]; do --spooldir=*) append_cache_entry ZEEK_SPOOL_DIR PATH $optarg ;; + --statedir=*) + append_cache_entry ZEEK_STATE_DIR PATH $optarg + ;; --logdir=*) append_cache_entry ZEEK_LOG_DIR PATH $optarg ;;