Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-84057

Backport support for local dependency generators from RPM 4.20

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: Generate New Ti...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • rpm-4.19.1.1-15.el10
    • No
    • Moderate
    • c167ef8bdaecdd2e306ec896c919607ba9cceb6f
    • rhel-swm
    • ssg_core_services
    • 14
    • 16
    • 0
    • False
    • False
    • Hide

      None

      Show
      None
    • Yes
    • None
    • Hide

      AC:

      1. spec-local file attributes and dependency generators are backported to RPM.
      2. existing tests pass.
      Show
      AC: spec-local file attributes and dependency generators are backported to RPM. existing tests pass.
    • Pass
    • Automated
    • Enhancement
    • Hide
      .RPM supports `spec`-local file attributes and dependency generators

      File attributes and their dependency generators are usually shipped in separate packages that you must install prior to building a package that uses these attributes. However, you might need a file attribute to take effect during the build of the package that ships this attribute. You might also need the file attribute just for building the package, without shipping the attribute at all.

      With this update, you can register `spec`-local file attributes and generators by performing the following actions:

      . Define the `%_local_file_attrs` macro. `%_local_file_attrs` accepts a colon-separated list of new attribute names to register directly in your `spec` file.
      . Define one or more dependency generator macros for each attribute, such as `%pass:[__]NAME_provides` or `%pass:[__]NAME_path`, where `NAME` is the name of the local file attribute.

      RPM then uses the file attributes for dependency generation when the `spec` file is built. As a result, you can create build-time file attributes that are not necessarily meant for installation.

      For example, the following `spec` file snippet generates the provides for each packaged file by using the `foobar.sh` script bundled with your package’s sources:

      ----
      Source1: foobar.sh
      [...]
      %define _local_file_attrs foobar
      %define __foobar_provides %{SOURCE1}
      %define __foobar_path .*
      ----
      Show
      .RPM supports `spec`-local file attributes and dependency generators File attributes and their dependency generators are usually shipped in separate packages that you must install prior to building a package that uses these attributes. However, you might need a file attribute to take effect during the build of the package that ships this attribute. You might also need the file attribute just for building the package, without shipping the attribute at all. With this update, you can register `spec`-local file attributes and generators by performing the following actions: . Define the `%_local_file_attrs` macro. `%_local_file_attrs` accepts a colon-separated list of new attribute names to register directly in your `spec` file. . Define one or more dependency generator macros for each attribute, such as `%pass:[__]NAME_provides` or `%pass:[__]NAME_path`, where `NAME` is the name of the local file attribute. RPM then uses the file attributes for dependency generation when the `spec` file is built. As a result, you can create build-time file attributes that are not necessarily meant for installation. For example, the following `spec` file snippet generates the provides for each packaged file by using the `foobar.sh` script bundled with your package’s sources: ---- Source1: foobar.sh [...] %define _local_file_attrs foobar %define __foobar_provides %{SOURCE1} %define __foobar_path .* ----
    • Done
    • Done
    • Done
    • Not Required
    • x86_64
    • None

      What were you trying to do that didn't work?

      I would like to use the RPM package-local fileattr support in EPEL 9. This is not supported by RPM in EL 9.

      This would involve backporting https://github.com/rpm-software-management/rpm/pull/2911

              mdomonko@redhat.com Michal Domonkos
              maxgot Maxwell G (Inactive)
              packaging-team-maint packaging-team-maint
              Jan Blazek Jan Blazek
              Mariya Pershina Mariya Pershina
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: