rules_pkg 1.3.0Latest published 2.8mo ago
MODULE.bazel
bazel_dep(name = "rules_pkg", version = "1.3.0")
README

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

About

Bazel rules for creating packages of many types (zip, tar, deb, rpm, ...)

@bazelbuild/rules_pkg@bazelbuild
Homepage
254stars
Friday, August 7, 2026
@Wito-1#9961 rules_pkg@1.3.0 (#9961)

Languages

Python37.8%
Smarty1.1%
Shell0.4%
C++0.1%
Dockerfile0.1%
C0%

Maintainers

@

Versions

1.3.0 +7.6mo2% 122026-08-07
1.2.0 +9.4mo10% 622025-12-20
1.1.0 +8.2mo17% 1082025-03-13
1.0.1 +4.8mo25% 1602024-07-09
0.10.1 +1.1mo3% 172024-02-14
0.10.0 +8.4mo2024-01-10
0.9.1 +1.1mo21% 1342023-05-03
0.9.0 +1.6mo1% 72023-03-29
0.8.1 +5.3mo0% 22023-02-08
0.7.0 +11.1mo13% 812022-09-01
0.5.17% 472021-10-01