Bug 186903 - Use "php-api" for dependency
Use "php-api" for dependency
Product: Fedora
Classification: Fedora
Component: php-json (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ignacio Vazquez-Abrams
Fedora Extras Quality Assurance
: EasyFix, FutureFeature, Patch
Depends On:
  Show dependency treegraph
Reported: 2006-03-27 05:54 EST by Dmitry Butskoy
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-04-13 05:43:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
spec file patch. Note: it is already checked that it is good for FE buildsys :) (760 bytes, patch)
2006-03-27 05:54 EST, Dmitry Butskoy
no flags Details | Diff

  None (edit)
Description Dmitry Butskoy 2006-03-27 05:54:31 EST
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.
Comment 1 Dmitry Butskoy 2006-03-27 05:54:32 EST
Created attachment 126807 [details]
spec file patch. Note: it is already checked that it is good for FE buildsys :)
Comment 2 Tim Jackson 2006-03-27 07:30:40 EST

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.
Comment 3 Dmitry Butskoy 2006-03-27 07:46:28 EST
For me,

php -i |grep "PHP API"|awk '{ print $4 }'



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.
Comment 4 Tim Jackson 2006-03-27 07:52:02 EST
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 :)
Comment 5 Dmitry Butskoy 2006-03-27 07:59:53 EST
> 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...
Comment 6 Dmitry Butskoy 2006-03-31 09:56:38 EST
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.

Note You need to log in before you can comment on or make changes to this bug.