Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to figure out how to make a package of mine depend on anything that provides "java", but I'm not sure what to even look up. Apparently "yum provides" is a command for finding out which package contains a particular file, and "yum info" doesn't seem to have the information I want.

Basically, my OS has a package called "java-1.6.0-openjdk", and my package requires some implementaiton of Java, but it would work perfectly fine on Oracle Java, or Java 7, so I won't want to be that specific about it. Is there a way to just depend on anything that provides Java?

share|improve this question
up vote 2 down vote accepted

Thread is a bit old but not answered...

You can find what your java provides with rpm:

[mdavis@x1pt01 yumrepo]$ rpm -q --provides java-1.5.0-gcj-1.5.0.0-29.fc12.x86_64
jaas = 1.5.0.0-29.fc12
java = 1.5.0
java-1.4.2-gcj-compat > 1.4.2.0-40jpp.111
java-1.5.0 = 1.5.0.0-29.fc12
java-gcj = 1.5.0.0-29.fc12
java-gcj-compat = 1.0.79
java-sasl = 1.5.0.0-29.fc12
jaxp_parser_impl = 1.5.0.0-29.fc12
jce = 1.5.0.0-29.fc12
jdbc-stdext = 1.5.0.0-29.fc12
jdbc-stdext = 3.0
jndi = 1.5.0.0-29.fc12
jndi-cos = 1.5.0.0-29.fc12
jndi-dns = 1.5.0.0-29.fc12
jndi-ldap = 1.5.0.0-29.fc12
jndi-rmi = 1.5.0.0-29.fc12
jre = 1.5.0
jre-1.5.0 = 1.5.0.0-29.fc12
jre-1.5.0-gcj = 1.5.0.0-29.fc12
jre-gcj = 1.5.0.0-29.fc12
jsse = 1.5.0.0-29.fc12
java-1.5.0-gcj = 1.5.0.0-29.fc12
java-1.5.0-gcj(x86-64) = 1.5.0.0-29.fc12

then you can simply "require" the minimum java that you need in the spec file.

Requires: java >= 1.0

share|improve this answer

i think you need to find a name pattern that fits all these packages, for instance, if you need jdk:

yum list installed '*openjdk*'

maybe you just have to find a or b or c, etc. if the package names cannot be summarized with a unique pattern and avoid faluse positives.

I see, then you can make meta (dummy) packages of your own, each of which then requires one of the suitable packages and provides something like "java-installed".

Then your rpm only need to require java-installed and be done.

share|improve this answer
    
I'm able to install a version of Java, my problem is that I don't want my package to depend on a particular version. Basically in the RPM spec file, I have a line that's currently Requires: java-1.6.0-openjdk, but I'd like it to be something like Requires: java where it automatically determines that java-1.6.0-openjdk provides "java". – Brendan Long May 11 '12 at 17:17
    
OK, now I understand. What you need is meta (dummy) packages that will bridge that, as in rpm dependencies you cannot directly specify OR relationship, only AND. – johnshen64 May 11 '12 at 17:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .