Reputation: 6000
I am building an RPM which right now marks openjdk-6 as requirement; I would like to add support for openjdk-7 as well; but I am not sure how would I modify the spec file to look for either openjdk6 or openjdk7 as requirement. I read about the concept of virtual package and I am trying to use it. I am adding
Requires: libjvm.so
in my spec; and checking for either 6 or 7 in my %pre section. But the built RPM package is not recognizing libjvm.so .
error: Failed dependencies:
libjvm.so is needed by myapp.x86_64
I tried rpm -q --provides java-1.6.0-openjdk and it lists
libjvm.so()(64bit)
libjvm.so(SUNWprivate_1.1)(64bit)
Am I doing the virtual package dep wrong? Is there a more cleaner/obvious way to mention either or JDK6/7 as dependency?
Upvotes: 0
Views: 994
Reputation: 1440
If you're already checking for openjdk 6 or 7 in the pre section, why don't you just set a variable to populate the requires based on the value returned by your check? If openjdk wasn't so poorly named with the value right in the middle, you could use Requires: openjdk >= 1.6
, but I don't think that will work because they decided to put the version value right in the middle.
Upvotes: 1