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.
Rule for creating Debian packages.
pkg_deb(<a href="#pkg_deb-name">name</a>, <a href="#pkg_deb-architecture">architecture</a>, <a href="#pkg_deb-architecture_file">architecture_file</a>, <a href="#pkg_deb-breaks">breaks</a>, <a href="#pkg_deb-built_using">built_using</a>, <a href="#pkg_deb-built_using_file">built_using_file</a>, <a href="#pkg_deb-conffiles">conffiles</a>, <a href="#pkg_deb-conffiles_file">conffiles_file</a>, <a href="#pkg_deb-config">config</a>, <a href="#pkg_deb-conflicts">conflicts</a>, <a href="#pkg_deb-data">data</a>, <a href="#pkg_deb-depends">depends</a>, <a href="#pkg_deb-depends_file">depends_file</a>, <a href="#pkg_deb-description">description</a>, <a href="#pkg_deb-description_file">description_file</a>, <a href="#pkg_deb-distribution">distribution</a>, <a href="#pkg_deb-enhances">enhances</a>, <a href="#pkg_deb-homepage">homepage</a>, <a href="#pkg_deb-maintainer">maintainer</a>, <a href="#pkg_deb-out">out</a>, <a href="#pkg_deb-package">package</a>, <a href="#pkg_deb-package_file_name">package_file_name</a>, <a href="#pkg_deb-package_variables">package_variables</a>, <a href="#pkg_deb-postinst">postinst</a>, <a href="#pkg_deb-postrm">postrm</a>, <a href="#pkg_deb-predepends">predepends</a>, <a href="#pkg_deb-preinst">preinst</a>, <a href="#pkg_deb-prerm">prerm</a>, <a href="#pkg_deb-priority">priority</a>, <a href="#pkg_deb-provides">provides</a>, <a href="#pkg_deb-recommends">recommends</a>, <a href="#pkg_deb-replaces">replaces</a>, <a href="#pkg_deb-section">section</a>, <a href="#pkg_deb-suggests">suggests</a>, <a href="#pkg_deb-templates">templates</a>, <a href="#pkg_deb-triggers">triggers</a>, <a href="#pkg_deb-urgency">urgency</a>, <a href="#pkg_deb-version">version</a>, <a href="#pkg_deb-version_file">version_file</a>)
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| architecture | Package architecture. Must not be used with architecture_file. | String | optional | “all” |
| architecture_file | File that contains the package architecture. Must not be used with architecture. | Label | optional | None |
| breaks | See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps. | List of strings | optional | [] |
| built_using | The tool that were used to build this package provided either inline (with built_using) or from a file (with built_using_file). | String | optional | "" |
| built_using_file | The tool that were used to build this package provided either inline (with built_using) or from a file (with built_using_file). | Label | optional | None |
| conffiles | The list of conffiles or a file containing one conffile per line. Each item is an absolute path on the target system where the deb is installed. See https://www.debian.org/doc/debian-policy/ch-files.html#s-config-files. | List of strings | optional | [] |
| conffiles_file | The list of conffiles or a file containing one conffile per line. Each item is an absolute path on the target system where the deb is installed. See https://www.debian.org/doc/debian-policy/ch-files.html#s-config-files. | Label | optional | None |
| config | config file used for debconf integration. See https://www.debian.org/doc/debian-policy/ch-binary.html#prompting-in-maintainer-scripts. | Label | optional | None |
| conflicts | See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps. | List of strings | optional | [] |
| data | A tar file that contains the data for the debian package. | Label | required | |
| depends | See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps. | List of strings | optional | [] |
| depends_file | File that contains a list of package dependencies. Must not be used with depends. See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps. | Label | optional | None |
| description | The package description. Must not be used with description_file. | String | optional | "" |
| description_file | The package description. Must not be used with description. | Label | optional | None |
| distribution | "distribution: See http://www.debian.org/doc/debian-policy. | String | optional | “unstable” |
| enhances | See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps. | List of strings | optional | [] |
| homepage | The homepage of the project. | String | optional | "" |
| maintainer | The maintainer of the package. | String | required | |
| out | See Common Attributes | Label | required | |
| package | The name of the package | String | required | |
| package_file_name | See Common Attributes. Default: "{package}-{version}-{architecture}.deb | String | optional | "" |
| package_variables | See Common Attributes | Label | optional | None |
| postinst | The post-install script for the package. See http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html. | Label | optional | None |
| postrm | The post-remove script for the package. See http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html. | Label | optional | None |
| predepends | See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps. | List of strings | optional | [] |
| preinst | "The pre-install script for the package. See http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html. | Label | optional | None |
| prerm | The pre-remove script for the package. See http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html. | Label | optional | None |
| priority | The priority of the package. See http://www.debian.org/doc/debian-policy/ch-archive.html#s-priorities. | String | optional | "" |
| provides | See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps. | List of strings | optional | [] |
| recommends | See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps. | List of strings | optional | [] |
| replaces | See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps. | List of strings | optional | [] |
| section | The section of the package. See http://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections. | String | optional | "" |
| suggests | See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps. | List of strings | optional | [] |
| templates | templates file used for debconf integration. See https://www.debian.org/doc/debian-policy/ch-binary.html#prompting-in-maintainer-scripts. | Label | optional | None |
| triggers | triggers file for configuring installation events exchanged by packages. See https://wiki.debian.org/DpkgTriggers. | Label | optional | None |
| urgency | "urgency: See http://www.debian.org/doc/debian-policy. | String | optional | “medium” |
| version | Package version. Must not be used with version_file. | String | optional | "" |
| version_file | File that contains the package version. Must not be used with version. | Label | optional | None |
Provides rules for creating RPM packages via pkg_filegroup and friends.
pkg_rpm() depends on the existence of an rpmbuild toolchain. Many users will find to convenient to use the one provided with their system. To enable that toolchain add the following stanza to WORKSPACE:
# Find rpmbuild if it exists.
load("@rules_pkg//toolchains/rpm:rpmbuild_configure.bzl", "find_system_rpmbuild")
find_system_rpmbuild(name="rules_pkg_rpmbuild")
pkg_rpm(<a href="#pkg_rpm-name">name</a>, <a href="#pkg_rpm-architecture">architecture</a>, <a href="#pkg_rpm-binary_payload_compression">binary_payload_compression</a>, <a href="#pkg_rpm-changelog">changelog</a>, <a href="#pkg_rpm-conflicts">conflicts</a>, <a href="#pkg_rpm-debug">debug</a>, <a href="#pkg_rpm-description">description</a>, <a href="#pkg_rpm-description_file">description_file</a>, <a href="#pkg_rpm-group">group</a>, <a href="#pkg_rpm-license">license</a>, <a href="#pkg_rpm-package_file_name">package_file_name</a>, <a href="#pkg_rpm-package_name">package_name</a>, <a href="#pkg_rpm-package_variables">package_variables</a>, <a href="#pkg_rpm-post_scriptlet">post_scriptlet</a>, <a href="#pkg_rpm-post_scriptlet_file">post_scriptlet_file</a>, <a href="#pkg_rpm-postun_scriptlet">postun_scriptlet</a>, <a href="#pkg_rpm-postun_scriptlet_file">postun_scriptlet_file</a>, <a href="#pkg_rpm-pre_scriptlet">pre_scriptlet</a>, <a href="#pkg_rpm-pre_scriptlet_file">pre_scriptlet_file</a>, <a href="#pkg_rpm-preun_scriptlet">preun_scriptlet</a>, <a href="#pkg_rpm-preun_scriptlet_file">preun_scriptlet_file</a>, <a href="#pkg_rpm-provides">provides</a>, <a href="#pkg_rpm-release">release</a>, <a href="#pkg_rpm-release_file">release_file</a>, <a href="#pkg_rpm-requires">requires</a>, <a href="#pkg_rpm-requires_contextual">requires_contextual</a>, <a href="#pkg_rpm-rpmbuild_path">rpmbuild_path</a>, <a href="#pkg_rpm-source_date_epoch">source_date_epoch</a>, <a href="#pkg_rpm-source_date_epoch_file">source_date_epoch_file</a>, <a href="#pkg_rpm-spec_template">spec_template</a>, <a href="#pkg_rpm-srcs">srcs</a>, <a href="#pkg_rpm-summary">summary</a>, <a href="#pkg_rpm-url">url</a>, <a href="#pkg_rpm-version">version</a>, <a href="#pkg_rpm-version_file">version_file</a>)
Creates an RPM format package via pkg_filegroup and friends.
The uses the outputs of the rules in `mappings.bzl` to construct arbitrary
RPM packages. Attributes of this rule provide preamble information and
scriptlets, which are then used to compose a valid RPM spec file.
This rule will fail at analysis time if:
- Any `srcs` input creates the same destination, regardless of other
attributes.
This rule only functions on UNIXy platforms. The following tools must be
available on your system for this to function properly:
- `rpmbuild` (as specified in `rpmbuild_path`, or available in `$PATH`)
- GNU coreutils. BSD coreutils may work, but are not tested.
To set RPM file attributes (like `%config` and friends), set the
`rpm_filetag` in corresponding packaging rule (`pkg_files`, etc). The value
is prepended with "%" and added to the `%files` list, for example:
```
attrs = {"rpm_filetag": ("config(missingok, noreplace)",)},
```
Is the equivalent to `%config(missingok, noreplace)` in the `%files` list.
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| architecture | Package architecture. This currently sets the BuildArch tag, which influences the output architecture of the package. Typically, BuildArch only needs to be set when the package is known to be cross-platform (e.g. written in an interpreted language), or, less common, when it is known that the application is only valid for specific architectures. When no attribute is provided, this will default to your host's architecture. This is usually what you want. | String | optional | "" |
| binary_payload_compression | Compression mode used for this RPM Must be a form that rpmbuild(8) knows how to process, which will depend on the version of rpmbuild in use. The value corresponds to the %_binary_payload macro and is set on the rpmbuild(8) command line if provided. Some examples of valid values (which may not be supported on your system) can be found here. On CentOS systems (also likely Red Hat and Fedora), you can find some supported values by looking for %_binary_payload in /usr/lib/rpm/macros. Other systems have similar files and configurations. If not provided, the compression mode will be computed by rpmbuild itself. Defaults may vary per distribution or build of rpm; consult the relevant documentation for more details. WARNING: Bazel is currently not aware of action threading requirements for non-test actions. Using threaded compression may result in overcommitting your system. | String | optional | "" |
| changelog | - | Label | optional | None |
| conflicts | List of capabilities that conflict with this package when it is installed. Corresponds to the “Conflicts” preamble tag. See also: https://rpm.org/user_doc/dependencies.html | List of strings | optional | [] |
| debug | Debug the RPM helper script and RPM generation | Boolean | optional | False |
| description | Multi-line description of this package, corresponds to RPM %description. Exactly one of description or description_file must be provided. | String | optional | "" |
| description_file | File containing a multi-line description of this package, corresponds to RPM %description. | Label | optional | None |
| group | Optional; RPM “Group” tag. NOTE: some distributions (as of writing, Fedora > 17 and CentOS/RHEL > 5) have deprecated this tag. Other distributions may require it, but it is harmless in any case. | String | optional | "" |
| license | RPM “License” tag. The software license for the code distributed in this package. The underlying RPM builder requires you to put something here; if your package is not going to be distributed, feel free to set this to something like “Internal”. | String | required | |
| package_file_name | See ‘Common Attributes’ in the rules_pkg reference. If this is not provided, the package file given a NVRA-style (name-version-release.arch) output, which is preferred by most RPM repositories. | String | optional | "" |
| package_name | Optional; RPM name override. If not provided, the name attribute of this rule will be used instead. This influences values like the spec file name. | String | optional | "" |
| package_variables | See ‘Common Attributes’ in the rules_pkg reference | Label | optional | None |
| post_scriptlet | RPM %post scriptlet. Currently only allowed to be a shell script. post_scriptlet and post_scriptlet_file are mutually exclusive. | String | optional | "" |
| post_scriptlet_file | File containing the RPM %post scriptlet | Label | optional | None |
| postun_scriptlet | RPM %postun scriptlet. Currently only allowed to be a shell script. postun_scriptlet and postun_scriptlet_file are mutually exclusive. | String | optional | "" |
| postun_scriptlet_file | File containing the RPM %postun scriptlet | Label | optional | None |
| pre_scriptlet | RPM %pre scriptlet. Currently only allowed to be a shell script. pre_scriptlet and pre_scriptlet_file are mutually exclusive. | String | optional | "" |
| pre_scriptlet_file | File containing the RPM %pre scriptlet | Label | optional | None |
| preun_scriptlet | RPM %preun scriptlet. Currently only allowed to be a shell script. preun_scriptlet and preun_scriptlet_file are mutually exclusive. | String | optional | "" |
| preun_scriptlet_file | File containing the RPM %preun scriptlet | Label | optional | None |
| provides | List of rpm capabilities that this package provides. Corresponds to the “Provides” preamble tag. See also: https://rpm.org/user_doc/dependencies.html | List of strings | optional | [] |
| release | RPM “Release” tag Exactly one of release or release_file must be provided. | String | optional | "" |
| release_file | File containing RPM “Release” tag. | Label | optional | None |
| requires | List of rpm capability expressions that this package requires. Corresponds to the “Requires” preamble tag. See also: https://rpm.org/user_doc/dependencies.html | List of strings | optional | [] |
| requires_contextual | Contextualized requirement specifications This is a map of various properties (often scriptlet types) to capability name specifications, e.g.: python {pre: [GConf2],post: [GConf2], postun: [GConf2]} Which causes the below to be added to the spec file's preamble: Requires(pre): GConf2 Requires(post): GConf2 Requires(postun): GConf2 This is most useful for ensuring that required tools exist when scriptlets are run, although there may be other valid use cases. Valid keys for this attribute may include, but are not limited to: - pre - post - preun - postun - pretrans - posttrans For capabilities that are always required by packages at runtime, use the requires attribute instead. See also: https://rpm.org/user_doc/more_dependencies.html NOTE: pkg_rpm does not check if the keys of this dictionary are acceptable to rpm(8). | Dictionary: String -> List of strings | optional | {} |
| rpmbuild_path | Path to a rpmbuild binary. Deprecated in favor of the rpmbuild toolchain | String | optional | "" |
| source_date_epoch | Value to export as SOURCE_DATE_EPOCH to facilitate reproducible builds Implicitly sets the %clamp_mtime_to_source_date_epoch in the subordinate call to rpmbuild to facilitate more consistent in-RPM file timestamps. Negative values (like the default) disable this feature. | Integer | optional | -1 |
| source_date_epoch_file | File containing the SOURCE_DATE_EPOCH value. Implicitly sets the %clamp_mtime_to_source_date_epoch in the subordinate call to rpmbuild to facilitate more consistent in-RPM file timestamps. | Label | optional | None |
| spec_template | Spec file template. Use this if you need to add additional logic to your spec files that is not available by default. In most cases, you should not need to override this attribute. | Label | optional | //pkg/rpm:template.spec.tpl |
| srcs | Mapping groups to include in this RPM. These are typically brought into life as pkg_filegroups. | List of labels | required | |
| summary | RPM “Summary” tag. One-line summary of this package. Must not contain newlines. | String | required | |
| url | RPM “URL” tag; this project/vendor's home on the Internet. | String | optional | "" |
| version | RPM “Version” tag. Exactly one of version or version_file must be provided. | String | optional | "" |
| version_file | File containing RPM “Version” tag. | Label | optional | None |
Rules for making .tar files.
pkg_tar(<a href="#pkg_tar-name">name</a>, <a href="#pkg_tar-build_tar">build_tar</a>, <a href="#pkg_tar-compressor">compressor</a>, <a href="#pkg_tar-compressor_args">compressor_args</a>, <a href="#pkg_tar-deps">deps</a>, <a href="#pkg_tar-empty_dirs">empty_dirs</a>, <a href="#pkg_tar-empty_files">empty_files</a>, <a href="#pkg_tar-extension">extension</a>, <a href="#pkg_tar-files">files</a>, <a href="#pkg_tar-include_runfiles">include_runfiles</a>, <a href="#pkg_tar-mode">mode</a>, <a href="#pkg_tar-modes">modes</a>, <a href="#pkg_tar-mtime">mtime</a>, <a href="#pkg_tar-out">out</a>, <a href="#pkg_tar-owner">owner</a>, <a href="#pkg_tar-ownername">ownername</a>, <a href="#pkg_tar-ownernames">ownernames</a>, <a href="#pkg_tar-owners">owners</a>, <a href="#pkg_tar-package_dir">package_dir</a>, <a href="#pkg_tar-package_dir_file">package_dir_file</a>, <a href="#pkg_tar-package_file_name">package_file_name</a>, <a href="#pkg_tar-package_variables">package_variables</a>, <a href="#pkg_tar-portable_mtime">portable_mtime</a>, <a href="#pkg_tar-private_stamp_detect">private_stamp_detect</a>, <a href="#pkg_tar-remap_paths">remap_paths</a>, <a href="#pkg_tar-srcs">srcs</a>, <a href="#pkg_tar-stamp">stamp</a>, <a href="#pkg_tar-strip_prefix">strip_prefix</a>, <a href="#pkg_tar-symlinks">symlinks</a>)
ATTRIBUTES
Rules for manipulation of various packaging.
pkg_zip(<a href="#pkg_zip-name">name</a>, <a href="#pkg_zip-mode">mode</a>, <a href="#pkg_zip-out">out</a>, <a href="#pkg_zip-package_dir">package_dir</a>, <a href="#pkg_zip-package_file_name">package_file_name</a>, <a href="#pkg_zip-package_variables">package_variables</a>, <a href="#pkg_zip-private_stamp_detect">private_stamp_detect</a>, <a href="#pkg_zip-srcs">srcs</a>, <a href="#pkg_zip-stamp">stamp</a>, <a href="#pkg_zip-strip_prefix">strip_prefix</a>, <a href="#pkg_zip-timestamp">timestamp</a>)
ATTRIBUTES
Package creation helper mapping rules.
This module declares Provider interfaces and rules for specifying the contents of packages in a package-type-agnostic way. The main rules supported here are the following:
pkg_files describes destinations for rule outputspkg_mkdirs describes directory structurespkg_mklink describes symbolic linkspkg_filegroup creates groupings of above to add to packagesRules that actually make use of the outputs of the above rules are not specified here.
filter_directory(<a href="#filter_directory-name">name</a>, <a href="#filter_directory-excludes">excludes</a>, <a href="#filter_directory-outdir_name">outdir_name</a>, <a href="#filter_directory-prefix">prefix</a>, <a href="#filter_directory-renames">renames</a>, <a href="#filter_directory-src">src</a>, <a href="#filter_directory-strip_prefix">strip_prefix</a>)
Transform directories (TreeArtifacts) using pkg_filegroup-like semantics.
Effective order of operations: 1) Files are `exclude`d 2) `renames` _or_ `strip_prefix` is applied. 3) `prefix` is applied In particular, if a `rename` applies to an individual file, `strip_prefix` will not be applied to that particular file. Each non-`rename``d path will look like this: ``` $OUTPUT_DIR/$PREFIX/$FILE_WITHOUT_STRIP_PREFIX ``` Each `rename`d path will look like this: ``` $OUTPUT_DIR/$PREFIX/$FILE_RENAMED ``` If an operation cannot be applied (`strip_prefix`) to any component in the directory, or if one is unused (`exclude`, `rename`), the underlying command will fail. See the individual attributes for details.
ATTRIBUTES
pkg_filegroup(<a href="#pkg_filegroup-name">name</a>, <a href="#pkg_filegroup-prefix">prefix</a>, <a href="#pkg_filegroup-srcs">srcs</a>)
Package contents grouping rule.
This rule represents a collection of packaging specifications (e.g. those created by `pkg_files`, `pkg_mklink`, etc.) that have something in common, such as a prefix or a human-readable category.
ATTRIBUTES
pkg_files(<a href="#pkg_files-name">name</a>, <a href="#pkg_files-attributes">attributes</a>, <a href="#pkg_files-excludes">excludes</a>, <a href="#pkg_files-prefix">prefix</a>, <a href="#pkg_files-renames">renames</a>, <a href="#pkg_files-srcs">srcs</a>, <a href="#pkg_files-strip_prefix">strip_prefix</a>)
General-purpose package target-to-destination mapping rule.
This rule provides a specification for the locations and attributes of targets when they are packaged. No outputs are created other than Providers that are intended to be consumed by other packaging rules, such as `pkg_rpm`. Labels associated with these rules are not passed directly to packaging rules, instead, they should be passed to an associated `pkg_filegroup` rule, which in turn should be passed to packaging rules. Consumers of `pkg_files`s will, where possible, create the necessary directory structure for your files so you do not have to unless you have special requirements. Consult `pkg_mkdirs` for more details.
ATTRIBUTES
pkg_mkdirs(<a href="#pkg_mkdirs-name">name</a>, <a href="#pkg_mkdirs-attributes">attributes</a>, <a href="#pkg_mkdirs-dirs">dirs</a>)
Defines creation and ownership of directories in packages
Use this if: 1) You need to create an empty directory in your package. 2) Your package needs to explicitly own a directory, even if it already owns files in those directories. 3) You need nonstandard permissions (typically, not "0755") on a directory in your package. For some package management systems (e.g. RPM), directory ownership (2) may imply additional semantics. Consult your package manager's and target distribution's documentation for more details.
ATTRIBUTES
pkg_mklink_impl(<a href="#pkg_mklink_impl-name">name</a>, <a href="#pkg_mklink_impl-attributes">attributes</a>, <a href="#pkg_mklink_impl-link_name">link_name</a>, <a href="#pkg_mklink_impl-target">target</a>)
Define a symlink within packages
This rule results in the creation of a single link within a package. Symbolic links specified by this rule may point at files/directories outside of the package, or otherwise left dangling.
ATTRIBUTES
pkg_attributes(<a href="#pkg_attributes-mode">mode</a>, <a href="#pkg_attributes-user">user</a>, <a href="#pkg_attributes-group">group</a>, <a href="#pkg_attributes-kwargs">kwargs</a>)
Format attributes for use in package mapping rules.
If “mode” is not provided, it will default to the mapping rule's default mode. These vary per mapping rule; consult the respective documentation for more details.
Not providing any of “user”, or “group” will result in the package builder choosing one for you. The chosen value should not be relied upon.
Well-known attributes outside of the above are documented in the rules_pkg reference.
This is the only supported means of passing in attributes to package mapping rules (e.g. pkg_files).
PARAMETERS
RETURNS
A value usable in the “attributes” attribute in package mapping rules.
pkg_mklink(<a href="#pkg_mklink-name">name</a>, <a href="#pkg_mklink-link_name">link_name</a>, <a href="#pkg_mklink-target">target</a>, <a href="#pkg_mklink-attributes">attributes</a>, <a href="#pkg_mklink-src">src</a>, <a href="#pkg_mklink-kwargs">kwargs</a>)
Create a symlink.
PARAMETERS
strip_prefix.files_only()
strip_prefix.from_pkg(<a href="#strip_prefix.from_pkg-path">path</a>)
PARAMETERS
| Name | Description | Default Value |
|---|---|---|
| path | - | "" |
strip_prefix.from_root(<a href="#strip_prefix.from_root-path">path</a>)
PARAMETERS
| Name | Description | Default Value |
|---|---|---|
| path | - | "" |
Rules to create RPM archives.
NOTE: this module is deprecated in favor of pkg/rpm_pfg.bzl. For more information on the pkg_filegroup framework it uses, see pkg/mappings.bzl.
pkg_rpm() depends on the existence of an rpmbuild toolchain. Many users will find to convenient to use the one provided with their system. To enable that toolchain add the following stanza to WORKSPACE:
# Find rpmbuild if it exists.
load("@rules_pkg//toolchains/rpm:rpmbuild_configure.bzl", "find_system_rpmbuild")
find_system_rpmbuild(name="rules_pkg_rpmbuild")
pkg_rpm(<a href="#pkg_rpm-name">name</a>, <a href="#pkg_rpm-architecture">architecture</a>, <a href="#pkg_rpm-changelog">changelog</a>, <a href="#pkg_rpm-data">data</a>, <a href="#pkg_rpm-debug">debug</a>, <a href="#pkg_rpm-release">release</a>, <a href="#pkg_rpm-release_file">release_file</a>, <a href="#pkg_rpm-rpmbuild_path">rpmbuild_path</a>, <a href="#pkg_rpm-source_date_epoch">source_date_epoch</a>, <a href="#pkg_rpm-source_date_epoch_file">source_date_epoch_file</a>, <a href="#pkg_rpm-spec_file">spec_file</a>, <a href="#pkg_rpm-version">version</a>, <a href="#pkg_rpm-version_file">version_file</a>)
Legacy version
ATTRIBUTES