diff --git a/docs/latest.md b/docs/latest.md
index ba68f1e5..d6f5dbb5 100755
--- a/docs/latest.md
+++ b/docs/latest.md
@@ -1,4 +1,4 @@
-# rules_pkg - 1.2.0
+# rules_pkg - 1.3.0
Common Attributes
@@ -94,10 +94,11 @@ load("@rules_pkg//pkg/private/deb:deb.bzl", "pkg_deb")
pkg_deb(
name,
data,
out,
architecture,
architecture_file,
breaks,
built_using,
built_using_file,
changelog,
conffiles,
conffiles_file,
config,
conflicts,
depends,
-
depends_file,
description,
description_file,
distribution,
enhances,
homepage,
license,
-
maintainer,
md5sums,
package,
package_file_name,
package_variables,
postinst,
postrm,
-
predepends,
preinst,
prerm,
priority,
provides,
provides_file,
recommends,
replaces,
-
replaces_file,
section,
suggests,
templates,
triggers,
urgency,
version,
version_file)
+
depends_file,
description,
description_file,
distribution,
enhances,
homepage,
+
installed_size,
license,
maintainer,
md5sums,
package,
package_file_name,
+
package_variables,
postinst,
postrm,
predepends,
preinst,
prerm,
priority,
provides,
+
provides_file,
recommends,
replaces,
replaces_file,
section,
suggests,
templates,
+
triggers,
urgency,
version,
version_file)
Create a Debian package.
@@ -136,6 +137,7 @@ include both. If you need downstream rule to specifically depend on only the .de
|
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 | `""` |
+|
installed_size | The approximate total size (in KiB) of the package's installed files. Corresponds to the Installed-Size field in the control file. See https://www.debian.org/doc/debian-policy/ch-controlfields.html#installed-size. | String | optional | `""` |
|
license | The license of the project. | String | optional | `""` |
|
maintainer | The maintainer of the package. | String | required | |
|
md5sums | A file listing md5 checksums of files in the data archive. This file is optional. See https://manpages.debian.org/bookworm/dpkg-dev/deb-md5sums.5.en.html. |
Label | optional | `None` |
diff --git a/pkg/private/deb/deb.bzl b/pkg/private/deb/deb.bzl
index 5b948938..169b007a 100644
--- a/pkg/private/deb/deb.bzl
+++ b/pkg/private/deb/deb.bzl
@@ -137,6 +137,8 @@ def _pkg_deb_impl(ctx):
for d in ctx.attr.depends:
args.add("--depends", substitute_package_variables(ctx, d))
+ if ctx.attr.installed_size:
+ args.add("--installed_size", substitute_package_variables(ctx, ctx.attr.installed_size))
if ctx.attr.priority:
args.add("--priority", substitute_package_variables(ctx, ctx.attr.priority))
if ctx.attr.section:
@@ -341,6 +343,11 @@ See https://www.debian.org/doc/debian-policy/ch-files.html#s-config-files.""",
See http://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections.""",
),
"homepage": attr.string(doc = """The homepage of the project."""),
+ "installed_size": attr.string(
+ doc = """The approximate total size (in KiB) of the package's installed files.
+ Corresponds to the Installed-Size field in the control file.
+ See https://www.debian.org/doc/debian-policy/ch-controlfields.html#installed-size.""",
+ ),
"license": attr.string(doc = """The license of the project."""),
"breaks": attr.string_list(
doc = """See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps.""",
diff --git a/tests/deb/BUILD b/tests/deb/BUILD
index e8146b97..f7e947f4 100644
--- a/tests/deb/BUILD
+++ b/tests/deb/BUILD
@@ -87,6 +87,7 @@ pkg_deb(
],
description = "toto ®, Й, ק ,م, ๗, あ, 叶, 葉, 말, ü and é\n more",
distribution = "trusty",
+ installed_size = "1234",
license = "Apache-2.0",
maintainer = "soméone@somewhere.com",
md5sums = ":generate_md5sums",
diff --git a/tests/deb/pkg_deb_test.py b/tests/deb/pkg_deb_test.py
index 50a0447f..8c89d5d6 100644
--- a/tests/deb/pkg_deb_test.py
+++ b/tests/deb/pkg_deb_test.py
@@ -159,6 +159,7 @@ def test_description(self):
'Breaks: oldbrokenpkg',
'Provides: hello',
'License: Apache-2.0',
+ 'Installed-Size: 1234',
]
# TODO(https://github.com/bazelbuild/rules_pkg/issues/214): This can not
# pass on Windows Until we rewrite how description is passed