Check whether a macro is undefined or has a specific value

Marco listaddr at gmail.com
Tue Aug 16 11:22:20 UTC 2011


Hello,

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.

In my spec file, I've tried

%if %{__foo}
# do something
%endif

%if %{__foo} = "1"
# do something
%endif

but they all fail. Thanks in advance for any help.


More information about the Rpm-list mailing list