Skip to content

Commit

Permalink
More Bro to Zeek renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
dnthayer committed May 20, 2019
1 parent 3178f31 commit 5e59bf3
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -16,7 +16,7 @@ branches:
notifications:
email:
recipients:
- bro-commits-internal@bro.org
- zeek-commits-internal@zeek.org

before_install: pip install --user btest

Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -60,8 +60,8 @@ macro(AddAuxInstallTarget _target)
endif ()
endmacro(AddAuxInstallTarget)

if ( NOT BRO_MAN_INSTALL_PATH )
set(BRO_MAN_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/share/man)
if ( NOT ZEEK_MAN_INSTALL_PATH )
set(ZEEK_MAN_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/share/man)
endif ()

add_subdirectory(adtrace)
Expand Down
2 changes: 1 addition & 1 deletion plugin-support/skeleton/Makefile
Expand Up @@ -10,7 +10,7 @@ all: build-it
build-it:
@test -e $(cmake_build_dir)/config.status || ./configure
-@test -e $(cmake_build_dir)/CMakeCache.txt && \
test $(cmake_build_dir)/CMakeCache.txt -ot `cat $(cmake_build_dir)/CMakeCache.txt | grep BRO_DIST | cut -d '=' -f 2`/build/CMakeCache.txt && \
test $(cmake_build_dir)/CMakeCache.txt -ot `cat $(cmake_build_dir)/CMakeCache.txt | grep ZEEK_DIST | cut -d '=' -f 2`/build/CMakeCache.txt && \
echo Updating stale CMake cache && \
touch $(cmake_build_dir)/CMakeCache.txt

Expand Down
9 changes: 7 additions & 2 deletions plugin-support/skeleton/configure
Expand Up @@ -154,14 +154,17 @@ if [ -z "$zeekdist" ]; then
append_cache_entry CAF_ROOT_DIR PATH `${zeek_config} --caf_root`
fi
else
# Using legacy bro-config, so we must use the "--bro_dist" option.
zeekdist=`${zeek_config} --bro_dist 2> /dev/null`

if [ ! -e "$zeekdist/zeek-path-dev.in" ]; then
echo "$zeekdist does not appear to be a valid Zeek source tree."
exit 1
fi

append_cache_entry BRO_DIST PATH $zeekdist
# BRO_DIST is needed to support legacy Bro plugins
append_cache_entry BRO_DIST PATH $zeekdist
append_cache_entry ZEEK_DIST PATH $zeekdist
append_cache_entry CMAKE_MODULE_PATH PATH $zeekdist/cmake
fi
else
Expand All @@ -174,7 +177,9 @@ else
exit 1
fi

append_cache_entry BRO_DIST PATH $zeekdist
# BRO_DIST is needed to support legacy Bro plugins
append_cache_entry BRO_DIST PATH $zeekdist
append_cache_entry ZEEK_DIST PATH $zeekdist
append_cache_entry CMAKE_MODULE_PATH PATH $zeekdist/cmake
fi

Expand Down
36 changes: 0 additions & 36 deletions plugin-support/skeleton/tests/Scripts/get-bro-env

This file was deleted.

36 changes: 36 additions & 0 deletions plugin-support/skeleton/tests/Scripts/get-zeek-env
@@ -0,0 +1,36 @@
#! /bin/sh
#
# BTest helper for getting values for Zeek-related environment variables.

base=`dirname $0`
zeek_dist=`cat ${base}/../../build/CMakeCache.txt | grep ZEEK_DIST | cut -d = -f 2`

if [ -n "${zeek_dist}" ]; then
if [ "$1" = "zeekpath" ]; then
${zeek_dist}/build/zeek-path-dev
elif [ "$1" = "zeek_plugin_path" ]; then
( cd ${base}/../.. && pwd )
elif [ "$1" = "path" ]; then
echo ${zeek_dist}/build/src:${zeek_dist}/aux/btest:${base}/:${zeek_dist}/aux/zeek-cut:$PATH
else
echo "usage: `basename $0` <var>" >&2
exit 1
fi
else
# Use Zeek installation for testing. In this case zeek-config must be in PATH.
if ! which zeek-config >/dev/null; then
echo "zeek-config not found" >&2
exit 1
fi

if [ "$1" = "zeekpath" ]; then
zeek-config --zeekpath
elif [ "$1" = "zeek_plugin_path" ]; then
( cd ${base}/../.. && pwd )
elif [ "$1" = "path" ]; then
echo ${PATH}
else
echo "usage: `basename $0` <var>" >&2
exit 1
fi
fi
6 changes: 3 additions & 3 deletions plugin-support/skeleton/tests/btest.cfg
Expand Up @@ -6,10 +6,10 @@ IgnoreDirs = .svn CVS .tmp
IgnoreFiles = *.tmp *.swp #* *.trace .DS_Store

[environment]
BROPATH=`%(testbase)s/Scripts/get-bro-env bropath`
BRO_PLUGIN_PATH=`%(testbase)s/Scripts/get-bro-env bro_plugin_path`
BROPATH=`%(testbase)s/Scripts/get-zeek-env zeekpath`
BRO_PLUGIN_PATH=`%(testbase)s/Scripts/get-zeek-env zeek_plugin_path`
BRO_SEED_FILE=%(testbase)s/random.seed
PATH=`%(testbase)s/Scripts/get-bro-env path`
PATH=`%(testbase)s/Scripts/get-zeek-env path`
TZ=UTC
LC_ALL=C
TRACES=%(testbase)s/Traces
Expand Down
2 changes: 1 addition & 1 deletion zeek-cut/CMakeLists.txt
Expand Up @@ -4,7 +4,7 @@ set(zeekcut_SRCS

add_executable(zeek-cut ${zeekcut_SRCS})

install(FILES zeek-cut.1 DESTINATION ${BRO_MAN_INSTALL_PATH}/man1)
install(FILES zeek-cut.1 DESTINATION ${ZEEK_MAN_INSTALL_PATH}/man1)

# Install wrapper script for Bro-to-Zeek renaming.
include(InstallSymlink)
Expand Down

0 comments on commit 5e59bf3

Please sign in to comment.