[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]