In an RPM spec file, what is a good way of requiring a minimum RHEL distribuition? I tried to make RHEL 6.3 a prerequisite using:
Requires: redhat-release-server-6Server >= 6.3
This blocks the install on 6.2 and 6.3 with:
error: Failed dependencies:
redhat-release-server-6Server >= 6.3 is needed by my.package-1.2.0-0.x86_64
I also tried:
Requires: redhat-release >= 6.3
which did not fail the dependecy check on either 6.2 or 6.3.
The redhat-release-server-6Server-6.3.0.3.el6.x86_64 (on my system) seems to be a good candidate as a prerequisite. See http://rhn.redhat.com/errata/RHEA-2012-0971.html . What is not obvious for a novice looking at the package name is that "6Server" is actually the package version. "rpm -q --info" make this clear, though:
So the correct directive is:
I would suggest that instead of required specific version of RHEL, Require the dependency that only appear in the target version (e.g. RHEL 6.3)
Following not only cause problem you mentioned, but also block the installation for the client and workstation users (
6Client
and6Workstation
)