Detecting version in a SPEC file

Rex Dieter rdieter at math.unl.edu
Mon Feb 19 12:46:02 UTC 2007


Roland McGrath wrote:

> Your Buildrequires are your declaration of what is required for the build
> the spec wants to do.  You don't want it to depend on what happens to be
> around.
> 
> I think what you want to do is:
> 
> %define gnupg_version 1.2
> %if "%fedora" >= "6"
> %define gnupg_version 1.4
> %endif
> %if "%rhel" >= "5"
> %define gnupg_version 1.4
> %endif

Or if you like the shorter, but slightly harder to read:
%if 0%{?fedora} >= 6 || 0%{?rhel} >= 5
%define gnupg_version 1.4
%endif

-- Rex




More information about the fedora-devel-list mailing list