Commit graph

21 commits

Author SHA1 Message Date
Robin Sommer
0040111955
Integrate the Spicy plugin into Zeek proper.
This reflects the `spicy-plugin` code as of `d8c296b81cc2a11`.

In addition to moving the code into Zeek's source tree, this comes
with a couple small functional changes:

- `spicyz` no longer tries to infer if it's running from the build
  directory. Instead `ZEEK_SPICY_LIBRARY` can be set to a custom
  location. `zeek-set-path.sh` does that now.

- ZEEK_CONFIG can be set to change what `spicyz -z` print out. This is
  primarily for backwards compatibility.

Some further notes on specifics:

- We raise the minimum Spicy version to 1.8 (i.e., current `main`
  branch).

- Renamed the `compiler/` subdirectory to `spicyz` to avoid
  include-path conflicts with the Spicy headers.

- In `cmake/`, the corresponding PR brings a new/extended version of
  `FindZeek`, which Spicy analyzer packages need. We also now install
  some of the files that the Spicy plugin used to bring for testing,
  so that existing packages keep working.

- For now, this all remains backwards compatible with the current
  `zkg` analyzer templates so that they work with both external and
  integrated Spicy support. Later, once we don't need to support any
  external Spicy plugin versions anymore, we can clean up the
  templates as well.

- All the plugin's tests have moved into the standard test suite. They
  are skipped if configure with `--disable-spicy`.

This holds off on adapting the new code further to Zeek's coding
conventions, so that it remains easier to maintain it in parallel to
the (now legacy) external plugin. We'll make a pass over the
formatting for (presumable) Zeek 6.1.
2023-05-16 10:17:45 +02:00
Tim Wojtulewicz
86839aee34 Surround string assignments in zeek-config in quotes 2023-05-02 11:24:40 -07:00
Arne Welzel
2891b8af44 cmake: Fixup BRO_PLUGIN_INSTALL_PATH references
Commit 19cbb328a9 removed setting of
BRO_PLUGIN_INSTALL_PATH in favor of ZEEK_PLUGIN_DIR. Replace left-over
references the former.
2023-04-24 12:15:37 +02:00
Dominik Charousset
12ea6ed478 Improve CMake variables, update cmake submodule 2023-04-18 21:17:33 +02:00
Dominik Charousset
1d81fb4fb0 Fix builds with plugins that use zeek-config
When building plugins externally with `zeek-config` (as opposed to using
`ZEEK_DIST`), they point into the install prefix. There, we add a new
file `ZeekPluginBootstrap.cmake` that helps `ZeekPlugin.cmake` to find
everything else it needs from there.

Our template for plugins generates a `configure` script that sets
various variables with values from `zeek-config`. We only need
`BROKER_ROOT_DIR` with the new bootstrapping logic. Everything else, we
can get from the new bootstrapping file and from the CMake package file
for Zeek.
2023-04-15 00:08:42 +02:00
Robin Sommer
04a1ead978
Provide infrastructure to migrate legacy analyzers to Spicy.
As initial examples, this branch ports the Syslog and Finger analyzers
over. We leave the old analyzers in place for now and activate them
iff we compile without any Spicy.

Needs `zeek-spicy-infra` branches in `spicy/`, `spicy-plugin/`,
`CMake/`, and `zeek/zeek-testing-private`.

Note that the analyzer events remain associated with the Spicy plugin
for now: that's where they will show up with `-NN`, and also inside
the Zeekygen documentation.

We switch CMake over to linking the runtime library into the plugin,
vs. at the top-level through object libraries.
2023-02-01 11:33:48 +01:00
Tim Wojtulewicz
fb16ce3711 Remove other general deprecations 2022-06-30 19:17:13 +00:00
Tim Wojtulewicz
1232adca38 GH-1980: Deprecate and return warning for zeek-config's caf-root option 2022-02-24 09:10:39 -07:00
Benjamin Bannier
1f388e3f40 Format shell scripts with shfmt.
All changes in this patch were performed automatically with `shfmt` with
configuration flags specified in `.pre-commit-config.yaml`.

In addition to fixing whitespace the roundtrip through shfmt's AST also
transforms command substitutions

    `cmd`
    # becomes
    $(cmd)

and some redirects

    >&2 echo "msg"
    # becomes
    echo >&2 "msg"
2021-11-24 23:13:02 +01:00
Christian Kreibich
d0dae14422 Explain zeek-config options in help output 2021-03-11 13:02:38 -08:00
Christian Kreibich
3b91227567 Sort variables at top of zeek-config alphabetically 2021-03-11 13:02:38 -08:00
Christian Kreibich
463d159bfc Install Zeek's btest tooling with the distribution
This creates $PREFIX/share/btest in the install tree, with the
following folders:

- scripts/ for the canonifiers
- data/ for random.seed
- data/pcaps for the test pcaps

The pcaps can be skipped by configuring with --disable-btest-pcaps.
2021-03-11 13:00:15 -08:00
Christian Kreibich
ca725c1f9b Avoid reporting paths repeatedly in zeek-config --include_dir 2021-03-04 15:40:00 -08:00
Tim Wojtulewicz
0618be792f Remove all of the random single-file deprecations
These are the changes that don't require a ton of changes to other files outside
of the original removal.
2021-01-27 10:52:40 -07:00
Christian Kreibich
ec76b2510a Improve support for custom libdir locations
- Remove hardwiring of $ZEEK_ROOT/lib throughout the three and
  defaults the name of Zeek's library directory to the default on the
  given platform (e.g. lib64), via GNUInstallDirs.

- Consistently use that lib directory, instead of two lib folders
  resulting when using a custom libdir.

- Remove the old lib directory in the installation prefix, if one exists

- Add --lib_dir to zeek-config (and sort its options a bit).

- Bump submodules for corresponding changes
2020-11-19 23:27:10 -08:00
Jon Siwek
a2577891e0 Merge remote-tracking branch 'origin/topic/jsiwek/gh-1180-include-external-headers'
* origin/topic/jsiwek/gh-1180-include-external-headers:
  Add external dependency include paths to `zeek-config --include_dir`
2020-10-02 10:50:14 -07:00
Jon Siwek
f96e10da75 Add external dependency include paths to zeek-config --include_dir
Addresses https://github.com/zeek/zeek/issues/1180

This helps ensure successful compilation of a plugin that includes a
Zeek header which includes an external dependency header even if the
plugin itself doesn't necessarily depend on that external library.
2020-09-24 14:08:26 -07:00
Jon Siwek
9642feeaf2 GH-1068: Add zeek symlink to allow "zeek/Foo.h" include style
Also changes `zeek-config --include_dir` to now output
`$prefix/include:$prefix/include/zeek` instead of only
`$prefix/include/zeek`
2020-07-20 17:54:09 -07:00
Daniel Thayer
5a253d355b Rename directories from bro to zeek 2019-05-24 03:32:14 -05:00
Daniel Thayer
fe3d508796 Additional Bro to Zeek renaming
Most of these changes are either cmake-related or plugin-related.
Added a new test "plugins/legacy.zeek" to test that legacy Bro plugins
still work.

Also added a symlink bro-path-dev.in because some legacy Bro packages
won't install without it.
2019-05-19 16:51:36 -05:00
Robin Sommer
789cb376fd GH-239: Rename bro to zeek, bro-config to zeek-config, and bro-path-dev to zeek-path-dev.
This also installs symlinks from "zeek" and "bro-config" to a wrapper
script that prints a deprecation warning.

The btests pass, but this is still WIP. broctl renaming is still
missing.

#239
2019-05-01 21:43:45 +00:00
Renamed from bro-config.in (Browse further)