Bug 186903 - Use "php-api" for dependency
Summary: Use "php-api" for dependency
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: php-json
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ignacio Vazquez-Abrams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-03-27 10:54 UTC by Dmitry Butskoy
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-04-13 09:43:27 UTC
Type: ---
Embargoed:


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 10:54 UTC, Dmitry Butskoy
no flags Details | Diff

Description Dmitry Butskoy 2006-03-27 10:54:31 UTC
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 10:54:32 UTC
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 12:30:40 UTC
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.

Comment 3 Dmitry Butskoy 2006-03-27 12:46:28 UTC
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.


Comment 4 Tim Jackson 2006-03-27 12:52:02 UTC
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 12:59:53 UTC
> 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 14:56:38 UTC
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.