From Fedora Project Wiki

[[TableOfContents(3)]

Proposed Changes to PHP Guidelines

Synopsis

This page describes items that need to be changed in the PHP Guidelines or other items that need to be reviewed or ratified by the Fedora Packaging Comittee and FESCo .

PHP Guidelines Changes

Packages with Channels

Different kinds of packages

To be add

  • CHANNEL : a package which register a channel which provides extensions from another repository
  • Other package providing php extension not handled by pear/pecl mechanisms

3 channels are defined on installation of php-pear

  • pear.php.net (alias pear) : the default channel for PHP Extension and Application Repository
  • pecl.php.net (alias pecl) : the default channel for PHP Extension Community Library
  • __uri : Pseudo-channel for static packages

Other channels must be installed at RPM build time and at at RPM installation time.

FPC notes : we already have 4 extras channels in repository (phing, phpdb, symfony and phpunit). A new one (ezc) is on the road. This Guidelines update proposal "try" to avoid change for already approved packages.

Naming scheme

  • PECL packages from standard pecl channel should be named php-pecl-PECLPackageName-%{version}-%{release}.%{arch}.rpm.
  • PEAR packages from standard pear channel should be named php-pear-PEARPackageName-%{version}-%{release}.noarch.rpm.
  • CHANNEL packages should be named php-channel-ChannelAlias-%{version}-%{release}.noarch.rpm
  • Packages from another channel should be named php-ChannelAlias-PackageName-%{version}-%{release}.noarch.rpm.


FPC notes : PECL/PEAR package from standard channel also follow naming scheme for packages from another channel :)


CHANNEL Packages

A CHANNEL package 'MUST have :

Requires(post): %{__pear}
Requires(postun): %{__pear}
Provides: php-channel(channelname)


PEAR Packages from non standard repository

A PEAR package MUST have:

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

PEAR Packages

FPC notes : Requires: php-pear(PEAR) should be removed as some package doesn't requires PEAR at runtime (only at install time, for registering)


For non default channel extension, pear command requires the channel, so %postun scriplet must specify it

if [ "$1" -eq "0" ] ; then
%{_bindir}/pear uninstall --nodeps --ignore-errors --register-only Foo_Channel/Foo_Bar >/dev/null ||:
fi


TODO:

  • How to package a channel (to be able to BuildRequires and Requires it), see php-channel-phpunit (devel) as a working sample.
  • should virtual provide use channel (ex : Provides: php-pear(ChannelName/PackageName) = %{version})

Packages with Optional Requires

TODO: Some PEAR packages such as Auth have many other PEAR packages that are optional Requires. We need to discuss how to handle splitting up large packages such as this.

Other Items

No additional items required.