diff --git a/CMakeLists.txt b/CMakeLists.txt index 259a30672f..16dfaa5dfa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -531,6 +531,9 @@ if ( GooglePerftools_INCLUDE_DIR ) set(ZEEK_CONFIG_GooglePerftools_INCLUDE_DIR ${GooglePerftools_INCLUDE_DIR}) endif () +set(ZEEK_CONFIG_BTEST_TOOLS_DIR ${ZEEK_ROOT_DIR}/share/btest) +install(DIRECTORY DESTINATION ${ZEEK_CONFIG_BTEST_TOOLS_DIR}) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zeek-config.in ${CMAKE_CURRENT_BINARY_DIR}/zeek-config @ONLY) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/zeek-config DESTINATION bin) @@ -568,6 +571,7 @@ endif () add_subdirectory(src) add_subdirectory(scripts) add_subdirectory(man) +add_subdirectory(testing) include(CheckOptionalBuildSources) @@ -600,6 +604,12 @@ if (CMAKE_BUILD_TYPE) string(TOUPPER ${CMAKE_BUILD_TYPE} BuildType) endif () +if ( INSTALL_BTEST_PCAPS ) + set(_install_btest_tools_msg "all") +else () + set(_install_btest_tools_msg "no pcaps") +endif () + message( "\n====================| Zeek Build Summary |====================" "\n" @@ -621,6 +631,7 @@ message( "\nZeekControl: ${INSTALL_ZEEKCTL}" "\nAux. Tools: ${INSTALL_AUX_TOOLS}" "\nBTest: ${INSTALL_BTEST}" + "\nBTest tooling: ${_install_btest_tools_msg}" "\nzkg: ${INSTALL_ZKG}" "\n" "\nlibmaxminddb: ${USE_GEOIP}" diff --git a/configure b/configure index 5cb2c9e66b..5b8f195c45 100755 --- a/configure +++ b/configure @@ -65,6 +65,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]... --disable-auxtools don't build or install auxiliary tools --disable-archiver don't build or install zeek-archiver tool --disable-btest don't install BTest + --disable-btest-pcaps don't install Zeek's BTest input pcaps --disable-python don't try to build python bindings for Broker --disable-broker-tests don't try to build Broker unit tests --disable-zkg don't install zkg @@ -161,6 +162,7 @@ append_cache_entry ENABLE_JEMALLOC BOOL false append_cache_entry BUILD_SHARED_LIBS BOOL true append_cache_entry INSTALL_AUX_TOOLS BOOL true append_cache_entry INSTALL_BTEST BOOL true +append_cache_entry INSTALL_BTEST_PCAPS BOOL true append_cache_entry INSTALL_ZEEK_ARCHIVER BOOL true append_cache_entry INSTALL_ZEEKCTL BOOL true append_cache_entry INSTALL_ZKG BOOL true @@ -289,6 +291,9 @@ while [ $# -ne 0 ]; do --disable-btest) append_cache_entry INSTALL_BTEST BOOL false ;; + --disable-btest-pcaps) + append_cache_entry INSTALL_BTEST_PCAPS BOOL false + ;; --disable-python) append_cache_entry DISABLE_PYTHON_BINDINGS BOOL true ;; diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt new file mode 100644 index 0000000000..7ae503924f --- /dev/null +++ b/testing/CMakeLists.txt @@ -0,0 +1,8 @@ +install(DIRECTORY scripts/ DESTINATION ${ZEEK_CONFIG_BTEST_TOOLS_DIR}/scripts + USE_SOURCE_PERMISSIONS + FILES_MATCHING PATTERN "diff-*") +install(FILES btest/random.seed DESTINATION ${ZEEK_CONFIG_BTEST_TOOLS_DIR}/data) + +if ( INSTALL_BTEST_PCAPS ) + install(DIRECTORY btest/Traces/ DESTINATION ${ZEEK_CONFIG_BTEST_TOOLS_DIR}/data/pcaps) +endif () diff --git a/zeek-config.in b/zeek-config.in index 534608b5ad..ccd8e80463 100755 --- a/zeek-config.in +++ b/zeek-config.in @@ -16,6 +16,7 @@ zeek_dist=@ZEEK_DIST@ binpac_root=@ZEEK_CONFIG_BINPAC_ROOT_DIR@ caf_root=@ZEEK_CONFIG_CAF_ROOT_DIR@ broker_root=@ZEEK_CONFIG_BROKER_ROOT_DIR@ +btest_tools_dir=@ZEEK_CONFIG_BTEST_TOOLS_DIR@ add_path() { # $1: existing path @@ -38,7 +39,7 @@ include_dir=$(add_path "$include_dir" "@ZEEK_CONFIG_LibKrb5_INCLUDE_DIR@") include_dir=$(add_path "$include_dir" "@ZEEK_CONFIG_GooglePerftools_INCLUDE_DIR@") usage="\ -Usage: zeek-config [--version] [--build_type] [--prefix] [--lib_dir] [--script_dir] [--site_dir] [--plugin_dir] [--config_dir] [--python_dir] [--include_dir] [--cmake_dir] [--zeekpath] [--zeek_dist] [--binpac_root] [--caf_root] [--broker_root]" +Usage: zeek-config [--version] [--build_type] [--prefix] [--btest_tools_dir] [--lib_dir] [--script_dir] [--site_dir] [--plugin_dir] [--config_dir] [--python_dir] [--include_dir] [--cmake_dir] [--zeekpath] [--zeek_dist] [--binpac_root] [--caf_root] [--broker_root]" if [ $# -eq 0 ] ; then echo "${usage}" 1>&2 @@ -64,6 +65,9 @@ while [ $# -ne 0 ]; do --bropath) # For compatibility with legacy Bro plugins. echo $zeekpath ;; + --btest_tools_dir) + echo $btest_tools_dir + ;; --build_type) echo $build_type ;;