[pkg-php-pear] [Pkg-php-pear] On PEAR packaging

Gunnar Wrobel wrobel at horde.org
Mon Jun 20 14:18:54 UTC 2011

Hi Mathieu,

my second sweep of the Horde 4 packages should install now:


1) Line to add to "/etc/apt/sources.list":

deb   http://files.pardus.de/      horde4-debian-20110617/all/

2) Installation via

apt-get install pear-horde-channel php-horde-role php-horde-webmail

3) Set PEAR configuration via

pear config-set horde_dir /usr/share/horde4

4) Initial Horde configuration setup:


There are still some obvious issues that I currently see with these  
instructions. I'm certain you have additional remarks. Here is my list:

  - "http://files.pardus.de/horde4-debian-20110617" should be  
"http://files.pardus.de/horde4-debian" at some point (when I feel  
confident enough that I can provide an upgrade path within that repo)

  - The dependencies "pear-horde-channel" and "php-horde-role" still  
need to be added to the horde packages as required.

  - "pear config-set horde_dir /usr/share/horde4" needs to happen  
automatically with the installation of the php-horde-role package

  - "webmail-install" might be executed automatically after  
installation of php-horde-webmail

  - A default apache configuration should be delivered.

  - The package dependencies need to be checked again.

In addition to what I reported in my last mail concerning  
pkg-php-tools there are also some problems with dependencies. One  
thing I noticed are dependencies on PHP extensions. If a PEAR package  
requires a PHP extension that is already provided by the base Debian  
PHP package it cannot be added as an additional dependency. I think it  
makes sense to add this knowledge to phppkginfo. I used this code  
section for "extension" deps:

case "extension":
   if (!in_array($infos["name"], array('ctype', 'dom', 'filter',  
'hash', 'gettext', 'openssl', 'SimpleXML', 'xml'))) {
     $package = "php5-".$infos["name"];

But I assume there are additional extensions activated by default in  
the base PHP package.

The second issue I hit are the naming of package dependencies. The  
current code in "phppkginfo" assumes for dependencies of type  
"package" that the Debian package name is

"php-".strtr(strtolower($infos["name"]), '_', '-');

So "Horde_Date" will be mapped to "php-horde-date" which is fine. The  
"horde" PEAR package available on pear.horde.org will be "php-horde"  
which may still be okay, but I'm not so certain that mapping the "imp"  
package from pear.horde.org to "php-imp" is really what we want to do.  
So far I hacked the code so that the applications are mapped using

"php-horde-".strtr(strtolower($infos["name"]), '_', '-');

The Horde project did prefix the framework packages with "Horde_"  
because there was no way to avoid namespace clashes given the  
functionality of the current PEAR installer. With PEAR2 this might be  
different but that is not yet available. It was necessary to ensure  
that the files from "Horde_Db" did not clash with the "Db" package  
from PEAR and vice versa. Initially we did want to drop the "Horde_"  
prefix but dropped that idea at some point. But there are also other  
project that do not use such a prefix. At the moment the use of PEAR  
packaging seems to increase so I could imagine that there would be  
name conflicts at some point as long as the channel name plays no role  
in the Debian package name.

At the moment I'd be tempted to use the following rule:

The Debian package name is "php-" + the short name of the channel  
(e.g. "horde" or "phpunit") unless that one is pear.php.net + name of  
the package in lowercase and "_" replaced by "-" BUT with a prefix  
replaced if it matches the channel short name (e.g. "-date" instead of  
"-horde-date"). Does that make sense?

Of course one could also avoid the automatic dependency conversion and  
do it manually in case it fails but I'd like to have a method that  
works in most cases. Of course fixing the package names might not be  
that easy for Debian.

Quoting Mathieu Parent <math.parent at gmail.com>:

>> I generated a first set of Horde4 packages here:
>> http://files.pardus.de/horde4-debian-20110607/
> Great! Can you also provide the sources?

I realized in my second oackaging run, that I indeed need to do that  
as there are packages now that need some special treatment and cannot  
be immediately autogenerated (about 95% of them are however). So I  
would like to find a decent way that does not involve massive amounts  
of manual work to make the sources available. Any suggestions?

And sorry if there are any gaps. I'm trying to do too many things at  
the same time after loosing last week ;)



Core Developer
The Horde Project

e: wrobel at horde.org
t: +49 700 6245 0000
w: http://www.horde.org

pgp: 9703 43BE
tweets: http://twitter.com/pardus_de
blog: http://log.pardus.de

More information about the pkg-php-pear mailing list