Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions docs/latest.md
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aiuto I presume this updated to 1.30 due to the pre-release?

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# rules_pkg - 1.2.0
# rules_pkg - 1.3.0

<div class="toc">
<h2>Common Attributes</h2>
Expand Down Expand Up @@ -94,10 +94,11 @@ load("@rules_pkg//pkg/private/deb:deb.bzl", "pkg_deb")

pkg_deb(<a href="#pkg_deb-name">name</a>, <a href="#pkg_deb-data">data</a>, <a href="#pkg_deb-out">out</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-changelog">changelog</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-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-license">license</a>,
<a href="#pkg_deb-maintainer">maintainer</a>, <a href="#pkg_deb-md5sums">md5sums</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-provides_file">provides_file</a>, <a href="#pkg_deb-recommends">recommends</a>, <a href="#pkg_deb-replaces">replaces</a>,
<a href="#pkg_deb-replaces_file">replaces_file</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>)
<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-installed_size">installed_size</a>, <a href="#pkg_deb-license">license</a>, <a href="#pkg_deb-maintainer">maintainer</a>, <a href="#pkg_deb-md5sums">md5sums</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-provides_file">provides_file</a>, <a href="#pkg_deb-recommends">recommends</a>, <a href="#pkg_deb-replaces">replaces</a>, <a href="#pkg_deb-replaces_file">replaces_file</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>)
</pre>

Create a Debian package.
Expand Down Expand Up @@ -136,6 +137,7 @@ include both. If you need downstream rule to specifically depend on only the .de
| <a id="pkg_deb-distribution"></a>distribution | "distribution: See http://www.debian.org/doc/debian-policy. | String | optional | `"unstable"` |
| <a id="pkg_deb-enhances"></a>enhances | See http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps. | List of strings | optional | `[]` |
| <a id="pkg_deb-homepage"></a>homepage | The homepage of the project. | String | optional | `""` |
| <a id="pkg_deb-installed_size"></a>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 | `""` |
| <a id="pkg_deb-license"></a>license | The license of the project. | String | optional | `""` |
| <a id="pkg_deb-maintainer"></a>maintainer | The maintainer of the package. | String | required | |
| <a id="pkg_deb-md5sums"></a>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. | <a href="https://bazel.build/concepts/labels">Label</a> | optional | `None` |
Expand Down
7 changes: 7 additions & 0 deletions pkg/private/deb/deb.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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.""",
Expand Down
1 change: 1 addition & 0 deletions tests/deb/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions tests/deb/pkg_deb_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading