8

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?

Dmitry Yudakov
  • 15,364
  • 4
  • 49
  • 53

4 Answers4

7

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.

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

Graham Miln
  • 2,724
  • 3
  • 33
  • 33
jcoffland
  • 5,238
  • 38
  • 43
3

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

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
2

You might be able to define the groups at the repo-level instead of the package level using yum groups. Once you have your groups defined, you should be able yo use the 'yum groupinfo' command to see the packages in each group.

pwan
  • 2,894
  • 2
  • 24
  • 38
  • unfortunately it doesn't help you to see what optional packages from the given group are installed on the system, so it's convenient mostly when you have static groups where all packages must be installed – Dmitry Yudakov Jan 17 '11 at 09:52
1

This is an old post but since it still shows up on Google;

Nowadays at least OpenSUSE uses the Group: field as a space-separated tags field instead of an hierarchial tree, so for SUSE packages you can simply space separate the tags you'd like your package to belong to.

See: https://en.opensuse.org/openSUSE:Package_group_guidelines for details.

Linus Swälas
  • 130
  • 1
  • 6