]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - extlib/buildPackageXML.php
[PEAR] Modernize Validate code
[quix0rs-gnu-social.git] / extlib / buildPackageXML.php
1 <?php
2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker */
3 // $Id$
4
5 require_once 'PEAR/PackageFileManager2.php';
6 require_once 'PEAR/PackageFileManager/Git.php';
7
8 $pkg = new PEAR_PackageFileManager2;
9
10 $options = array(
11     'simpleoutput' => true,
12     'baseinstalldir' => '/',
13     'packagefile' => 'package.xml',
14     'packagedirectory' => dirname(__FILE__),
15     'filelistgenerator' => 'Git',
16     'dir_roles' => array(
17         'tests' => 'test',
18         'docs' => 'doc',
19         'data' => 'data'
20     ),
21     'ignore' => array(
22         'package.xml',
23         'package2.xml',
24         '*.tgz',
25         basename(__FILE__)
26     )
27 );
28
29 $pkg->setOptions($options);
30
31 $desc = <<<EOT
32 Generic classes for representation and manipulation of
33 dates, times and time zones without the need of timestamps,
34 which is a huge limitation for PHP programs.  Includes time zone data,
35 time zone conversions and many date/time conversions.
36 It does not rely on 32-bit system date stamps, so
37 you can display calendars and compare dates that date
38 pre 1970 and post 2038.
39
40 EOT;
41
42 $notes = <<<EOT
43 QA release.
44 Users are strongly encouraged to adopt to inbuilt DateTime functionality.
45
46 Bug #17730 Patch: Avoid ereg, using preg_match
47 Doc Bug #15029 large Date_Span's cannot be created
48 Bug #14929 Timezone summertime
49 Bug #14856 America/Moncton longname and dstlongname missing
50 Bug #14084 TZ variable being set wrecks global config
51 Bug #13615 America/Toronto time-zone is missing longname and dstlongname
52 Bug #13545 Date_Span::set() doesn't work when passed an int and format
53 Req #13488 Please rename Methods format2 and format3
54 EOT;
55
56 $summary = <<<EOT
57 Generic date/time handling class for PEAR
58 EOT;
59
60 // Some hard-coded stuffs.
61 $pkg->setPackage('Date');
62 $pkg->setSummary($summary);
63 $pkg->setDescription($desc);
64 $pkg->setChannel('pear.php.net');
65 $pkg->setAPIVersion('1.5.0');
66 $pkg->setReleaseVersion('1.5.0a2');
67 $pkg->setReleaseStability('alpha');
68 $pkg->setAPIStability('alpha');
69 $pkg->setNotes($notes);
70 $pkg->setPackageType('php');
71 $pkg->setLicense('BSD License',
72     'http://www.opensource.org/licenses/bsd-license.php');
73
74 // Add maintainers.
75 $pkg->addMaintainer('lead', 'baba', 'Baba Buehler', 'baba@babaz.com', 'no');
76 $pkg->addMaintainer('lead', 'pajoye', 'Pierre-Alain Joye', 'pajoye@php.net', 'no');
77 $pkg->addMaintainer('lead', 'mohrt', 'Monte Ohrt', 'mohrt@php.net', 'no');
78 $pkg->addMaintainer('lead', 'firman', 'Firman Wandayandi', 'firman@php.net');
79 $pkg->addMaintainer('lead', 'c01234', 'C.A. Woodcock', 'c01234@netcomuk.co.uk');
80 $pkg->addMaintainer('developer', 'alan_k', 'Alan Knowles', 'alan@akbkhome.com');
81 $pkg->addMaintainer('helper', 'scar', 'Leonardo Dutra', 'scar@php.net');
82
83 // Core dependencies.
84 $pkg->setPhpDep('4.3');
85 $pkg->setPearinstallerDep('1.4.0');
86
87 //$pkg->addDependency("Numbers_Words", "0.15.0", "eq", "pkg", true);
88 //$pkg->detectDependencies();
89
90 // Add some replacements.
91 $pkg->addGlobalReplacement('package-info', '@package_version@', 'version');
92
93 // Generate file contents.
94 $pkg->generateContents();
95
96 // Writes a package.xml.
97 if (isset($_GET['make']) || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')) {
98     $e = $pkg->writePackageFile();
99
100     // Some errors occurs.
101     if (PEAR::isError($e)) {
102         throw new Exception('Unable to write package file. Got message: ' .
103             $e->getMessage());
104     }
105 } else {
106     $pkg->debugPackageFile();
107 }
108
109
110 /*
111  * Local variables:
112  * mode: php
113  * tab-width: 4
114  * c-basic-offset: 4
115  * c-hanging-comment-ender-p: nil
116  * End:
117  */
118 ?>