Re: php-pear package build problem

2011-09-12 Thread Pavel Alexeev (aka Pahan-Hubbitus)

13.09.2011 09:36, Remi Collet wrote:
> Le 07/09/2011 09:14, Pavel Alexeev (aka Pahan-Hubbitus) a écrit :
>
>>> "%if 0%{?php_zend_api:1}" if you want to use (guessing php_zend_api
>>> is not defined as "0" even on EPEL)
>> Just for interest - is there change of minimal buildroot happened since
>> F15? Why it was worked before? Was it announced and I miss something?
> This have been discussed on php-devel mailing list (February 2011)
> Probably, as a php package maintainer you should subscribe to this list
> (small traffic)
>
> A lot of package are already fixed in rawhide and could be use as example.
>
> Remi
>
Hello, Remi.

I believe I subscribed to that. But I have not seen such discussion. May 
be I just miss id because was very overloaded by work, sorry.

-- 
With best wishes, Pavel Alexeev (aka Pahan-Hubbitus). For fast contact 
with me use jabber: hubbi...@jabber.ru
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: php-pear package build problem

2011-09-12 Thread Remi Collet
Le 07/09/2011 09:14, Pavel Alexeev (aka Pahan-Hubbitus) a écrit :

>> "%if 0%{?php_zend_api:1}" if you want to use (guessing php_zend_api
>> is not defined as "0" even on EPEL)

> Just for interest - is there change of minimal buildroot happened since 
> F15? Why it was worked before? Was it announced and I miss something?

This have been discussed on php-devel mailing list (February 2011)
Probably, as a php package maintainer you should subscribe to this list
(small traffic)

A lot of package are already fixed in rawhide and could be use as example.

Remi

-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: php-pear package build problem

2011-09-12 Thread Pavel Alexeev (aka Pahan-Hubbitus)

12.09.2011 19:57, TASAKA Mamoru wrote:

Pavel Alexeev (aka Pahan-Hubbitus) wrote, at 09/11/2011 01:01 AM +9:00:


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:
error: 
/home/pasha/SOFT/git/php-pecl-runkit/master/php-pecl-runkit.spec:74: 
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
Because this php command succeeds (perhaps) and return status (of php) 
is 0. Then php -r prints
the result "1" to stdout but this is redirected to /dev/null. The 
latter || echo 0 is not
evaluated because php -r succeeds. So (with php installed) this is %if 
(empty) , and

rpmbuild cannot parse it.

Oh, indeed it just my inattention. Thank you.
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: php-pear package build problem

2011-09-12 Thread TASAKA Mamoru
Pavel Alexeev (aka Pahan-Hubbitus) wrote, at 09/11/2011 01:01 AM +9:00:

> 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:
> error: /home/pasha/SOFT/git/php-pecl-runkit/master/php-pecl-runkit.spec:74: 
> 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
Because this php command succeeds (perhaps) and return status (of php) is 0. 
Then php -r prints
the result "1" to stdout but this is redirected to /dev/null. The latter || 
echo 0 is not
evaluated because php -r succeeds. So (with php installed) this is %if (empty) 
, and
rpmbuild cannot parse it.

> Obviously it because () in construction, but they in quotes!?
See above

> 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 http://koji.fedoraproject.org/koji/taskinfo?taskID=3341569 but it also 
> doesn't work as intended,
> patches doesn't applied: 
> http://koji.fedoraproject.org/koji/getfile?taskID=3341573&name=build.log
> 

Because with this php command fails to understand the part \(\)
(perhaps) and return status is non-zero (perhaps), so the latter || echo 0 is
evaluated. So this is "%if 0", and patches are not 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: 
> http://koji.fedoraproject.org/koji/taskinfo?taskID=3341605 and rpm do
> what I want: 
> http://koji.fedoraproject.org/koji/getfile?taskID=3341605&name=build.log
> 
See the first case you wrote, This time the output of php -r command "1" 
printed out to
stdout is used so this is actually %if 1, so the result is as expected.

> 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?
See above

> 2) Why "&>/dev/null" became correct if I escape parenthesis (even if command 
> really not work)?
I don't see the corresponding example you tried for this case.

> 3) Why initial command work before and not now? Is it bug or expected change?
I think the current behavior is expected.

Regards,
Mamoru
  



-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel


Re: php-pear package build problem

2011-09-10 Thread Pavel Alexeev (aka Pahan-Hubbitus)

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:
error: 
/home/pasha/SOFT/git/php-pecl-runkit/master/php-pecl-runkit.spec:74: 
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 
http://koji.fedoraproject.org/koji/taskinfo?taskID=3341569 but it also 
doesn't work as intended, patches doesn't applied: 
http://koji.fedoraproject.org/koji/getfile?taskID=3341573&name=build.log 



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: 
http://koji.fedoraproject.org/koji/taskinfo?taskID=3341605 and rpm do 
what I want: 
http://koji.fedoraproject.org/koji/getfile?taskID=3341605&name=build.log 



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 
change?



--
With best wishes, Pavel Alexeev (aka Pahan-Hubbitus). For fast contact 
with me use jabber: hubbi...@jabber.ru
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: php-pear package build problem

2011-09-10 Thread Pavel Alexeev (aka Pahan-Hubbitus)

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:
error: 
/home/pasha/SOFT/git/php-pecl-runkit/master/php-pecl-runkit.spec:74: 
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 
http://koji.fedoraproject.org/koji/taskinfo?taskID=3341569 but it also 
doesn't work as intended, patches doesn't applied: 
http://koji.fedoraproject.org/koji/getfile?taskID=3341573&name=build.log 



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: 
http://koji.fedoraproject.org/koji/taskinfo?taskID=3341605 and rpm do 
what I want: 
http://koji.fedoraproject.org/koji/getfile?taskID=3341605&name=build.log 



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 
change?



--
With best wishes, Pavel Alexeev (aka Pahan-Hubbitus). For fast contact 
with me use jabber: hubbi...@jabber.ru
-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: php-pear package build problem

2011-09-07 Thread TASAKA Mamoru
Pavel Alexeev (aka Pahan-Hubbitus) wrote, at 09/07/2011 04:14 PM +9:00:
> 06.09.2011 18:47, TASAKA Mamoru wrote:
>> Pavel Alexeev (aka Pahan-Hubbitus) wrote, at 09/06/2011 07:00 PM +9:00:
>>> 05.09.2011 19:17, TASAKA Mamoru wrote:
>> 2. The line 28

 %if %{?php_zend_api}0

 cannot be parsed when %php_zend_api is not integer (and this is
 actually happening
 currently). The correct line would be something like

 %if 0%{?php_zend_api?1:0}

 however it seems this line is no longer needed on Fedora:
 http://fedoraproject.org/wiki/Packaging:PHP#C_extensions_.28PECL_and_others.29

>>> It stil needed for EPEL
>>> http://fedoraproject.org/wiki/Packaging:EPEL#PHP_ABI_Check_Handling
>>> and exactly in this form
>>
>> Then you have to write this only for EPEL build. Again on F-17 parsing
>> "%if %{?php_zend_api}0" actually failed, because php_zend_api is not
>> integer
>> (actually %php_zend_api is now 20090626-x86-32 on F-17 i686)
>> This EPEL form is no longer valid on Fedora (at least on F-17).
>>
>> However "%if 0%{?php_zend_api?1:0}" is also wrong and this should be
>> "%if 0%{?php_zend_api:1}" if you want to use (guessing php_zend_api
>> is not defined as "0" even on EPEL)
>>
> It wasn't sole issue, but I understand your idea. Thank you again.
> It also was in php command below what I also make silent fail if command
> not found.

If you still see some issue, please write in detail what you see (and post
the spec file you are currently using).

> Just for interest - is there change of minimal buildroot happened since
> F15? Why it was worked before? Was it announced and I miss something?

F-15+ is using rpm 4.9.x. F-14 uses 4.8.1. At least this changed (note
that your initial spec file does not work even on F-15). Perhaps this
is related, although I have not examined further.

Regards,
Mamoru



-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel


Re: php-pear package build problem

2011-09-07 Thread Pavel Alexeev (aka Pahan-Hubbitus)
06.09.2011 18:47, TASAKA Mamoru wrote:
> Pavel Alexeev (aka Pahan-Hubbitus) wrote, at 09/06/2011 07:00 PM +9:00:
>> 05.09.2011 19:17, TASAKA Mamoru wrote:
> 2. The line 28
>>>
>>> %if %{?php_zend_api}0
>>>
>>> cannot be parsed when %php_zend_api is not integer (and this is
>>> actually happening
>>> currently). The correct line would be something like
>>>
>>> %if 0%{?php_zend_api?1:0}
>>>
>>> however it seems this line is no longer needed on Fedora:
>>> http://fedoraproject.org/wiki/Packaging:PHP#C_extensions_.28PECL_and_others.29
>>>
>> It stil needed for EPEL
>> http://fedoraproject.org/wiki/Packaging:EPEL#PHP_ABI_Check_Handling
>> and exactly in this form
>
> Then you have to write this only for EPEL build. Again on F-17 parsing
> "%if %{?php_zend_api}0" actually failed, because php_zend_api is not
> integer
> (actually %php_zend_api is now 20090626-x86-32 on F-17 i686)
> This EPEL form is no longer valid on Fedora (at least on F-17).
>
> However "%if 0%{?php_zend_api?1:0}" is also wrong and this should be
> "%if 0%{?php_zend_api:1}" if you want to use (guessing php_zend_api
> is not defined as "0" even on EPEL)
>
It wasn't sole issue, but I understand your idea. Thank you again.
It also was in php command below what I also make silent fail if command 
not found.

Just for interest - is there change of minimal buildroot happened since 
F15? Why it was worked before? Was it announced and I miss something?

-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel


Re: php-pear package build problem

2011-09-06 Thread TASAKA Mamoru
Pavel Alexeev (aka Pahan-Hubbitus) wrote, at 09/06/2011 07:00 PM +9:00:
> 05.09.2011 19:17, TASAKA Mamoru wrote:

>> First:
>> * php-devel is not installed when trying to package srpm from spec and 
>> sources. This is
>> what koji (build server) always does. i.e. koji tries to package srpm first, 
>> at that time
>> only minimum buildroot packages are installed. Then after srpm is 
>> successfully packaged,
>> koji (yum) installs additional packages specified by BuildRequires. After 
>> that koji will
>> actually try to build binary rpms from the spec file.
>>
> No, in this case it was scratch build, so initially srpm was submitted.

Well, it is still true that at the first time only minimum buildroot packages
are installed, because at this time koji does not know what packages are needed 
yet.
So koji first unpacks your srpm and parse your spec to check what packages
are listed in BuildRequires. Again this time no packages
listed in BuildRequires are installed yet. So if parsing your spec file fails
when only buildroot packages are installed, still no BuildRequires packages
are installed, even on scratch build.

>> So you must ensure that your srpm can successfully packaged even if none of 
>> packages
>> in BuildRequires are installed (and only minimum buildroot packages are 
>> installed).
>>
>> * Then looking at your spec file, there are actually two issues which 
>> prevents srpm
>> from being properly packaged.
>>
>> 1. The line 63
>>
>> %if %( php -r 'echo version_compare(PHP_VERSION, "5.3.0", ">=") ? 1 : 0;' )
>>
>> cannot be parsed when php is not installed (again, when koji first tries to 
>> package
>> srpm, BuildRequires rpms are not installed yet). The correct line would be 
>> something
>> like:
>>
>> %if %( which php &>/dev/null && php -r 'echo version_compare(PHP_VERSION, 
>> "5.3.0", ">=") ? 1 : 0'|| echo -n 0 )
>>
>> However please reconsider if you really want this complicated line.
> This line needed and I don't see any problems with it:
> which php &>/dev/null && php -r 'echo version_compare(PHP_VERSION, "5.3.0", 
> ">=") ? 1 : 0'|| echo -n 0
>
> always should return with 0 exit status and produce only 0 or 1 as result, 
> even if php not installed.
>
>>
>> 2. The line 28
>>
>> %if %{?php_zend_api}0
>>
>> cannot be parsed when %php_zend_api is not integer (and this is actually 
>> happening
>> currently). The correct line would be something like
>>
>> %if 0%{?php_zend_api?1:0}
>>
>> however it seems this line is no longer needed on Fedora:
>> http://fedoraproject.org/wiki/Packaging:PHP#C_extensions_.28PECL_and_others.29
> It stil needed for EPEL 
> http://fedoraproject.org/wiki/Packaging:EPEL#PHP_ABI_Check_Handling and 
> exactly in this form

Then you have to write this only for EPEL build. Again on F-17 parsing
"%if %{?php_zend_api}0" actually failed, because php_zend_api is not integer
(actually %php_zend_api is now 20090626-x86-32 on F-17 i686)
This EPEL form is no longer valid on Fedora (at least on F-17).

However "%if 0%{?php_zend_api?1:0}" is also wrong and this should be
"%if 0%{?php_zend_api:1}" if you want to use (guessing php_zend_api
is not defined as "0" even on EPEL)

Regards,
Mamoru


-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel


Re: php-pear package build problem

2011-09-06 Thread Pavel Alexeev (aka Pahan-Hubbitus)

05.09.2011 19:17, TASAKA Mamoru wrote:

(Well, as you posted your first mail to fedora devel list, please
 keep sending your reply also to devel list. This type of private
 mails will be very confusing to many people who are also watching 
mailing

 list because they cannot know what is currently discussed.

 Would you tell me why you replied to my mail privately, although
 I posted to devel list? This time I will mail to you privately, however
 unless you have some special reason next
 time I will want to post my mail also to devel list so that people can
 see current discussion)
Mamoru, thank you very much for the answers. And excuse me - it was 
mistake. Now I answer in list.


First:
* php-devel is not installed when trying to package srpm from spec and 
sources. This is
  what koji (build server) always does. i.e. koji tries to package 
srpm first, at that time
  only minimum buildroot packages are installed. Then after srpm is 
successfully packaged,
  koji (yum) installs additional packages specified by BuildRequires. 
After that koji will

  actually try to build binary rpms from the spec file.


No, in this case it was scratch build, so initially srpm was submitted.
  So you must ensure that your srpm can successfully packaged even if 
none of packages
  in BuildRequires are installed (and only minimum buildroot packages 
are installed).


* Then looking at your spec file, there are actually two issues which 
prevents srpm

  from being properly packaged.

1. The line 63

   %if %( php -r 'echo version_compare(PHP_VERSION, "5.3.0", ">=") ? 1 
: 0;' )


   cannot be parsed when php is not installed (again, when koji first 
tries to package
   srpm, BuildRequires rpms are not installed yet). The correct line 
would be something

   like:

   %if %( which php &>/dev/null && php -r 'echo 
version_compare(PHP_VERSION, "5.3.0", ">=") ? 1 : 0'|| echo -n 0 )


   However please reconsider if you really want this complicated line.

This line needed and I don't see any problems with it:
which php &>/dev/null && php -r 'echo version_compare(PHP_VERSION, 
"5.3.0", ">=") ? 1 : 0'|| echo -n 0


always should return with 0 exit status and produce only 0 or 1 as 
result, even if php not installed.




2. The line 28

   %if %{?php_zend_api}0

   cannot be parsed when %php_zend_api is not integer (and this is 
actually happening

   currently). The correct line would be something like

   %if 0%{?php_zend_api?1:0}

   however it seems this line is no longer needed on Fedora:
   
http://fedoraproject.org/wiki/Packaging:PHP#C_extensions_.28PECL_and_others.29
It stil needed for EPEL 
http://fedoraproject.org/wiki/Packaging:EPEL#PHP_ABI_Check_Handling and 
exactly in this form


Regards,
Mamoru







-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel

Re: php-pear package build problem

2011-09-04 Thread TASAKA Mamoru
Pavel Alexeev (aka Pahan-Hubbitus) wrote, at 09/05/2011 03:59 AM +9:00:
> Hello.
>
> I have couple of bugs with FBFS similar to [1]. At first glance it is trivial 
> - php-config doesn't found [2].
>
> But what interesting, it still there as was in Fedora 15:
> [pasha@vbox temp]$ repoquery --whatprovides '*/php-config'
> php-devel-0:5.3.6-2.fc15.i686
> [pasha@vbox temp]$ repoquery --disablerepo='*' --enablerepo='rawhide' 
> --whatprovides '*/php-config'
> php-devel-0:5.3.8-1.fc17.i686
>
> And php-devel BR is explicitly mentioned in spec as:
> BuildRequires: php-devel >= 5.1.0
>
> But what very interesting according to root.log [3] it wasn't pulled, and 
> even no error produced?
>
> What happened??
>
> 1 - https://bugzilla.redhat.com/show_bug.cgi?id=715709
> 2 - http://koji.fedoraproject.org/koji/getfile?taskID=3323691&name=build.log
> 3 - http://koji.fedoraproject.org/koji/getfile?taskID=3323691&name=root.log

2. (build.log) says
error: /builddir/build/SPECS/php-pecl-runkit.spec:33: parseExpressionBoolean 
returns -1

This means that there is something wrong (syntax error or so) with your spec 
file.
To investigate further actually seeing the used spec file is needed.

Regards,
Mamoru



-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel


php-pear package build problem

2011-09-04 Thread Pavel Alexeev (aka Pahan-Hubbitus)

Hello.

I have couple of bugs with FBFS similar to [1]. At first glance it is 
trivial - php-config doesn't found [2].


But what interesting, it still there as was in Fedora 15:
[pasha@vbox temp]$ repoquery --whatprovides '*/php-config'
php-devel-0:5.3.6-2.fc15.i686
[pasha@vbox temp]$ repoquery --disablerepo='*' --enablerepo='rawhide' 
--whatprovides '*/php-config'

php-devel-0:5.3.8-1.fc17.i686

And php-devel BR is explicitly mentioned in spec as:
BuildRequires: php-devel >= 5.1.0

But what very interesting according to root.log [3] it wasn't pulled, 
and even no error produced?


What happened??

1 - https://bugzilla.redhat.com/show_bug.cgi?id=715709
2 - 
http://koji.fedoraproject.org/koji/getfile?taskID=3323691&name=build.log 

3 - 
http://koji.fedoraproject.org/koji/getfile?taskID=3323691&name=root.log 

-- 
devel mailing list
devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/devel