generate_package.php 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. require_once('PEAR/PackageFileManager2.php');
  3. PEAR::setErrorHandling(PEAR_ERROR_DIE);
  4. $packagefile = "simpletest";
  5. $options = array(
  6. 'filelistgenerator' => 'svn',
  7. 'simpleoutput' => true,
  8. 'baseinstalldir' => 'simpletest',
  9. 'packagedirectory' => dirname(__FILE__) . '/../',
  10. 'clearcontents' => true,
  11. 'ignore' => array('TODO.xml', 'VERSION', 'docs/', 'tutorials/', 'packages/', '.svn'),
  12. 'dir_roles' => array(
  13. 'test' => 'test'
  14. )
  15. );
  16. $packagexml = PEAR_PackageFileManager2::importOptions($packagefile, $options);
  17. $packagexml->setPackageType('php');
  18. $packagexml->setPackage('simpletest');
  19. $packagexml->setSummary('PHP Unit Tester');
  20. $packagexml->setDescription("Unit testing, mock objects and web testing framework for PHP");
  21. // update this! do we have a default channel server?
  22. $packagexml->setChannel('pear.php.net');
  23. $packagexml->setUri('http://os.coretxt.net.nz/simpletest-1.1');
  24. $notes = file_get_contents(dirname(__FILE__).'/../README');
  25. $packagexml->setNotes($notes);
  26. $packagexml->setPhpDep('5.0.5');
  27. $packagexml->setPearinstallerDep('1.4.0');
  28. $packagexml->addPackageDepWithChannel('required', 'PEAR', 'pear.php.net', '1.4.0');
  29. $packagexml->addMaintainer('lead', 'lastcraft', 'Marcus Baker', 'marcus@lastcraft.com');
  30. $packagexml->setLicense('LGPL', 'http://www.gnu.org/licenses/lgpl-2.1.html');
  31. preg_match("/([0-9\.]+)([a-z]+)/", file_get_contents(dirname(__FILE__).'/../VERSION'), $version);
  32. $packagexml->setAPIVersion($version[1]);
  33. $packagexml->setReleaseVersion($version[1]);
  34. $packagexml->setReleaseStability($version[2]);
  35. $packagexml->setAPIStability($version[2]);
  36. $packagexml->addRelease();
  37. $packagexml->generateContents();
  38. if (isset($_GET['make']) || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')) {
  39. $packagexml->writePackageFile();
  40. } else {
  41. $packagexml->debugPackageFile();
  42. }
  43. ?>