[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Guidelines Update] PHP Guidelines Changes



The following changes were committed to the PHP Guidelines
(http://fedoraproject.org/wiki/Packaging/PHP). They were approved by the
Fedora Packaging Committee and ratified by FESCo.

In the Requires and Provides section, PEAR and PECL packages were
redefined to the following:

PEAR Packages
==============
A PEAR package MUST have: 

BuildRequires: php-pear(PEAR)
Requires: php-pear(PEAR)
Requires(post): %{__pear}
Requires(postun): %{__pear}
Provides:     php-pear(foo) = %{version}

PECL Packages
==============
A PECL package MUST have: 

BuildRequires: php-devel, php-pear
Requires(post): %{__pecl}
Requires(postun): %{__pecl}

%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

Provides:     php-pecl(foo) = %{version}

In the Macros and Scriptlets section, PECL Modules was 
redefined to the following:

PECL Modules
=============
You may need to define a few additional macros to extract some
information from PHP. It is recommended that you use the following: 

%global php_apiver  %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1)
%{!?__pecl:     %{expand: %%global __pecl     %{_bindir}/pecl}}
%{!?php_extdir: %{expand: %%global php_extdir %(php-config --extension-dir)}}

And here are some recommended scriptlets for properly registering and
unregistering the module: 

%if 0%{?pecl_install:1}
%post
%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
%endif


%if 0%{?pecl_uninstall:1}
%postun
if [ $1 -eq 0 ] ; then
    %{pecl_uninstall} %{pecl_name} >/dev/null || :
fi
%endif


Thanks,

~spot


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]