Check whether a macro is undefined or has a specific value

Daniel Neuberger daniel.neuberger at
Tue Aug 16 13:45:01 UTC 2011

On 08/16/2011 07:22 AM, Marco wrote:
> as the subject says: If macro %{__foo} is defined and has value 1, I'd
> like to do something; otherwise (undefined or value != 1), skip.

See the section about defining conditional macros:

Here's an example that's similar to what you're talking about:

%define  _default_release 1
%define  _release 

I only know how to check for definition, not equality, but it shouldn't 
be too hard to make that work for you.

- Daniel

More information about the Rpm-list mailing list