简体   繁体   中英

RPM - manage dependencies of dependencies

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 package must be compiled with ant, using java-1.6.0-openjdk-devel
  • The compiled package must run under java-1.7.0-oracle-devel

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?

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 (ie 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM