php-pear package build problem

Pavel Alexeev (aka Pahan-Hubbitus) forum at
Sat Sep 10 16:00:47 UTC 2011

07.09.2011 18:59, TASAKA Mamoru wrote:
> If you still see some issue, please write in detail what you see (and 
> post
> the spec file you are currently using).
Yes, apparently I still have it.
The long time awhile I have there condition:
%if %( php -r "echo (version_compare(PHP_VERSION, '5.3.0', '>=') ? 1 : 
0);" )
today it produce parse error.

Now I change it on:
%if %( php -r "echo (version_compare(PHP_VERSION, '5.3.0', '>=') ? 1 : 
0);" &>/dev/null || echo 0 )
but on make srpm got error:
parseExpressionBoolean returns -1
error: query of specfile 
/home/pasha/SOFT/git/php-pecl-runkit/master/php-pecl-runkit.spec failed, 
can't parse
Could not make an srpm: Could not parse the spec, exited 1

Obviously it because () in construction, but they in quotes!?
Changing it to:
%if %( php -r "echo \(version_compare\(PHP_VERSION, '5.3.0', '>='\) ? 1 
: 0\);" &>/dev/null || echo 0 )
give me chance build package. See but it also 
doesn't work as intended, patches doesn't applied: 

If I redirecting to null only stderr and remove parenthesis escaping:
%if %( php -r "echo (version_compare(PHP_VERSION, '5.3.0', '>=') ? 1 : 
0);" 2>/dev/null || echo 0 )
package also built: and rpm do 
what I want: 

So, it seams I completely don't understand rpm expression parsing logic:
1) Why "&>/dev/null" is incorrect? Independent on shell were it intended 
to be parsed, macros just should pass content of macros %() to shell and 
return string value. Or not?
2) Why "&>/dev/null" became correct if I escape parenthesis (even if 
command really not work)?
3) Why initial command work before and not now? Is it bug or expected 

With best wishes, Pavel Alexeev (aka Pahan-Hubbitus). For fast contact 
with me use jabber: Hubbitus at
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the devel mailing list