Is it possible to dynamize "requires" at RPM build time?

Rex Dieter rdieter at math.unl.edu
Wed Aug 23 02:32:58 UTC 2006


Kai Engert wrote:
> A "Requires:" entry in a SPEC file may define the smallest library
> version acceptable for the resulting RPM package.
> 
> Is it possible by some SPEC logic, to make a "Requires:" entry dynamic?
> 
> In other words, is it possible, at RPM build time, to query the
> installed library release in the build environment, and have the
> produced RPM be dependent on >= that library version?

Yes, use something like:
BuildRequires: foo-devel
%global foo_ver %(foo_bin --version)
%if "%{?foo_ver}" > "0"
Requires: foo >= %{foo_ver}
%endif

-- Rex




More information about the fedora-devel-list mailing list