rules_pkg icon indicating copy to clipboard operation
rules_pkg copied to clipboard

Support additional rpm spec directives

Open ashi009 opened this issue 10 months ago • 2 comments

There are some commonly used directives are currently missing from the rule.

  • BuildRequires
  • AutoReqProv: no and %global __requires_exclude_from etc (https://docs.fedoraproject.org/en-US/packaging-guidelines/AutoProvidesAndRequiresFiltering/)

For now, the only way is to use a custom spec template, but throwing arbitrary content to preamble_pieces would be nice.

https://github.com/bazelbuild/rules_pkg/blob/8c235607a015919328a03ead30996302e547a306/pkg/rpm_pfg.bzl#L512

ashi009 avatar Feb 19 '25 01:02 ashi009

Out of curiosity, what's the use case for BuildRequires in an RPM that (presumably) had its contents built by bazel?

kellyma2 avatar Feb 27 '25 19:02 kellyma2

Out of curiosity, what's the use case for BuildRequires in an RPM that (presumably) had its contents built by bazel?

For our case the package also contains a systemd service unit file, which needs to be loaded with systemctl. And there are macros for those script lets. In this case we need to add systemd-rpm-macros to BuildRequires to make sure the macros are resolved at build time instead of left as it in the final rpm.

ashi009 avatar Mar 04 '25 09:03 ashi009