Since the version 5.1.2-5 (current FC5 one), the Core php package provides the "php-api" virtual, which should be used by the extra modules to specify particular php API dependency. Use "php-api" instead of (or additional to) "php" in the "Requires:" field.
Created attachment 126807 [details] spec file patch. Note: it is already checked that it is good for FE buildsys :)
Would: php -i |grep "PHP API"|awk '{ print $4 }' be an easier way of getting the API ver? It's not as good in the sense that it's not actually checking against the ultimate authority (php.h) but given that php-devel depends on the same version of php, it should give the same result.
For me, php -i |grep "PHP API"|awk '{ print $4 }' produces: </td><td as php -i |grep "PHP API" produces: <tr><td class="e">PHP API </td><td class="v">20020918 </td></tr> Anyway, gcc+php-config is: 1. IMO most robust way 2. don't use any extra utilities (php, awk), as gcc and php-config are already used when build.
If "php" is the CLI version of PHP I believe it should give the plaintext rather than HTML output unless explicitly configured otherwise. So it should be OK on the build system. However, you have probably shown why it might be more robust to use the CC method :)
> If "php" is the CLI version of PHP AFAIK both php-CLI and php-CGI are created at rpmbuild time, but then only php-CGI goes to binary rpms...
Due to some strange behavior of ppc build system, we should change dir before apiver auto-detection (for example, to %{_tmppath}): %define apiver %(cd %{_tmppath}; echo PHP_API_VERSION | %{__cc} -E --include=php.h `php-config --includes` - | tail -1) else buildsys on PPC arch reports: "./php.h: Permissin denied" (i386 and i86_64 arches are not affected). Surely it seems to be an ugly hack, but IMHO it is some reliable workaround.