Re: PEAR Installer, package.xml, baseinstalldir for doc, test, data

From: Date: Mon, 21 Feb 2005 16:55:10 +0000
Subject: Re: PEAR Installer, package.xml, baseinstalldir for doc, test, data
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-36291@lists.php.net to get a copy of this message
Hi Thanks for your fast answer.
What problem are you trying to solve by using baseinstalldir? Are you trying to affect the installation location of existing PEAR packages, or set the baseinstalldir attribute via package.xml?
I want to change the directory layout the pear creates. I want a deep file structure in docs, data and tests. I am using a custom configuration to install it to a directory that is different from PEAR's. Currently, I can create the following without problems: $INSTALLROOT php/
    binarycloud/
      package1/  <-- baseinstalldir="binarycloud/package1"
      package2/  <-- baseinstalldir="binarycloud/package2"
doc/
    binarycloud_package1/ <-- baseinstalldir="binarycloud/package1"
    binarycloud_package2/ <-- baseinstalldir="binarycloud/package2"
test
    binarycloud_package1/ <-- baseinstalldir="binarycloud/package1"
    binarycloud_package2/ <-- baseinstalldir="binarycloud/package2"
data
    binarycloud_package1/ <-- baseinstalldir="binarycloud/package1"
    binarycloud_package2/ <-- baseinstalldir="binarycloud/package2"
I specified the baseinstalldir parameter in the <dir> tag from source. So in source I have: $BCHOME binarycloud
    package1/
      docs/
      tests/
      resources/
And the package.xml contains: <dir name="resources" role="data" baseinstalldir="binarycloud/package1"> <dir name="docs" role="doc" baseinstalldir="binarycloud/package1"> <dir name="tests role="test" baseinstalldir="binarycloud/package1">
However, if this does not satisfy the conditions you have, because binarycloud needs special handling, the next-best solution is in PEAR 1.4.0 (coming this week), with custom installer roles. This feature is not yet documented except in the code, but if you would like to get an idea of how this works, take a look at PEAR_Installer::_installFile2(), and the contents of PEAR/Installer/Role in HEAD of pear-core CVS. Basically, you would copy PEAR/Installer/Role/Data.php to something like PEAR/Installer/Role/Phingdata.php and change the code to something like:
<snip> Well, that looks as if it is very easy to create custom roles then, but I would be perfectly fine with the above working ;) If there is a workaround for this *now*, I'd like to have it to do some further testing. However, if PEAR Installer becomes more extensible as you described, I can wait until next week. Regards, Manuel Holtgrewe

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