buildPackageXML.php 3.4 KB

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