/
buildPackageXML.php
97 lines (82 loc) · 2.43 KB
/
buildPackageXML.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker */
// $Id$
require_once 'PEAR/PackageFileManager2.php';
require_once 'PEAR/PackageFileManager/Cvs.php';
$pkg = new PEAR_PackageFileManager2;
$options = array(
'simpleoutput' => true,
'baseinstalldir' => '/',
'packagedirectory' => dirname(__FILE__),
'pathtopackagefile' => basename(__FILE__),
'filelistgenerator' => 'Cvs',
'dir_roles' => array(
'tests' => 'test',
'docs' => 'doc',
'data' => 'data'
),
'ignore' => array(
'package.xml',
'package2.xml',
'*.tgz',
basename(__FILE__)
)
);
$pkg->setOptions($options);
$summary = <<<EOT
Numerical Root-Finding methods package in PHP
EOT;
$desc = <<<EOT
Math_Numerical_RootFinding is the package provide various number of Numerical
Root-Finding Methods functions implemented in PHP.
Supported methods:
1. Bisection/Binary Chopping/Interval Halving/Bolzano
2. False Position/Regula Falsi
3. Fixed Point
4. Netwon-Raphson
5. Netwon-Raphson 2
6. Ralston-Rabinowitz
7. Secant
EOT;
$notes = <<<EOT
* Request #2897: added new parameter \$guess to validateEqFunction()
* Added unit tests
* Examples files renamed to lower case
EOT;
// Some hard-coded stuffs.
$pkg->setPackage('Math_Numerical_RootFinding');
$pkg->setSummary($summary);
$pkg->setDescription($desc);
$pkg->setChannel('pear.php.net');
$pkg->setAPIVersion('1.0');
$pkg->setReleaseVersion('1.1.0a1');
$pkg->setReleaseStability('alpha');
$pkg->setAPIStability('alpha');
$pkg->setNotes($notes);
$pkg->setPackageType('php');
$pkg->setLicense('BSD License', 'http://www.opensource.org/licenses/bsd-license.php');
// Add maintainers.
$pkg->addMaintainer('lead', 'firman', 'Firman Wandayandi', 'firman@php.net', 'yes');
$pkg->addMaintainer('lead', 'mfonda', 'Matthew Fonda', 'mfonda@php.net', 'yes');
// Core dependencies.
$pkg->setPhpDep('4.3.0');
$pkg->setPearinstallerDep('1.4.0');
// Add some replacements.
$pkg->addGlobalReplacement('package-info', '@package_version@', 'version');
// Generate file contents.
$pkg->generateContents();
// Writes a package.xml.
$e = $pkg->writePackageFile();
// Some errors occurs.
if (PEAR::isError($e)) {
throw new Exception('Unable to write package file. Got message: ' . $e->getMessage());
}
/*
* Local variables:
* mode: php
* tab-width: 4
* c-basic-offset: 4
* c-hanging-comment-ender-p: nil
* End:
*/
?>