|
List Info
Thread: Pear channels, uri, package_filemanager, etc. I cannot make my package
|
|
| Pear channels, uri, package_filemanager,
etc. I cannot make my package |

|
2006-11-26 13:20:41 |
Hi,
I'd like to use package_filemanager to generate a
package.xml file
with version 2 format.
Whatever I try, I always get a result like this one :
PEAR_PackageFileManager2 Error: Package validation failed:
Error: Invalid tag order in <package>, found
<summary> expected one
of "channel, uri"
Error: package.xml <package> tag has no version
attribute, or version
is not 2.0
or other variants.
I don't have a channel setup for my packages yet and I don't
know
what to put in uri since it is not documented apparently.
Here is the code I use to generate my package, it's taken
directly
package_filemanager2 comments:
<code>
require_once('PEAR/PackageFileManager2.php');
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$packagexml = new PEAR_PackageFileManager2;
$e = $packagexml->setOptions(
array('baseinstalldir' => 'Mamasam',
'packagedirectory' => dirname(__FILE__).'/..',
'filelistgenerator' => 'file', // generate from cvs, use
file for
directory
'ignore' => array('.svn/', 'tests/'), // ignore TODO, all
files in
tests/
'dir_roles' => array('tests' => 'test'),
)); // same for the license
$packagexml->setPackage('Mamasam_ACL');
$packagexml->setSummary('Rights and permissions
management package');
$packagexml->setDescription('Rights and permissions
management
package.');
$packagexml->setAPIVersion('1.0.0');
$packagexml->setReleaseVersion('0.9.0');
$packagexml->setReleaseStability('beta');
$packagexml->setAPIStability('stable');
$packagexml->setNotes("Initial release");
$packagexml->setPackageType('php'); // this is a
PEAR-style php
script package
$packagexml->setPhpDep('5.1.0');
$packagexml->setPearinstallerDep('1.4.3');
$packagexml->addMaintainer('lead', 'mansion', 'Bertrand
Mansion',
'golgote mamasam.com');
$packagexml->setLicense('New BSD License', 'http://opensource.org/
licenses/bsd-license.php');
$packagexml->generateContents(); // create the
<contents> tag
// replace PHP-BIN in this file with the path to php
executable!
pretty neat
$packagexml->addGlobalReplacement('package-info',
' package_version ', 'version');
$pkg = &$packagexml->exportCompatiblePackageFile1();
// get a
PEAR_PackageFile object
// note use of { link debugPackageFile()} - this is VERY
important
if (isset($_GET['make']) || (isset($_SERVER['argv'])
&& $_SERVER
['argv'][1] == 'make')) {
$pkg->writePackageFile();
$packagexml->writePackageFile();
} else {
$pkg->debugPackageFile();
$packagexml->debugPackageFile();
}
</code>
Can somebody help me ? Should I write the package2.xml file
by hand ?
Or is there a tutorial somewhere on how to do this and maybe
also how
to setup a server with channels.
TIA,
--
Bertrand Mansion
Mamasam
Work : http://www.mamasam.com
Blog : http://golgote.freeflux.n
et
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|
|
| Pear channels, uri, package_filemanager,
etc. I cannot make my package |

|
2006-11-26 14:36:56 |
Hello,
On 11/26/06, Coda <golgote mamasam.com> wrote:
> Hi,
>
> I'd like to use package_filemanager to generate a
package.xml file
> with version 2 format.
> Whatever I try, I always get a result like this one :
>
> PEAR_PackageFileManager2 Error: Package validation
failed:
> Error: Invalid tag order in <package>, found
<summary> expected one
> of "channel, uri"
> Error: package.xml <package> tag has no version
attribute, or version
> is not 2.0
>
> or other variants.
>
> I don't have a channel setup for my packages yet and I
don't know
> what to put in uri since it is not documented
apparently.
>
You're right, it looks like the docs are lacking some
descriptions for
URI based packages.
URI based packages can be set by using:
$packagexml->setUri('http://www.examp
le.com/Package-1.2.3');
... without the .tar or .tgz extension. But the file
Package-1.2.3.tar
and .tgz should be present at the given URI.
Also note that URI based packages are release based.
>
> Can somebody help me ? Should I write the package2.xml
file by hand ?
> Or is there a tutorial somewhere on how to do this and
maybe also how
> to setup a server with channels.
>
I wouldn't write the package.xml by hand. Even if you did,
for a
package 2 xml file to be valid you would need either a uri
or a
channel. To set up your own channel, I would start by using
Greg's
post on channel setup:
http://greg.chiaraquartet.net/archives/123-Setting-
up-your-own-PEAR-channel-with-Chiara_PEAR_Server-the-officia
l-way.html
Once you have a channel server set up, I think you'll need
to pear
channel-discover mypearchannel.example.com before PEAR can
validate
the package.xml file for a given channel.
--
-Brett
http:saltybeagle.com aim:ianswerq
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|
|
| Pear channels, uri, package_filemanager,
etc. I cannot make my package |

|
2006-11-26 14:39:38 |
Hi,
Coda a écrit :
> Hi,
>
> I'd like to use package_filemanager to generate a
package.xml file with
> version 2 format.
> Whatever I try, I always get a result like this one :
>
> PEAR_PackageFileManager2 Error: Package validation
failed:
> Error: Invalid tag order in <package>, found
<summary> expected one of
> "channel, uri"
> Error: package.xml <package> tag has no version
attribute, or version is
> not 2.0
>
> or other variants.
Reason is you forgot to put
$packagexml->setChannel('pear.php.net');
>
> I don't have a channel setup for my packages yet and I
don't know what
> to put in uri since it is not documented apparently.
It was, but I dropped the User Guide / Tutorial that was
available on my
web space [1]
If you don't want to use a channel as
"pear.php.net", you can use uri
like this :
$packagexml->setUri('http://www.m
amasam.com/Mamasam_ACL-0.9.0');
or something equal. URI is address where PEAR installer can
download
archive .tar or .tgz
Avoid to give extension ".tar" ".tgz",
PEAR installer will do it for you
>
> Here is the code I use to generate my package, it's
taken directly
> package_filemanager2 comments:
>
> <code>
>
> require_once('PEAR/PackageFileManager2.php');
> PEAR::setErrorHandling(PEAR_ERROR_DIE);
>
> $packagexml = new PEAR_PackageFileManager2;
>
> $e = $packagexml->setOptions(
> array('baseinstalldir' => 'Mamasam',
> 'packagedirectory' => dirname(__FILE__).'/..',
> 'filelistgenerator' => 'file', // generate from cvs,
use file for directory
> 'ignore' => array('.svn/', 'tests/'), // ignore
TODO, all files in tests/
> 'dir_roles' => array('tests' => 'test'),
> )); // same for the license
> $packagexml->setPackage('Mamasam_ACL');
> $packagexml->setSummary('Rights and permissions
management package');
> $packagexml->setDescription('Rights and permissions
management package.');
> $packagexml->setAPIVersion('1.0.0');
> $packagexml->setReleaseVersion('0.9.0');
> $packagexml->setReleaseStability('beta');
> $packagexml->setAPIStability('stable');
> $packagexml->setNotes("Initial release");
> $packagexml->setPackageType('php'); // this is a
PEAR-style php script
> package
>
> $packagexml->setPhpDep('5.1.0');
> $packagexml->setPearinstallerDep('1.4.3');
> $packagexml->addMaintainer('lead', 'mansion',
'Bertrand Mansion',
> 'golgote mamasam.com');
> $packagexml->setLicense('New BSD License',
> 'http:/
/opensource.org/licenses/bsd-license.php');
> $packagexml->generateContents(); // create the
<contents> tag
> // replace PHP-BIN in this file with the path
to php executable!
> pretty neat
> $packagexml->addGlobalReplacement('package-info',
' package_version ',
> 'version');
> $pkg =
&$packagexml->exportCompatiblePackageFile1(); // get
a
> PEAR_PackageFile object
It's only my opinion: Avoid to use exportCompatible
function, you may
have more problems than solutions. And with a PEAR 1.4.x
package.xml 1.0
is not mandatory. Generate a package xml 2.0 is enough !
> // note use of { link debugPackageFile()} - this is VERY
important
> if (isset($_GET['make']) || (isset($_SERVER['argv'])
&&
> $_SERVER['argv'][1] == 'make')) {
> $pkg->writePackageFile();
> $packagexml->writePackageFile();
> } else {
> $pkg->debugPackageFile();
> $packagexml->debugPackageFile();
> }
>
> </code>
>
> Can somebody help me ? Should I write the package2.xml
file by hand ?
> Or is there a tutorial somewhere on how to do this
I've decided to put again my version of
PEAR_PackageFileManager online
[1] until someone will include it in PEAR manual.
It will avoid to lose works I've done in past .
To continue with my next post related to
PEAR_PackageFileManager user
guide ...
and maybe also how to
> setup a server with channels.
Greg server [2] and Chiara_PEAR_Server package is the
solution !
>
> TIA,
>
> --
> Bertrand Mansion
> Mamasam
> Work : http://www.mamasam.com
> Blog : http://golgote.freeflux.n
et
Hope it will help
Laurent Laville
[1] http://pear.laurent-laville.org/PEAR_PackageFileManager
a>
[2] http://pear.chiaraquar
tet.net/
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|
|
[1-3]
|
|