Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Several groups in RPM package

Is it possible for single rpm package to belong to several groups?

In spec file you can set package group:

Group: System Environment/Base

What I need is to be able to set several groups for this package (like System|Util|MyCompanyName) - they would be like tags assigned to the package.

When the package is installed I want to query it like

rpm -q --group System

or

rpm -q --group MyCompanyName

and in both cases I should see my package (and others belonging to this group)


Edit:

Many packages may belong to MyCompanyName group, but only few may be installed. I need a way to differentiate our packages from linux system packages - I was planning to do it using the group name


I tried putting several Group: lines, but it only uses the last one. Everything after Group: seems to be taken as one string and I couldn't find a way to split them.

Another solution that I could think of is putting this stuff as PROVIDES and then to query

rpm -q --whatprovides System

but I don't like it this way.

Is there other way to accomplish the requested functionality?

like image 834
Dmitry Yudakov Avatar asked Jan 07 '11 17:01

Dmitry Yudakov


People also ask

What do RPM packages contain?

An RPM package typically contains binary executables, along with relevant configuration files and documentation. The rpm program is a powerful package manager, which can be used to install, query, verify, update, erase and build software packages in the RPM format.

How do I install multiple RPM packages?

To install multiple Vector instances on one machine using RPM, you need a unique set of package names for each instance. You must rebuild each RPM packages to include an instance ID that is unique to the machine. You can then install this package using the instructions described in Install Vector Using RPM Commands.

What are package groups in Linux?

A package group is a collection of packages that serve a common purpose, for instance System Tools or Sound and Video. Installing a package group pulls a set of dependent packages, saving time considerably.

How are packages managed using RPM?

Using RPM , you can install, uninstall, and query individual software packages. Still, it cannot manage dependency resolution like YUM . RPM does provide you useful output, including a list of required packages. An RPM package consists of an archive of files and metadata.


2 Answers

The correct way to specify your company name is via the Vendor tag like this:

Vendor: Yoyodyne, Inc.

To get a list of packages by vendor you can run this command:

rpm -qa --qf '%{NAME} %{VENDOR}\n' | grep -v Yoyodyne

An RPM can only belong to one group. Furthermore, the allowable groups is defined by the distribution. For example, here is the list of valid groups for Mandriva:

http://wiki.mandriva.com/en/Development/Packaging/Groups

To find the valid groups for a particular distribution you must often run the package manager for that distro and look at the list.

RPM is not nearly as well defined as the Debian package format is. There seems to be no official or thorough documentation.

http://www.rpm.org/max-rpm/s1-rpm-inside-tags.html

like image 105
jcoffland Avatar answered Oct 16 '22 04:10

jcoffland


AFAIU, RPMs should belong to a single Group in RPM's GROUPS file or have Group unspecified. Cannot have more than one.

like image 40
Diego Torres Milano Avatar answered Oct 16 '22 04:10

Diego Torres Milano