pear package build considerations

From: Date: Thu, 23 Aug 2001 21:54:48 +0000
Subject: pear package build considerations
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-1683@lists.php.net to get a copy of this message
Peter Petermann wrote: > > zimt Thu Aug 23 15:58:26 2001 EDT > > Modified files: > /pear/Net_Whois package.xml > Log: > Changed BaseInstallDir, like chregu told me to do. > > > Index: pear/Net_Whois/package.xml > diff -u pear/Net_Whois/package.xml:1.1 pear/Net_Whois/package.xml:1.2 > --- pear/Net_Whois/package.xml:1.1 Thu Aug 23 15:39:36 2001 > +++ pear/Net_Whois/package.xml Thu Aug 23 15:58:25 2001 > @@ -17,7 +17,7 @@ > </Notes> > </Release> > <FileList> > - <Dir Name="/" BaseInstallDir="Net_Whois"> > + <Dir Name="/" BaseInstallDir="Net"> > <File Role="php">Whois.php</File> > </Dir> > </FileList> > FYI the BaseInstallDir tag specifies the destination dir in the client pear installation. When you compiles php, a new php constant PEAR_INSTALL_DIR is defined (normally points to /usr/local/lib/php). If your package in the CVS looks like: Net_Whois | +--Whois.php The installer would put by default the file Whois.php in PEAR_INSTALL_DIR/Whois.php. But if you specifies a BaseInstall dir, the destination file would be PEAR_INSTALL_DIR/<BaseInstallDir>/Whois.php. Please note the difference between what stores a package (in the CVS tree) and where will them files be installed (the target user filesytem). More or less, <Dir> reflects the package structure (used by the "pear package" command) and <BaseInstallDir> the destination dir structure (used by the "pear install" command). With <BaseInstallDir> is easy to rellocate files without the need of creating a complex dir tree inside the package. Note that attributes in <Dir>'s like <BaseInstallDir> or <Role> inherits to all files under it (if they are not overriden). You can build a valid package from: Net_Whois | +--Net | +--Whois.php And use: <Dir Name="/"> <Dir Name="Net"> <File>Whois.php</File> </Dir> </Dir> Or use the <BaseInstallDir>: Net_Whois | +--Whois.php <Dir Name="/" BaseInstallDir="Net"> <File Role="php">Whois.php</File> </Dir> Both ways will result in a installation of files in the client machine as: /usr/local/lib/php | +--Net | +--Whois.php In the other hand, as I said, you also don't need to mark the Role file by file. You could simply do ie.: <Dir Name="/" BaseInstallDir="Net" Role="php"> <File>Foo1.php</File> <File>Foo2.php</File> <File>Foo3.php</File> <Dir Name="docs" Role="doc"> <File>Foo1.txt</File> <File>Foo2.txt</File> <File>Foo3.txt</File> </Dir> </Dir> Hope to have help in the "misterious" ways of creating a pear package :-) Tomas V.V.Cox

« previous php.pear.dev (#1683) next »