0

I wish to generate a list of Perl modules an rpm provides in the spec file. It's not clear from the manuals how one does this. How does one set a field from a shell command? And how does one specify multiple values from one command? Something like...

Provides: $(some_program_which_figures_out_what_the_package_provides)

What is the correct syntax to run a program to populate the tag, and what should the program return?

Schwern
  • 153,029
  • 25
  • 195
  • 336
  • Could you try to clarify your question? From what I am reading it seems like you just want to use the provides tag in the spec file. This would allow users to query via rpm -q --provides $packageName and they would see whatever was part of the tag. Is this not what you are looking to do? – Forrest Dec 14 '12 at 05:23
  • Yes, I'm looking to populate the Provides tag in the spec file using a program. I don't want to do it by hand. The package provides multiple things. – Schwern Dec 14 '12 at 06:51

1 Answers1

0

You can do this:

  • do not specify Provides, but
  • override %__find_provides.
fge
  • 119,121
  • 33
  • 254
  • 329
  • Override it with what? A command? Does it output each value on STDOUT? One on each line or comma separated? Could you demonstrate using `echo`? – Schwern Dec 21 '12 at 23:57
  • Yes, a shell script for instance. The default depends on your installation (here is is `/usr/lib/rpm/find-provides`. A simple script would be `echo foo`, which means the only provided element is `foo`. – fge Dec 22 '12 at 10:19
  • What if there's more than one provided element, what would the `echo` command be? And what is the syntax? I presume `%__find_provides echo foo` isn't going to do it. Could you write it out please? – Schwern Dec 23 '12 at 07:39
  • This is one dependency per line -- the implementation is therefore obvious enough ;) – fge Dec 23 '12 at 15:55
  • Humor me and spell out the whole line exactly as you'd write it in a spec file please. – Schwern Dec 24 '12 at 02:11