2008-01-29 20:35:49 +03:00
|
|
|
<?php
|
|
|
|
|
2008-02-15 21:42:06 +03:00
|
|
|
buildPearPackage('/Users/jwage/Sites/doctrine/trunk', '0.9.0', 'beta');
|
2008-01-29 20:35:49 +03:00
|
|
|
|
2008-02-15 21:42:06 +03:00
|
|
|
function buildPearPackage($path, $version, $state)
|
|
|
|
{
|
|
|
|
$packageFile = $path . DIRECTORY_SEPARATOR . 'package.xml';
|
|
|
|
|
|
|
|
require_once('PEAR/packageFileManager2.php');
|
|
|
|
PEAR::setErrorHandling(PEAR_ERROR_DIE);
|
2008-01-29 20:35:49 +03:00
|
|
|
|
2008-02-15 21:42:06 +03:00
|
|
|
$packagexml = new PEAR_packageFileManager2;
|
|
|
|
|
|
|
|
$notes = <<<EOT
|
|
|
|
-
|
2008-01-29 20:35:49 +03:00
|
|
|
EOT;
|
|
|
|
|
2008-02-15 21:42:06 +03:00
|
|
|
$summary = 'PHP5 Database ORM';
|
2008-01-29 20:35:49 +03:00
|
|
|
|
2008-02-15 21:42:06 +03:00
|
|
|
$description =<<<EOT
|
2008-01-29 20:35:49 +03:00
|
|
|
Doctrine is an ORM (object relational mapper) for PHP 5.2.x+ that sits on top of
|
|
|
|
a powerful DBAL (database abstraction layer). One of its key features is the
|
|
|
|
ability to optionally write database queries in an OO (object oriented)
|
|
|
|
SQL-dialect called DQL inspired by Hibernates HQL. This provides developers with
|
|
|
|
a powerful alternative to SQL that maintains a maximum of flexibility without
|
|
|
|
requiring needless code duplication.
|
|
|
|
EOT;
|
|
|
|
|
2008-02-15 21:42:06 +03:00
|
|
|
$options = array(
|
|
|
|
'filelistgenerator' => 'svn',
|
|
|
|
'changelogoldtonew' => false,
|
|
|
|
'simpleoutput' => true,
|
|
|
|
'baseinstalldir' => '/',
|
|
|
|
'packagedirectory' => $path,
|
|
|
|
'packageFile' => $packageFile,
|
|
|
|
'clearcontents' => false,
|
|
|
|
// What to ignore
|
|
|
|
'ignore' => array(
|
|
|
|
$path . DIRECTORY_SEPARATOR . 'vendor/',
|
|
|
|
$path . DIRECTORY_SEPARATOR . 'package*.*',
|
|
|
|
$path . DIRECTORY_SEPARATOR . 'tests_old/',
|
|
|
|
$path . DIRECTORY_SEPARATOR . 'tests/',
|
|
|
|
$path . DIRECTORY_SEPARATOR . 'tools/'
|
|
|
|
),
|
|
|
|
// What to include in package
|
|
|
|
'include' => array(
|
|
|
|
$path . DIRECTORY_SEPARATOR . 'lib/',
|
|
|
|
$path . DIRECTORY_SEPARATOR . 'manual/',
|
|
|
|
$path . DIRECTORY_SEPARATOR . 'vendor/',
|
|
|
|
$path . DIRECTORY_SEPARATOR . 'README',
|
|
|
|
$path . DIRECTORY_SEPARATOR . 'CHANGELOG',
|
|
|
|
$path . DIRECTORY_SEPARATOR . 'LICENSE',
|
|
|
|
$path . DIRECTORY_SEPARATOR . 'COPYRIGHT'
|
|
|
|
),
|
|
|
|
// Dir roles
|
|
|
|
'dir_roles' => array(
|
|
|
|
'lib' => 'php',
|
|
|
|
'manual' => 'doc',
|
|
|
|
'vendor' => 'php'
|
|
|
|
),
|
|
|
|
// File roles
|
|
|
|
'exceptions' => array(
|
|
|
|
'README' => 'doc',
|
|
|
|
'CHANGELOG' => 'doc',
|
|
|
|
'LICENSE' => 'doc',
|
|
|
|
'COPYRIGHT' => 'doc'
|
|
|
|
)
|
|
|
|
);
|
2008-01-29 20:35:49 +03:00
|
|
|
|
2008-02-15 21:42:06 +03:00
|
|
|
$package = &PEAR_packageFileManager2::importOptions($packageFile, $options);
|
|
|
|
$package->setPackageType('php');
|
2008-01-29 20:35:49 +03:00
|
|
|
|
2008-02-15 21:42:06 +03:00
|
|
|
$package->clearDeps();
|
|
|
|
$package->setPhpDep('5.2.3');
|
|
|
|
$package->setPearInstallerDep('1.4.0b1');
|
|
|
|
$package->addPackageDepWithChannel('required', 'PEAR', 'pear.php.net', '1.3.6');
|
2008-01-29 20:35:49 +03:00
|
|
|
|
2008-02-15 21:42:06 +03:00
|
|
|
$package->addRelease();
|
|
|
|
$package->generateContents();
|
|
|
|
$package->setReleaseVersion($version);
|
|
|
|
$package->setAPIVersion($version);
|
|
|
|
$package->setReleaseStability($state);
|
|
|
|
$package->setAPIStability($state);
|
|
|
|
$package->setNotes($notes);
|
|
|
|
$package->setSummary($summary);
|
|
|
|
$package->setDescription($description);
|
|
|
|
$package->addGlobalReplacement('package-info', '@package_version@', 'version');
|
2008-01-29 20:35:49 +03:00
|
|
|
|
2008-02-15 21:42:06 +03:00
|
|
|
if (isset($_GET['make']) || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')) {
|
|
|
|
$package->writepackageFile();
|
|
|
|
} else {
|
|
|
|
$package->debugpackageFile();
|
|
|
|
}
|
|
|
|
}
|