rpmbuildrpm-spec

what is the '0' meaning in rpm conditional macros


When reading some rpmbuild spec files, I come across some of the conditional macros which puzzle me.

My guess is that '0' indicates the next expression to be either 'nil' or a number so that rpm would consider them as a number (such as 06, 0, or 01 in above examples) instead of a string or empty string. But I am not sure about it.

Unfortunatly, most of the online tutorial materials did not cover this topic.


Solution

  • You got it right; it's a safeguard. The %{?rhel} says "replace with the rhel macro if it exists and it is OK if it does not (the ?)."

    So, if rpmbuild replaced it with nothing, the resulting if > 7 would barf.