Re: Packaging a "bin" dir correctly?
| From: | Brett Bieber | Date: | Mon, 15 Sep 2008 17:20:46 +0000 |
| Subject: | Re: Packaging a "bin" dir correctly? | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-50761@lists.php.net to get a copy of this message | ||
On Mon, Sep 15, 2008 at 11:46 AM, Paul M Jones <pmjones88@gmail.com> wrote:
> On Sep 15, 2008, at 11:22 , Brett Bieber wrote:
>
>>> $opts = array(
>>> 'baseinstalldir' => '/',
>>> 'packagefile' => 'package2.xml',
>>> 'packagedirectory' => dirname(__FILE__) . '/trunk/',
>>> 'filelistgenerator' => 'file',
>>> 'roles' => array(
>>> '*' => 'php',
>>> ),
>>> 'exceptions' => array(
>>> 'bin/*' => 'script',
>>> 'tests/*' => 'test',
>>> 'docs/*' => 'doc',
>>> ),
>>> );
>
> ...
>>
>> The standard layout should automatically set the role="doc" and
>> role="test" on the docs and tests dirs, so I don't think you need
>> those and I believe the exceptions array should reference individual
>> files. Maybe try something like this?
>>
>> ucommbieber:core bbieber$ svn diff release
>> Index: release
>> ===================================================================
>> --- release (revision 3394)
>> +++ release (working copy)
>> @@ -140,9 +140,7 @@
>> '*' => 'php',
>> ),
>> 'exceptions' => array(
>> - 'bin/*' => 'script',
>> - 'tests/*' => 'test',
>> - 'docs/*' => 'doc',
>> + 'bin/solar' => 'script',
>> ),
>> );
>
> Very good, sir, and thank you: that does the trick. The options array now
> looks like this ...
>
> $opts = array(
> 'baseinstalldir' => '/',
> 'packagefile' => 'package2.xml',
> 'packagedirectory' => dirname(__FILE__) . '/trunk/',
> 'filelistgenerator' => 'file',
> 'roles' => array(
> '*' => 'php',
> ),
> 'exceptions' => array(
> 'bin/solar' => 'script',
> ),
> );
>
> ... and "bin/solar" goes into "pear/bin" on installation. Thanks!
>
> * * *
>
> Now for part 2. ;-)
>
> The resulting installation puts the files in these dirs:
>
> pear/
> bin/
> bin/
> solar
> doc/
> Solar/
> docs/
> ...etc...
> php/
> Solar.php
> Solar/
> ...etc...
>
> Note the "pear/bin/bin/solar" bit is inconsistent with the
> "doc/Solar/docs/"
> bit.
>
> What I would prefer to see is something with less traversal and more
> consistency to it, maybe like this:
>
> pear/
> bin/
> Solar/
> solar
> doc/
> Solar/
> ...etc...
> php/
> Solar.php
> Solar/
>
> Note that "pear/doc/Solar/docs/..." from earlier becomes
> "pear/doc/Solar/..." instead, and that "pear/bin/bin/solar" becomes
> "pear/Solar/solar" instead.
>
> Any hints on how I can structure the project or the packaging config to make
> that happen?
Eh, I think that would be the 'installas' option...
'installas' => array('foo' => 'bar')
will install foo as bar instead.
I'm not sure how well it works with whole directories though.
The end result would be something like what Ken Guest has for the
PEAR_Size package.xml file:
http://cvs.php.net/viewvc.cgi/pear/PEAR_Size/package.xml?view=markup
Maybe that will send you down the right path.
--
Brett Bieber
http://saltybeagle.com/