I have a package that I need to be compatible with openjdk 11 and oracle java 11. I'm trying to create a metapackage that can depend on openjdk java 11 or oracle java 11:
My openjdk metapackage spec is:
Name: openjdk-11-adapter Version: 0 Release: 0 Epoch: 0 Summary: NA License: NA Provides: java-11-metapackage Requires: jre-11 >= 11 %description %prep %build %install %files
The oracle java metapackage spec is:
Name: oracle-11-adapter Version: 0 Release: 0 Epoch: 0 Summary: NA License: NA Provides: java-11-metapackage Requires: jre >= 2000:11 %description %prep %build %install %files
So now my package can depend on
java-11-metapackage and have a dependency on either version.
When I install it, I expect that
yum would install whichever java is available.
What's ACTUALLY happening is that when I install my package through yum, I know that
jre-11 is available through
java-11-openjdk but yum will ALWAYS try to install the
oracle-11-adapter and complain that there is nothing to satisfy the
jre >= 2000:11 dependency. The
openjdk-11-adapter is definitely known to yum, but ignored.
My question is, WHY does yum ignore the satisfiable
openjdk-11-adapter, and instead try to install the unsatisfiable
oracle-11-adapter? How does it determine install suitability?
I noticed that if I renamed
aaaoracle-11-adapter, yum will behave as expected and install the java adapter whose dependencies can be satisfied, but this feels far too hacky a solution for me to put it into production.