These attributes are used in several rules within this module.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| out | Name of the output file. This file will always be created and used to access the package content. If package_file_name is also specified, out will be a symlink. | String | required | |
| package_file_name | The name of the file which will contain the package. The name may contain variables in the form {var}. The values for substitution are specified through package_variables. | String | optional | package type specific |
| package_variables | A target that provides PackageVariablesInfo to substitute into package_file_name. | Label | optional | None |
| attributes | Attributes to set on entities created within packages. Not to be confused with bazel rule attributes. See ‘Mapping “Attributes”’ below | Undefined. | optional | Varies. Consult individual rule documentation for details. |
See examples/naming_package_files for examples of how out, package_file_name, and package_variables interact.
The “attributes” attribute specifies properties of package contents as used in rules such as pkg_files, and pkg_mkdirs. These allow fine-grained control of the contents of your package. For example:
attributes = pkg_attributes( mode = "0644", user = "root", group = "wheel", my_custom_attribute = "some custom value", )
mode, user, and group correspond to common UNIX-style filesystem permissions. Attributes should always be specified using the pkg_attributes helper macro.
Each mapping rule has some default mapping attributes. At this time, the only default is “mode”, which will be set if it is not otherwise overridden by the user.
If user and group are not specified, then defaults for them will be chosen by the underlying package builder. Any specific behavior from package builders should not be relied upon.
Any other attributes should be specified as additional arguments to pkg_attributes.
There are currently no other well-known attributes.
pkg_tar(name, extension, strip_prefix, package_dir, srcs, compressor, compressor_args, mode, modes, deps, symlinks, package_file_name, package_variables)
Creates a tar file from a list of inputs.
pkg_zip(name, extension, package_dir, srcs, timestamp, package_file_name, package_variables)
Creates a zip file from a list of inputs.
pkg_deb(name, data, package, architecture, maintainer, preinst, postinst, prerm, postrm, version, version_file, description, description_file, built_using, built_using_file, priority, section, homepage, depends, suggests, enhances, breaks, conflicts, predepends, recommends, replaces, package_file_name, package_variables)
Create a debian package. See http://www.debian.org/doc/debian-policy/ch-controlfields.html for more details on this.
pkg_rpm(name, spec_file, architecture, version, version_file, changelog, data)
Create an RPM package. See http://rpm.org/documentation.html for more details on this.