Is there an OR condition for requires:?

Daniel Neuberger daniel.neuberger at gmail.com
Thu Sep 20 16:41:26 UTC 2012


On 07/18/2012 01:01 AM, Scott Gonyea wrote:
> Shouldn't the nc RPM "provides" the netcat utility?

Probably, but not necessarily and regardless, that doesn't help answer 
the question.  The point is that the nc RPM on RHEL does not provide 
"netcat".  Whether it should or not and what it should be called is 
debatable.

I have the same problem with required the "jre" because Sun's RPMs don't 
give adequate provides information.  The jre RPM provides "jre" and the 
jdk RPM provides "jdk".  The jdk RPM though doesn't provide "jre" even 
though in reality it does include the jre.  The openjdk RPMs (at least 
from RHEL) note that they provide "jre" and also "java", which is 
probably how it should be done.

> On Tue, Jul 17, 2012 at 4:10 PM, doc wrote:
>
>     For Debian packages, their Depends: tag allows for an "or" condition
>     during installation, such as
>
>     Depends: a, b, c | d, e
>
>     Does something like that exist for the requires: tag in RPM?
>     Google hasn't been much help.   This situation is I have one rpm
>     that I want to use for SuSE and CentOS/RedHat.   The problem is on
>     CentOS/RedHat the requirement is "nc."  On SuSE, nc is know as
>     "netcat."
>
>     Hence,  I'm looking for something similar to the following:
>
>     requires:  nc | netcat

I'm pretty sure the answer to your question is no.  See 
http://stackoverflow.com/questions/2139621/how-can-i-make-an-rpm-depend-on-package-a-or-package-b. 
  Quoting from Josh Kelly's post:

"The standard way to do this is via virtual provides: the providing RPMs 
each state that they provide a virtual package, and the dependent RPM 
requires that virtual package. So, in your example, vim and emacs both 
Provides: text-editor, and your package would Requires: text-editor.

If the packages that you're depending on don't provide an appropriate 
virtual package, you could probably hack around this by making up your 
own. Make dummy my-package-vim-mode and my-package-emacs-mode RPMs that 
Requires: vim and Requires: emacs, respectively, and Provides: 
my-package-text-editor, then have your package Requires: 
my-package-text-editor."




More information about the Rpm-list mailing list