Hi,
We have some pending minor issues/questions with PHP packaging we should make clearer :
1/ use of /usr/share/php
=> 1 folder per library
2/ conditional in ABI check and in post/postun scriplet
This conditions are present to maintain compatibility with older PHP version (5.1.6 on EL-5) and could be removed if package requires a recent version (> 5.2)
3/ ABI check
With the update of PHP 5.3.0 in rawhide, I discover that a lot of C extensions doesn't use ABI check, Guidelines set is mandatory for PECL extension.
Package could be installed, but extension couldn't be load, with the standard PHP error :
Module compiled with module API=20060613 PHP compiled with module API=20090626
It seems clear it should be mandatory for all C extension.
See bugs :
cups https://bugzilla.redhat.com/show_bug.cgi?id=511106 ice https://bugzilla.redhat.com/show_bug.cgi?id=511068 graphviz https://bugzilla.redhat.com/show_bug.cgi?id=511092 uuid https://bugzilla.redhat.com/show_bug.cgi?id=511115
Please review my change proposal https://fedoraproject.org/wiki/PackagingDrafts/PHP
Remi
On 14/07/09 17:38, Remi Collet wrote:
We have some pending minor issues/questions with PHP packaging we should make clearer :
Thanks for doing this work Remi.
1/ use of /usr/share/php
=> 1 folder per library
Agreed, but I would change the word "extension" to "software" to avoid confusion with binary extensions, and re-word this a bit make the text clearer and more specific, for example:
"Non-PEAR PHP software which provides shared libraries should put its PHP source files for such shared libraries in a subfolder of /usr/share/php, named according to the name of the software. For example, a library called "Whizz_Bang" (with a RPM called php-something-Whizz-Bang) would put the PHP source files for its shared libraries in /usr/share/php/Whizz_Bang ."
2/ conditional in ABI check and in post/postun scriplet
This conditions are present to maintain compatibility with older PHP version (5.1.6 on EL-5) and could be removed if package requires a recent version (> 5.2)
I would suggest an easier-to-read introduction:
"To be certain that a binary extension will run correctly with a particular version of PHP, it is necessary to check that a particular package has both API and ABIs matching the installed version of PHP. The mechanism for doing this has evolved over time and is as follows:"
For the second part, I would split the specfile template into three parts as follows:
For Fedora (all current versions): BuildRequires: php-devel Requires: php(zend-abi) = %{php_zend_api} Requires: php(api) = %{php_core_api}
For Fedora EPEL 5: BuildRequires: php-devel Requires: php-api = %{php_apiver}
There is no way of checking the ABI with packages for Fedora EPEL 5.
For a spec file which is compatible with both Fedora and EPEL 5: BuildRequires: php-devel %if %{?php_zend_api}0 Requires: php(zend-abi) = %{php_zend_api} Requires: php(api) = %{php_core_api} %else Requires: php-api = %{php_apiver} %endif
No API/ABI dependencies are available for Fedora EPEL 4 packages.
3/ ABI check
[...]
Module compiled with module API=20060613 PHP compiled with module API=20090626
It seems clear it should be mandatory for all C extension.
Definitely.
Tim
Le 18/07/2009 11:57, Tim Jackson a écrit :
Thanks for your corrections (applied)
There is no way of checking the ABI with packages for Fedora EPEL 5.
In fact, when I rebuild all extensions (for 5.3) I notice the solution used by APC which is very specific to EL-5
%global php_zendabiver %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP Extension => //p') | tail -1)
Requires: php-zend-abi = %{php_zendabiver}
Could be usefull, as php 5.1.x and 5.2.x provides both the same API (20041225) but different ABI (20050922 < 20060613)
$ rpm -qp --provides /tmp/php-common-5.1.6-23.el5.i386.rpm | grep 200 php-api = 20041225 php-zend-abi = 20050922
Remi.
php-devel@lists.fedoraproject.org