English 中文(简体)
How can I make an RPM depend on package a OR package b?
原标题:

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?

最佳回答

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.

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.

问题回答

If packages don t have common Provide, and you don t want to rebuild and maintain forks of that packages, but they both do provide same file, you can depend on a file. For example:

Requires: /usr/bin/pear

That way your package won t matter if pear binary is provided by php-pear or php53-pear.

There is no such capability in rpm. Require a virtual provides that the packages have in common, if there is one.





相关问题
How to structure files / dependencies in Visual C++ project

This is more of a design question than a C++ question. I m working on a Texas Hold Em poker game in C++. So far, I have a HandChecker module written that is responsible for determining a player s ...

draw dependency graph for a java class

Heyho, I m searching for a tool like JDepend to draw a graph for a java classfile. JDepend seams to be fine, but it s not resolving the deps from the deps (maybe I m just missing some special options?)...

How to use the -MG flag in cc 4.4.1?

I ve recently upgraded my Ubuntu installation from Jaunty to Karmic. This apparently includes an update of the GNU C compiler, because code that compiled previously no longer does. Running cc 4.4.1 (...

How to manually disable/blacklist Maven repository

In my base project I use dependency of JasperReports which has non-existent repository declaration in its pom. When I run every Maven commad there is dependency looking for commons-collection in this ...

Batch Job Dependencies Using Open Source/Free Software

I run a large data warehouse plant where we have a lot of nightly jobs running concerruently however many have dependencies on a extract or data load process before they start. Currently we use an ...

热门标签