如何使 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 的虚拟
,分别和my-package-vim-mode
和 my-package-emacs-mode
RPMProvides: my-package-text-editor
,然后让你的包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屋!