Reputation: 46
I have a java application that I'm packaging up as an RPM, which had been working well for a while, until I pushed out an updated java-1.7.0-oracle-devel package.
The spec file used to build my java-1.7.0-oracle-devel package is loosely based on: https://github.com/puzzle/java-oracle-rpm/blob/master/java-1.7.0-oracle-devel.spec, which manages 'alternatives' but doesn't have a conflict statement with other versions of java.
The requirements of the app are:
The ant package I'm using (specified via BuildRequires) is the standard CentOS package from the base repo, and this Requires java-devel >= 0:1.5.0. Both java-1.6.0-openjdk-devel and java-1.7.0-oracle-devel provide java-devel, so therefore it is grabbing the latest package that provides this.
I've tried specifying java-devel within the spec file that it needs less that java-devel 1.7.0, but this didn't work - the build process still pulled in both java-1.6.0-openjdk-devel and java-1.7.0-oracle-devel (as a dependency of ant).
BuildRequires: java-devel >= 1.6.0
BuildRequires: java-devel < 1.7.0
I have a workaround here in that as I'm using mock I can simply disable the repo containing java-1.7.0-oracle-devel, but I'd like to be able to achieve this within the RPM spec if possible: I'd like to be able to state that 'java-devel' is provided by java-1.6.0-openjdk-devel.
Do RPM specs have the capability to manage dependencies of dependencies in this manner?
Upvotes: 2
Views: 1340
Reputation: 81022
I don't believe RPM is capable of encoding a requirement like that (of multiple parts).
I believe you have two choices. Either specify a version specifically (i.e. BuildRequires: java-devel = 1.6.0
) or drop the minimum version specification (since you are assuming that will be satisfied in your environment) and include only the BuildRequires: java-devel < 1.7.0
entry.
Upvotes: 0