Re: Packaging a "bin" dir correctly?

From: Date: Tue, 16 Sep 2008 14:27:56 +0000
Subject: Re: Packaging a "bin" dir correctly?
References: 1 2 3 4 5 6 7 8  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-50769@lists.php.net to get a copy of this message
On Tue, Sep 16, 2008 at 9:22 AM, Brett Bieber <brett.bieber@gmail.com> wrote: > On Tue, Sep 16, 2008 at 8:57 AM, Paul M Jones <pmjones88@gmail.com> wrote: >> >> On Sep 15, 2008, at 16:30 , Brett Bieber wrote: >> >>>> It still puts the scripts in "pear/bin/bin/solar" though. >>>> >>>>> Eh, I think that would be the 'installas' option... >>>>> >>>>> 'installas' => array('foo' => 'bar') >>>>> will install foo as bar instead. >>>> >>>> Have tried that using 'installas' => array('bin/solar' => >>>> 'Solar/solar') >>>> and >>>> no joy -- it appears to be ignored by the packaging mechanism. Am I >>>> setting >>>> it incorrectly? >>> >>> It works here for me - >>> >>> ucommbieber:core bbieber$ svn diff release >>> Index: release >>> =================================================================== >>> --- release (revision 3394) >>> +++ release (working copy) >>> @@ -140,10 +140,11 @@ >>> '*' => 'php', >>> ), >>> 'exceptions' => array( >>> - 'bin/*' => 'script', >>> - 'tests/*' => 'test', >>> - 'docs/*' => 'doc', >>> + 'bin/solar' => 'script', >>> ), >>> + 'installas' => array( >>> + 'bin/solar' => 'Solar/solar', >>> + ), >>> ); >>> >>> Gives me: >>> ucommbieber:core bbieber$ grep -A4 -B1 install-as trunk/package.xml >>> <dir name="bin"> >>> <file role="script" baseinstalldir="/" >>> install-as="Solar/solar" >>> name="solar"> >>> <replace from="@package_version@" to="version" >>> type="package-info"/> >>> <replace from="@package_date@" to="date" >>> type="package-info"/> >>> </file> >>> </dir> <!-- /bin --> >> >> >> I applied the change you noted above. Interesting results! It shows in >> package.xml as this: >> >> <dir name="/" baseinstalldir="/"> >> <dir name="bin"> >> <file role="script" install-as="Solar/solar" >> name="solar"> >> <replace from="@package_version@" to="version" >> type="package-info"/> >> <replace from="@package_date@" to="date" >> type="package-info"/> >> </file> >> </dir> <!-- /bin --> >> >> But in package2.xml I have this: >> >> <dir name="bin"> >> <file name="solar" role="script"> >> <tasks:replace from="@package_version@" to="version" >> type="package-info" >> /> >> <tasks:replace from="@package_date@" to="date" >> type="package-info" /> >> </file> >> </dir> <!-- /bin --> >> >> No install-as in the v2 XML. Is that a bug? (Using >> PEAR_PackageFileManager-1.6.3-stable, PEAR-1.7.2-stable.) > > Aha, totally missed something... I didn't realize you were writing a > package v1 xml file, which contributed to my ignorance regarding the > install-as attribute. > > install-as was the attribute in package xml v1, in package xml v2 the > install-as structure is different. > > <phprelease> > <filelist> > <install as="pear" name="scripts/pear.sh" /> > </filelist> > </phprelease> > > only, your package2.xml file contains an empty element: > <phprelease /> > > ... Still not sure why, or how to specify it correctly in pfm2. Could > be a bug, but I'm not sure. No bug - it works: ucommbieber:core bbieber$ svn diff release Index: release =================================================================== --- release (revision 3394) +++ release (working copy) @@ -133,16 +133,14 @@ $opts = array( 'baseinstalldir' => '/', - 'packagefile' => 'package2.xml', + 'packagefile' => 'package.xml', 'packagedirectory' => dirname(__FILE__) . '/trunk/', 'filelistgenerator' => 'file', 'roles' => array( '*' => 'php', ), 'exceptions' => array( - 'bin/*' => 'script', - 'tests/*' => 'test', - 'docs/*' => 'doc', + 'bin/solar' => 'script', ), ); @@ -166,6 +164,7 @@ $pkg->setAPIStability($stability); $pkg->setPackageType('php'); $pkg->addRelease(); +$pkg->addInstallAs('bin/solar', 'Solar/solar'); $pkg->setNotes($notes); $pkg->setPhpDep('5.2.0'); $pkg->setPearinstallerDep('1.4.6'); @@ -197,12 +196,10 @@ // write the package file echo "\nWrite package file...\n"; -$compat =& $pkg->exportCompatiblePackageFile1(); -$compat->writePackageFile(); $pkg->writePackageFile(); // create the package. -// creates package.xml, package2.xml, and the .tgz file +// creates package.xml and the .tgz file solar_passthru('cd trunk; pear package'); -- Brett Bieber http://saltybeagle.com/

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