Need some help understanding the RPM spec bit operator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I am having some trouble understanding how the RPM spec bit operator
seems to work. The documentation that I have been able to find confirms
my understanding of it but, in practice, it doesn't work that way.

In my spec file, I define a variable like this:
%{!?debug: %global debug 0}
%if %{debug}
%define __strip /bin/true
%endif

Later on I use that same variable like this:
./configure --prefix=%{_prefix} %{?debug: --enable-debug}

The rpmbuild command line can be called with "--define 'debug 1'" when
compiling with debugging enabled of without that "--define" when
compiling without debugging.

However, no matter what the value of the %{debug} variable is,
"--enable-debug" is present on the ./configure command line. Why is
that? I thought that the bit operator tests not only whether a variable
is defined but also whether it's value is 0 or 1?

-- 
Mitko Haralanov					 mitko@xxxxxxxxxx
Senior Software Engineer			     650.934.8064
NSG InfiniBand Engineering		    http://www.qlogic.com
==========================================
_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxxxxx
http://lists.rpm.org/mailman/listinfo/rpm-list


[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux