Skip to content

Commit

Permalink
Put Windows Zeek in below Git path
Browse files Browse the repository at this point in the history
  • Loading branch information
philrz committed Dec 29, 2023
1 parent f56ffd2 commit afff038
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
mkdir zeek-src\build
cd zeek-src\build
cmake.exe .. -DCMAKE_BUILD_TYPE=release -DENABLE_ZEEK_UNIT_TESTS=yes -D CMAKE_INSTALL_PREFIX=/usr/local/zeek -DLibMMDB_INCLUDE_DIR="C:\Program Files (x86)\maxminddb\include" -DLibMMDB_LIBRARY="C:\Program Files (x86)\maxminddb\lib\maxminddb.lib" -G Ninja
cmake.exe .. -DCMAKE_BUILD_TYPE=release -DENABLE_ZEEK_UNIT_TESTS=yes -D CMAKE_INSTALL_PREFIX="C:\Program Files\Git\usr\local\zeek" -DLibMMDB_INCLUDE_DIR="C:\Program Files (x86)\maxminddb\include" -DLibMMDB_LIBRARY="C:\Program Files (x86)\maxminddb\lib\maxminddb.lib" -G Ninja
cmake.exe --build .
cmake.exe --install .
cd
Expand Down
18 changes: 8 additions & 10 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ case $(uname) in
Darwin|Linux)
sudo=sudo
zip=zip
zeekpath=/usr/local/zeek
;;
*_NT-*)
exe=.exe
zip=/c/msys64/usr/bin/zip
zeekpath=/d/usr/local/zeek
;;
*)
echo "unknown OS: $(uname)" >&2
Expand All @@ -34,21 +32,21 @@ install_zeek_package() {
package=${github_repo#*/}
mkdir $package
(
export PATH=$zeekpath/bin:$PATH
export PATH=/usr/local/zeek/bin:$PATH
cd $package
curl -sL https://github.com/$github_repo/tarball/$git_ref |
tar -xzf - --strip-components 1

script_dir=$(zkg_meta package script_dir)
$sudo cp -r "$script_dir" $zeekpath/share/zeek/site/$package/
$sudo cp -r "$script_dir" /usr/local/zeek/share/zeek/site/$package/

build_command=$(zkg_meta package build_command)
if [ "$build_command" ]; then
if [ "$OS" = Windows_NT ]; then
export LDFLAGS='-static -Wl,--allow-multiple-definition'
fi
sh -c "$build_command"
$sudo tar -xf build/*.tgz -C $zeekpath/lib/zeek/plugins
$sudo tar -xf build/*.tgz -C /usr/local/zeek/lib/zeek/plugins
fi

test_command=$(zkg_meta package test_command)
Expand All @@ -60,7 +58,7 @@ install_zeek_package() {
fi
fi

echo "@load $package" | $sudo tee -a $zeekpath/share/zeek/site/local.zeek
echo "@load $package" | $sudo tee -a /usr/local/zeek/share/zeek/site/local.zeek
)
rm -r $package
}
Expand All @@ -70,14 +68,14 @@ $sudo pip3 install btest wheel
install_zeek_package brimdata/geoip-conn c9dd7f0f8d40573189b2ed2bae9fad478743cfdf
install_zeek_package salesforce/hassh 76a47abe9382109ce9ba530e7f1d7014a4a95209
install_zeek_package salesforce/ja3 421dd4f3616b533e6971bb700289c6bb8355e707
echo "@load policy/protocols/conn/community-id-logging" | $sudo tee -a $zeekpath/share/zeek/site/local.zeek
echo "@load policy/protocols/conn/community-id-logging" | $sudo tee -a /usr/local/zeek/share/zeek/site/local.zeek

mkdir -p zeek/bin zeek/lib/zeek zeek/share/zeek
cp zeekrunner$exe zeek/
cp $zeekpath/bin/zeek$exe zeek/bin/
cp -R $zeekpath/lib/zeek/plugins zeek/lib/zeek/
cp /usr/local/zeek/bin/zeek$exe zeek/bin/
cp -R /usr/local/zeek/lib/zeek/plugins zeek/lib/zeek/
for d in base policy site builtin-plugins; do
cp -R $zeekpath/share/zeek/$d zeek/share/zeek/
cp -R /usr/local/zeek/share/zeek/$d zeek/share/zeek/
done

$zip -r zeek-$RELEASE_TAG.$(go env GOOS)-$(go env GOARCH).zip zeek

0 comments on commit afff038

Please sign in to comment.