79755955

Date: 2025-09-04 16:10:17
Score: 1
Natty:
Report link

I came back to this a few months later and was able to internalize the details in the RPM dependency generator docs better. I'm not sure if this will ever help anyone else, but here is what I found.

In the /usr/lib/rpm/fileattrs/ directory there are a bunch of .attr files that define macros that are used during rpmbuild's process.

I'll use the elf.attr file for reference.

The %__elf_magic macro provides a regular expression to match what files to apply the %__elf_requires and other macros in the elf.attr file to.

The executable set in the %__elf_requires macro will get its list of files on stdin (not as normal arguments to a bash script).

In my case, I need to modify what goes into the RPM's Requires field. That is what the elf.attr's %__elf_requires does.

One possibility is to create my own mygenerator.attr file with %__mygenerator_requires /usr/bin/my-custom-script. I'm not 100% sure where to place this .attr file, I don't necessarily want to install it in the same dir as the others.

Another option is to "override" the %__elf_requires macro in my spec file templates to something like %define __elf_requires /usr/bin/my-custom-script.

Since what I want to do is tweak what the elf.attr does for Requires, this is most likely the thing I will do.

I'm open to suggestions though.

Reasons:
  • Blacklisted phrase (0.5): I need
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Joel