Trac

Show
Ignore:
Timestamp:
02/15/08 18:42:06 (9 months ago)
Author:
jwage
Message:

Minor changes backported from 0.9 and 0.10

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/package.php

    r3669 r3794  
    11<?php 
    22 
    3 require_once('PEAR/PackageFileManager2.php'); 
    4 PEAR::setErrorHandling(PEAR_ERROR_DIE); 
     3buildPearPackage('/Users/jwage/Sites/doctrine/trunk', '0.9.0', 'beta'); 
    54 
    6 $packagexml = new PEAR_PackageFileManager2; 
     5function buildPearPackage($path, $version, $state) 
     6
     7    $packageFile = $path . DIRECTORY_SEPARATOR . 'package.xml'; 
     8     
     9    require_once('PEAR/packageFileManager2.php'); 
     10    PEAR::setErrorHandling(PEAR_ERROR_DIE); 
    711 
    8 $version_release = '0.9'; 
    9 $version_api = $version_release; 
    10 $state = 'beta'; 
    11  
    12 $notes = <<<EOT 
    13 barfoo 
     12    $packagexml = new PEAR_packageFileManager2; 
     13     
     14    $notes = <<<EOT 
     15
    1416EOT; 
    1517 
    16 $summary = 'PHP5 Database ORM'; 
     18    $summary = 'PHP5 Database ORM'; 
    1719 
    18 $description =<<<EOT 
     20    $description =<<<EOT 
    1921Doctrine is an ORM (object relational mapper) for PHP 5.2.x+ that sits on top of 
    2022a powerful DBAL (database abstraction layer). One of its key features is the 
     
    2527EOT; 
    2628 
    27 $packagefile = './package.xml'; 
     29    $options = array( 
     30        'filelistgenerator' => 'svn', 
     31        'changelogoldtonew' => false, 
     32        'simpleoutput'      => true, 
     33        'baseinstalldir'    => '/', 
     34        'packagedirectory'  => $path, 
     35        'packageFile'       => $packageFile, 
     36        'clearcontents'     => false, 
     37        // What to ignore 
     38        'ignore'            => array( 
     39            $path . DIRECTORY_SEPARATOR . 'vendor/', 
     40            $path . DIRECTORY_SEPARATOR . 'package*.*', 
     41            $path . DIRECTORY_SEPARATOR . 'tests_old/', 
     42            $path . DIRECTORY_SEPARATOR . 'tests/', 
     43            $path . DIRECTORY_SEPARATOR . 'tools/' 
     44        ), 
     45        // What to include in package 
     46        'include'            => array( 
     47            $path . DIRECTORY_SEPARATOR . 'lib/', 
     48            $path . DIRECTORY_SEPARATOR . 'manual/', 
     49            $path . DIRECTORY_SEPARATOR . 'vendor/', 
     50            $path . DIRECTORY_SEPARATOR . 'README', 
     51            $path . DIRECTORY_SEPARATOR . 'CHANGELOG', 
     52            $path . DIRECTORY_SEPARATOR . 'LICENSE', 
     53            $path . DIRECTORY_SEPARATOR . 'COPYRIGHT' 
     54        ), 
     55        // Dir roles 
     56        'dir_roles'         => array( 
     57            'lib'           =>  'php', 
     58            'manual'        =>  'doc', 
     59            'vendor'        =>  'php' 
     60        ), 
     61        // File roles 
     62        'exceptions' => array( 
     63            'README' => 'doc', 
     64            'CHANGELOG' => 'doc', 
     65            'LICENSE' => 'doc', 
     66            'COPYRIGHT' => 'doc' 
     67        ) 
     68    ); 
    2869 
    29 $options = array( 
    30     'filelistgenerator' => 'svn', 
    31     'changelogoldtonew' => false, 
    32     'simpleoutput'      => true, 
    33     'baseinstalldir'    => '/', 
    34     'packagedirectory'  => './', 
    35     'packagefile'       => $packagefile, 
    36     'clearcontents'     => false, 
    37     'ignore'            => array( 
    38         'vendor/', 
    39         'tools/', 
    40         'package*.php', 
    41         'package*.xml', 
    42     ), 
    43     'dir_roles'         => array( 
    44         'lib'           => 'php', 
    45         'manual'        => 'doc', 
    46         'models'        => 'doc', 
    47         'tests'         => 'test', 
    48     ), 
    49     'exceptions' => array( 
    50         'README' => 'doc', 
    51         'CHANGELOG' => 'doc', 
    52         'LICENSE' => 'doc', 
    53         'COPYRIGHT' => 'doc' 
    54     ) 
    55 ); 
     70    $package = &PEAR_packageFileManager2::importOptions($packageFile, $options); 
     71    $package->setPackageType('php'); 
    5672 
    57 $package = &PEAR_PackageFileManager2::importOptions($packagefile, $options); 
    58 $package->setPackageType('php'); 
     73    $package->clearDeps(); 
     74    $package->setPhpDep('5.2.3'); 
     75    $package->setPearInstallerDep('1.4.0b1'); 
     76    $package->addPackageDepWithChannel('required', 'PEAR', 'pear.php.net', '1.3.6'); 
    5977 
    60 $package->clearDeps(); 
    61 $package->setPhpDep('5.2.3'); 
    62 $package->setPearInstallerDep('1.4.0b1'); 
    63 $package->addPackageDepWithChannel('required', 'PEAR', 'pear.php.net', '1.3.6'); 
     78    $package->addRelease(); 
     79    $package->generateContents(); 
     80    $package->setReleaseVersion($version); 
     81    $package->setAPIVersion($version); 
     82    $package->setReleaseStability($state); 
     83    $package->setAPIStability($state); 
     84    $package->setNotes($notes); 
     85    $package->setSummary($summary); 
     86    $package->setDescription($description); 
     87    $package->addGlobalReplacement('package-info', '@package_version@', 'version'); 
    6488 
    65 $package->addRelease(); 
    66 $package->generateContents(); 
    67 $package->setReleaseVersion($version_release); 
    68 $package->setAPIVersion($version_api); 
    69 $package->setReleaseStability($state); 
    70 $package->setAPIStability($state); 
    71 $package->setNotes($notes); 
    72 $package->setSummary($summary); 
    73 $package->setDescription($description); 
    74 $package->addGlobalReplacement('package-info', '@package_version@', 'version'); 
    75  
    76 if (isset($_GET['make']) || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')) { 
    77     $package->writePackageFile(); 
    78 } else { 
    79     $package->debugPackageFile(); 
     89    if (isset($_GET['make']) || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')) { 
     90        $package->writepackageFile(); 
     91    } else { 
     92        $package->debugpackageFile(); 
     93    } 
    8094}