@@ -22,12 +22,6 @@ This is the package's metadata file in INI file format and may contain
2222:ref: `additional fields <metadata-fields >` that describe the package as well
2323as how it inter-operates with Zeek, the package manager, or other packages.
2424
25- .. note ::
26-
27- :file: `zkg.meta ` is the canonical metadata file name used :program: `since
28- zkg v2.0 `. The previous metadata file name of :file: `bro-pkg.meta ` is also
29- accepted when no :file: `zkg.meta ` exists.
30-
3125.. _package-shorthand-name :
3226
3327Note that the shorthand name for your package that may be used by :ref: `zkg
@@ -36,7 +30,7 @@ last component of its git URL. E.g. a package at ``https://github.com/zeek/foo``
3630may be referred to as **foo ** when using :program: `zkg ` and a Zeek
3731script that wants to load all the scripts within that package can use:
3832
39- .. code-block :: bro
33+ .. code-block :: zeek
4034
4135 @load foo
4236
@@ -229,11 +223,6 @@ though the following step are the essentials needed to create a package.
229223 script_dir = scripts/Demo/Rot13
230224 build_command = ./configure && make
231225
232- .. note::
233-
234- See :ref:`legacy-bro-support` for notes on configuring packages to
235- support Bro 2.5 or earlier.
236-
237226#. Add example script code:
238227
239228 .. code-block :: console
@@ -257,9 +246,7 @@ though the following step are the essentials needed to create a package.
257246 *p = (*p - b + 13) % 26 + b;
258247 }
259248
260- BroString* bs = new BroString(1, reinterpret_cast<byte_vec>(rot13),
261- strlen(rot13));
262- return new StringVal(bs);
249+ return make_intrusive<StringVal>(strlen(rot13), rot13);
263250 %}
264251
265252#. Commit everything to git:
@@ -576,11 +563,6 @@ An example :file:`zkg.meta`::
576563 script_dir = scripts/Demo/Rot13
577564 build_command = ./configure && make
578565
579- .. note ::
580-
581- See :ref: `legacy-bro-support ` for notes on configuring packages to
582- support Bro 2.5 or earlier.
583-
584566The default CMake skeleton for Zeek plugins will use :file: `build/ ` as the
585567directory for the final/built version of the plugin, which matches the defaulted
586568value of the omitted `plugin_dir ` metadata field.
@@ -591,31 +573,6 @@ script components, the "plugin" part is always unconditionally loaded by Zeek,
591573but the "script" components must either be explicitly loaded (e.g. :samp: `@load
592574{ <package_name> } `) or the package marked as :ref: `loaded <load-command >`.
593575
594- .. _legacy-bro-support :
595-
596- Supporting Older Bro Versions
597- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
598-
599- Plugin skeletons generated before Bro v2.6 and also any packages
600- that generally want to support such Bro versions need to pass
601- an additional configuration option such as::
602-
603- build_command = ./configure --bro-dist=%(bro_dist)s && make
604-
605- See the :ref: `Value Interpolation <metadata-interpolation >`
606- section for more information on what the ``%(bro_dist)s ``
607- string does, but a brief explanation is that it will expand to
608- a path containing the Bro source-code on the user's system.
609- For newer versions of Bro, packages are able to work entirely
610- with the installation path and don't require original source code.
611-
612- Also note that other various Zeek scripting and CMake infrastructure may
613- have changed between Bro v2.6 and Zeek v3.0. So if you plan to support
614- older version of Bro (before the Zeek rename), then you should keep an eye
615- out for various things that got renamed. For example, the `zeek_init ` event
616- won't exist in any version before Zeek v3.0, nor will any CMake macros
617- that start with `zeek_plugin `.
618-
619576.. _metadata-interpolation :
620577
621578Value Interpolation
@@ -624,18 +581,14 @@ Value Interpolation
624581The `build_command field `_ may reference the settings any given user has in
625582their customized :ref: `package manager config file <zkg-config-file >`.
626583
627- For example, if a metadata field's value contains the ``%(bro_dist )s `` string,
584+ For example, if a metadata field's value contains the ``%(zeek_dist )s `` string,
628585then :program: `zkg ` operations that use that field will automatically
629- substitute the actual value of `bro_dist ` that the user has in their local
586+ substitute the actual value of `zeek_dist ` that the user has in their local
630587config file. Note the trailing 's' character at the end of the interpolation
631- string, ``%(bro_dist)s ``, is intended/necessary for all such interpolation
632- usages. Note that :program: `since zkg v2.0 `, `zeek_dist ` is the canonical name
633- for `bro_dist ` within the :ref: `zkg config file <zkg-config-file >`,
634- but either one means the same thing and should work. To support older
635- versions of :program: `bro-pkg `, you'd want to use `bro_dist ` in package
636- metadata files.
637-
638- Besides the `bro_dist `/`zeek_dist ` config keys, any key inside the
588+ string, ``%(zeek_dist)s ``, is intended/necessary for all such interpolation
589+ usages.
590+
591+ Besides the `zeek_dist ` config key, any key inside the
639592`user_vars ` sections of their :ref: `package manager config file
640593<zkg-config-file>` that matches the key of an entry in the package's
641594`user_vars field `_ will be interpolated.
@@ -777,38 +730,24 @@ An example :file:`zkg.meta`::
777730The field is a list of dependency names and their version requirement
778731specifications.
779732
780- A dependency name may be either `zeek `, `zkg `, ` bro `, ` bro-pkg `,
733+ A dependency name may be either `zeek `, `zkg `,
781734a full git URL of the package, or a :ref: `package shorthand name
782735<package-shorthand-name>`.
783736
784- - The special `zeek ` and `bro ` dependencies refers not to a package,
785- but the version of Zeek that the package requires in order to function. If
786- the user has :program: `zeek-config ` or :program: `bro-config ` in their
787- :envvar: `PATH ` when installing/upgrading a package that specifies a `zeek ` or
788- `bro ` dependency, then :program: `zkg ` will enforce that the requirement is
789- satisfied.
737+ - The special `zeek ` dependency refers not to a package, but the version of Zeek
738+ that the package requires in order to function. If the user has
739+ :program: `zeek-config ` in their :envvar: `PATH ` when installing/upgrading a
740+ package that specifies a `zeek ` dependency, then :program: `zkg ` will enforce
741+ that the requirement is satisfied.
790742
791- .. note ::
792-
793- In this context, `zeek ` and `bro ` mean the same thing -- the
794- later is maintained for backwards compatibility while the former
795- became available :program: `since zkg v2.0 `.
796-
797- - The special `zkg ` and `bro-pkg ` dependencies refers to the version of the
743+ - The special `zkg ` dependency refers to the version of the
798744 package manager that is required by the package. E.g. if a package takes
799745 advantage of new features that are not present in older versions of the
800746 package manager, then it should indicate that so users of those old version
801747 will see an error message an know to upgrade instead of seeing a cryptic
802748 error/exception, or worse, seeing no errors, but without the desired
803749 functionality being performed.
804750
805- .. note ::
806-
807- This feature itself, via use of a `bro-pkg ` dependency, is only
808- available :program: `since bro-pkg v1.2 ` while a `zkg ` dependency is only
809- recognized :program: `since zkg v2.0 `. Otherwise, `zkg ` and `bro-pkg ` mean
810- the same thing in this context.
811-
812751- The full git URL may be directly specified in the `depends ` metadata if you
813752 want to force the dependency to always resolve to a single, canonical git
814753 repository. Typically this is the safe approach to take when listing
0 commit comments