如何使RPM依赖于包A或包B? [英] How can I make an RPM depend on package a OR package b?
问题描述
这似乎是一个简单的问题,但是文档在这个问题上似乎没什么可说的.我想做类似Requires: vim or emacs
的操作,但是当我这样做时,实际上我依赖于vim
,or
和emacs
.依赖于两个软件包中的一个或另一个的语法是什么?
This seems like a simple question, but the docs don't seem to have anything to say on the subject. I would like to do something like Requires: vim or emacs
but when I do that, I in fact depend on vim
, or
and emacs
. What is the syntax for depending on one or another of two packages?
推荐答案
做到这一点的标准方法是通过虚拟提供:提供RPM的每个状态表明它们提供了虚拟包,而从属RPM则需要该虚拟包.因此,在您的示例中,vim
和emacs
都为Provides: text-editor
,而您的软件包为Requires: text-editor
.
The standard way to do this is via virtual provides: the providing RPMs each state that they provide a virtual package, and the dependent RPM requires that virtual package. So, in your example, vim
and emacs
both Provides: text-editor
, and your package would Requires: text-editor
.
如果您所依赖的软件包没有提供适当的虚拟软件包,那么您可以自己构建一个虚拟软件包.分别创建分别为Requires: vim
和Requires: emacs
以及Provides: my-package-text-editor
的虚拟my-package-vim-mode
和my-package-emacs-mode
RPM,然后将其包装为Requires: my-package-text-editor
.
If the packages that you're depending on don't provide an appropriate virtual package, you could probably hack around this by making up your own. Make dummy my-package-vim-mode
and my-package-emacs-mode
RPMs that Requires: vim
and Requires: emacs
, respectively, and Provides: my-package-text-editor
, then have your package Requires: my-package-text-editor
.
这篇关于如何使RPM依赖于包A或包B?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!