如何使RPM依赖于包A或包B? [英] How can I make an RPM depend on package a OR package b?

查看:117
本文介绍了如何使RPM依赖于包A或包B?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎是一个简单的问题,但是文档在这个问题上似乎没什么可说的.我想做类似Requires: vim or emacs的操作,但是当我这样做时,实际上我依赖于vimoremacs.依赖于两个软件包中的一个或另一个的语法是什么?

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则需要该虚拟包.因此,在您的示例中,vimemacs都为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: vimRequires: emacs以及Provides: my-package-text-editor的虚拟my-package-vim-modemy-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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆