Let's say I'm packaging an RPM which requires one of the following,
Foo Bar Baz
Does RPM support the functionality to put that into a spec file?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
I am going to convert Larsen comment into an answer:
Starting with rpm 4.13.0, rpm supports boolean expressions in all dependencies. https://rpm.org/user_doc/more_dependencies.html
Requires: (pkgA or (pkgB and pkgC))
In your case that would be:
Requires: Foo or Bar or Baz
Availability in rpm-4.13+ means that it is available in RHEL 8 and all recent Fedoras.
If you want this in RHEL 7 then you can workaround it using virtual provides. You can specify:
and then in packages Foo, Bar, Baz you have to put there:
This, unfortunately, requires modification of packages Foo, Bar, and Baz. If they are not under your control and you are on RHEL 7 or older, then you are doomed.
Note that some packages already use this virtual provides. E.g., you can:
Requires: smtp-server Requires: webserver
And e.g., webserver is provided by httpd, nginx, or lightttpd packages.