Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 885
kdt Avatar asked Jan 26 '10 13:01

kdt


People also ask

Can you create an RPM from an installed package?

Rpmerizor is a script that allows you to create an RPM package from installed files. You simply have to specify files on the command line and answering a few interactive questions to fill rpm meta-data (package name, version ...). You can also use it in batch mode with command line options for meta-data.

How do you calculate dependent RPM?

You can also get a list of dependencies for a RPM package using repoquery tool. repoquery works whether or not a target package is installed. This tool is included in yum-utils package. For repoquery to work, your computer needs network connectivity since repoquery pulls information from Yum repositories.

What package provides RPM?

RPM stands for Red Hat Package Manager. It was developed by Red Hat and is primarily used on Red Hat-based Linux operating systems (Fedora, CentOS, RHEL, etc.). An RPM package uses the . rpm extension and is a bundle (a collection) of different files.


3 Answers

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.

like image 86
Josh Kelley Avatar answered Jan 14 '23 19:01

Josh Kelley


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.

like image 21
Jakov Sosic Avatar answered Jan 14 '23 19:01

Jakov Sosic


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

like image 45
Ignacio Vazquez-Abrams Avatar answered Jan 14 '23 18:01

Ignacio Vazquez-Abrams