Trac

root/trunk/package.php

Revision 3794, 3.2 kB (checked in by jwage, 7 months ago)

Minor changes backported from 0.9 and 0.10

  • Property svn:eol-style set to native
Line 
1 <?php
2
3 buildPearPackage('/Users/jwage/Sites/doctrine/trunk', '0.9.0', 'beta');
4
5 function 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);
11
12     $packagexml = new PEAR_packageFileManager2;
13     
14     $notes = <<<EOT
15 -
16 EOT;
17
18     $summary = 'PHP5 Database ORM';
19
20     $description =<<<EOT
21 Doctrine is an ORM (object relational mapper) for PHP 5.2.x+ that sits on top of
22 a powerful DBAL (database abstraction layer). One of its key features is the
23 ability to optionally write database queries in an OO (object oriented)
24 SQL-dialect called DQL inspired by Hibernates HQL. This provides developers with
25 a powerful alternative to SQL that maintains a maximum of flexibility without
26 requiring needless code duplication.
27 EOT;
28
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     );
69
70     $package = &PEAR_packageFileManager2::importOptions($packageFile, $options);
71     $package->setPackageType('php');
72
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');
77
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');
88
89     if (isset($_GET['make']) || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')) {
90         $package->writepackageFile();
91     } else {
92         $package->debugpackageFile();
93     }
94 }
Note: See TracBrowser for help on using the browser.