What does "%if 0%{?..." mean

Jonathan Ryshpan jonrysh at pacbell.net
Sun Jan 18 06:42:32 UTC 2009


On Sat, 2009-01-17 at 23:20 +0100, Jos Vos wrote:
> On Sat, Jan 17, 2009 at 02:09:31PM -0800, Jonathan Ryshpan wrote:
> 
> > I have a spec file with this text.
> >         %if 0%{?build_jack_svn}
> >         %define jack_revision 3190
> >         %define jack_version 0.116.1
> >         %define jack_svndate 20081206.171018
> >         %else
> >         %define jack_version 0.116.1
> >         %endif
> > 
> > What does all this do?  I can't find the form "%if 0%{?mac}" defined
> > anywhere.  I assume it means the macro mac exists and has the value 0 
> > -- is this correct?
> 0%{?build_jack_svn}0%{?build_jack_svn}
> No.
> 
> The "0%{?build_jack_svn}" expands to "0X" where "X" is the value of
> the %{build_jack_svn} macro if this macro is defined, or it expands
> to "0" if the %{build_jack_svn} macro is not defined.

I surmise from this that 
	%if 0%{?build_jack_svn}
is *always* true, since 
	0%{?build_jack_svn}
always has a value.

If so, the "%if" statement above is has no effect, since it is always
true, and the spec file fragment is probably buggy.

Please pardon my ignorance.  My experience with RPMs up to now has been
entirely limited to installing and sometimes building them.

Thanks - jon




More information about the Rpm-list mailing list