**New Features**

-   Allow $(var) substitution in filenames (#620)
-   Rough prototype of @since processing. (#617)
-   First cut at runfiles support in pkg_* rules (#605)
-   Allow substitution of user-defined variables in RPM preamble (#787)
-   Add %posttrans scriptlet to RPM package (#799)
-   Allow additional RPM macro defines (#794)
-   Bring tar runfiles up to feature parity with pkg_files.runfiles. (#754)
-   Add support for `Obsoletes` tag in RPM definition (#778)
-   pkg_deb: allow data.tar.zst (#761)
-   Add support for failing on file conflicts. (#683)
-   Make pkg_zip compression configurable (#737)
-   Append changelog to RPM spec file (#726)
-   Add basic include_runfiles to pkg_files. (#724)
-   Add changelog attribute to pkg_deb (#725)
-   Add support for setting uid/gid from pkg_attributes (#671)

**Bug Fixes**
-   Explicitly set the FILE bit in zip external attributes. (#802)
-   Explicitly set `%{_builddir}` macro (#792)
-   Only inject pre and post scriptlets when provided (#788)
-   Don't load cc toolchain from rules_cc (#779)
-   doc: Fixup external manual references (#777)
-   Get bzlmod working in CI (#766)
-   use runfiles from rules_python (#768)
-   When pkg_tar.prefix_dir == base of symlink path, don't double-dip. (#749)
-   add imports to fix bazel --noexperimental_python_import_all_repositories flag (#630)
-   Align pkg_rpm returned files with other rules (#692)
-   fix(pkg_tar): properly normalize paths for empty files (#760)
-   Document that package_dir also uses package_variables (#747)
-   Fix handling paths with whitepsaces (#733)
-   Fix python 3.6, doesn't support compresslevel
-   Use Gzip compress level 6 (#720)
-   write debian Date field in UTC rather than local time (#712)
-   [pkg_deb] Fix multiline fields in changes file (#691)

**Incompatible Changes**
-   Remove PackageArtifactsInfo. (#752)

Thanks to: Adam Azarchs, Alex Eagle, August Karlstedt, Austin Schuh, Adrian Vogelsgesang,
flode, Florian Scheibner, Ignas Kaziukėnas, Jean-Hadrien Chabran, Matt,
Mike Kelly, Paul Draper, Sam Schwebach, Tomasz Wojno, Vertexwahn

**MODULE.bazel setup**

```
bazel_dep(name = "rules_pkg", version = "0.10.0")
```

**WORKSPACE setup**

```
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_pkg",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.10.0/rules_pkg-0.10.0.tar.gz",
        "https://github.com/bazelbuild/rules_pkg/releases/download/0.10.0/rules_pkg-0.10.0.tar.gz",
    ],
    sha256 = "e93b7309591cabd68828a1bcddade1c158954d323be2205063e718763627682a",
)
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
rules_pkg_dependencies()

```

**Using the rules**

See [the source](https://github.com/bazelbuild/rules_pkg/tree/0.10.0).
doc and changelog update to go with 0.10.0 (#809)

* add docs for 10
3 files changed
tree: 8ea3f87bf00831996920580105defc9423a29ccd
  1. .bazelci/
  2. .bcr/
  3. .github/
  4. deb_packages/
  5. distro/
  6. doc_build/
  7. docs/
  8. examples/
  9. pkg/
  10. tests/
  11. toolchains/
  12. .bazelignore
  13. .gitignore
  14. .pre-commit-config.yaml
  15. AUTHORS
  16. BUILD
  17. CHANGELOG.md
  18. CODEOWNERS
  19. CONTRIBUTING.md
  20. CONTRIBUTORS
  21. deps.bzl
  22. developers.md
  23. LICENSE
  24. MODULE.bazel
  25. patching.md
  26. README.md
  27. version.bzl
  28. WORKSPACE
  29. WORKSPACE.bzlmod
README.md

Bazel package building

Bazel rules for building tar, zip, deb, and rpm for packages.

For the latest version, see Releases (with WORKSPACE setup) / Documentation

Use rules-pkg-discuss@googlegroups.com for discussion.

CI: Build status

Basic rules

Package building rules

  • pkg - Rules for building packages of various types.
  • examples - Cookbook examples for using the rules.

As of Bazel 4.x, Bazel uses this rule set for packaging its distribution. Bazel still contains a limited version of pkg_tar but its feature set is frozen. Any new capabilities will be added here.

WORKSPACE setup

Sample, but see releases for the current release.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_pkg",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz",
        "https://github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz",
    ],
    sha256 = "8f9ee2dc10c1ae514ee599a8b42ed99fa262b757058f65ad3c384289ff70c4b8",
)
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
rules_pkg_dependencies()

To use pkg_rpm(), you must provide a copy of rpmbuild. You can use the system installed rpmbuild with this stanza.

load("@rules_pkg//toolchains/rpm:rpmbuild_configure.bzl", "find_system_rpmbuild")

find_system_rpmbuild(
    name = "rules_pkg_rpmbuild",
    verbose = False,
)

MODULE.bazel setup

bazel_dep(name = "rules_pkg", version = "0.0.10")

To use pkg_rpm(), you must provide a copy of rpmbuild. You can use the system installed rpmbuild with this stanza.

find_rpm = use_extension("//toolchains/rpm:rpmbuild_configure.bzl", "find_system_rpmbuild_bzlmod")
use_repo(find_rpm, "rules_pkg_rpmbuild")
register_toolchains("@rules_pkg_rpmbuild//:all")

For developers

We hold an engineering status meeting on the first Monday of every month at 10am USA East coast time. Add to calendar / meeting notes