Issue
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?
Solution
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
Answered By - jcoffland