[英]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. 我有一个打包为RPM的Java应用程序,该应用程序已经运行了好一阵子,直到我推出更新的java-1.7.0-oracle-devel程序包为止。
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. 用于构建我的java-1.7.0-oracle-devel软件包的规范文件大致基于: https : //github.com/puzzle/java-oracle-rpm/blob/master/java-1.7.0-oracle- devel.spec ,它管理“替代项”,但与其他版本的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. 我正在使用的ant软件包(通过BuildRequires指定)是基础存储库中的标准CentOS软件包,这需要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.
java-1.6.0-openjdk-devel和java-1.7.0-oracle-devel都提供java-devel,因此它正在获取提供此功能的最新软件包。
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). 我试过在spec文件中指定java-devel,它需要的内容比java-devel 1.7.0少,但这是行不通的-构建过程仍然将java-1.6.0-openjdk-devel和java- 1.7.0-oracle-devel(作为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. 我在这里有一个解决方法,因为我在使用模拟程序,我可以简单地禁用包含java-1.7.0-oracle-devel的存储库,但是如果可能的话,我希望能够在RPM规范中实现这一目标: d希望能够声明java-1.6.0-openjdk-devel提供了“ java-devel”。
Do RPM specs have the capability to manage dependencies of dependencies in this manner? RPM规范是否具有以这种方式管理依赖关系的能力?
I don't believe RPM is capable of encoding a requirement like that (of multiple parts). 我不认为RPM能够编码这样的需求(多个部分)。
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. 要么专门指定一个版本(即
BuildRequires: java-devel = 1.6.0
),要么删除最低版本规范(因为假设您的环境会满意),并且仅包含BuildRequires: java-devel < 1.7.0
条目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.