root/trunk/etc/generatePearPackageXml.php

Revision 1875, 14.5 kB (checked in by demian, 10 months ago)

correcting Task foldername to be singular

  • Property svn:eol-style set to native
Line 
1 <?php
2
3 define('SGL_PKG_RELEASE_NAME', $_SERVER['argv'][2]); //    passed from etc/release.sh
4 define('SGL_PKG_TMP_BUILD_DIR', '/tmp/seagull-'.SGL_PKG_RELEASE_NAME);
5 /**
6  * Generation script for PEAR package.xml file.
7  * Generates a version 2 package.xml file using the package
8  * PEAR_PackageFileManager.
9  *
10  * @link http://pear.php.net/package/PEAR_PackageFileManager
11  *
12  * PHP versions 4 and 5
13  *
14  * LICENSE: This source file is subject to version 3.0 of the PHP license
15  * that is available through the world-wide-web at the following URI:
16  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
17  * the PHP License and are unable to obtain it through the web, please
18  * send a note to license@php.net so we can mail you a copy immediately.
19  *
20  * @category   Frameworks
21  * @package    Seagull
22  * @author     Tobias Schlitt <toby@php.net>
23  * @copyright  1997-2005 The PHP Group
24  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
25  * @version    CVS: $Id: Php.php,v 1.5 2005/07/28 16:51:53 cellog Exp $
26  * @link       http://www.s9y.org
27  */
28
29     /**
30      * Package file manager for package.xml 2.
31      */
32     require_once 'PEAR/PackageFileManager2.php';
33
34     /**
35      * Some help functions.
36      */
37     #require_once 'generate_package_xml_functions.php';
38
39     // Directory where the package files are located.
40     $packagedir  = SGL_PKG_TMP_BUILD_DIR;
41
42     // Name of the channel, this package will be distributed through
43     $channel     = 'pear.phpkitchen.com';
44
45     // Category and name of the package
46     $category    = 'Frameworks';
47     $package     = 'Seagull';
48
49     $version     = SGL_PKG_RELEASE_NAME;
50
51     // Summary description
52     $summary     = <<<EOT
53 Seagull is a PHP framework (BSD License).
54 EOT;
55
56     // Longer description
57     $description = <<<EOT
58 Seagull is a PHP application framework with a number of
59 modules available that deliver CMS functionality.
60 EOT;
61
62     // License information
63     $license = 'BSD';
64
65     // Notes, function to grab them directly from S9Y in
66     // generate_package_xml_functions.php
67     $notes = <<<EOT
68 BUGFIXES
69 23-01-06    Fixed small bug where registry of PEAR modules listed in installer
70             was referring to the system instead of local PEAR install
71 20-01-06    Problems with adding subscribers fixed in NewsletterMgr
72             (AJ Tarachanowicz)
73 20-01-06    Problems with ContentTypeMgr fixed (AJ Tarachanowicz)
74 17-01-06    Fixed problems with naming conventions in module generator
75 30-12-05    Fixed bug where contact us template could not be found (Andrey Podshivalov)
76 21-12-05    Ancestors correctly highlighted in navigation trees (Gerald Fishcer)
77 20-12-05    Added missing path vars in config template (Tomasz Osmialowski)
78 20-12-05    Fixed corruption of german language file in default module
79 19-12-05    Fixed incorrect constant which prevented instant messages from working
80             correctly
81 16-12-05    Changed erroneous ECT tz to CET (Sylvain PAPET)
82
83 IMPROVEMENTS
84 23-01-06    Implemented web-based PEAR package and channel management.  Basic ideas
85             used from PEAR webinstaller and extended.
86 23-01-06    Seagull is now PHP 5.1.x compliant
87 23-01-06 Added new conf key: [RegisterMgr][enabled] set to true by default
88 23-01-06    Added auto-correct frontScriptName for CGI users in SGL_Task_CreateConfig()
89 18-01-06    Test runner now uses pearified SimpleTest and notices are suppressed
90             for now, see http://trac.seagullproject.org/wiki/Standards/UnitTesting
91 17-01-06    Integrated Serendipity blog, see
92             http://trac.seagullproject.org/wiki/Integration/Serendipity
93 17-01-06    Added new 'getAllModules' xml-rpc service
94 16-01-06    Instantiating a cache object has changed from
95             \$cache = & SGL::cacheSingleton(); to \$cache = & SGL_Cache::singleton();
96             Likewise, SGL::clearCache() has changed to SGL_Cache::clear()
97 10-01-06    Implemented a Savant2 template renderer (Andrey Podshivalov)
98 09-01-06    Url alias solution fully integrated and database-driven
99 06-01-06    Added generateRadioList method to SGL_Output (mawan)
100 06-01-06    Added a wrapper to create html views easily:
101                 \$view = new SGL_HtmlSimpleView(\$output);
102                 \$html = \$view->render();
103             (Andrey Podshivalov)
104 06-01-06    Implemented post-connect query which is used to set the default
105             character set for the current connection (MySQL 4.1 or higher). For
106             example: SET NAMES utf8
107 06-01-06    All data object calls are now config driven (freeslacker)
108 05-01-06    Added a new admin GUI, admin tasks will be clearly defined and
109             identified by this addition (Julien Casanova)
110 04-01-06    Blocks can now be enabled/disabled for sub-sections (mstahv)
111 04-01-06    Cleanup of Translation2 implementation, navigation section and items
112             get their own translation id, no more sharing with titles.  section
113             and item_addition both get a new trans_id field (AJ Tarachanowicz)
114 23-12-05    Added new navigation block (AJ Tarachanowicz)
115 22-12-05    PEAR's Translation2 lib integrated which means application interface,
116             navigation and content can now be translated into multiple languages,
117             many thanks to AJ's gargantuan effort here and the patronage of
118             Multithink.com (AJ Tarachanowicz)
119 22-12-05    Improvement to the who's online block (Andrey Podshivalov)
120
121 EOT;
122
123     // Instanciate package file manager
124     $pkg = new PEAR_PackageFileManager2();
125
126     // Setting options
127     $e = $pkg->setOptions(
128         array(
129             // Where are our package files.
130             'packagedirectory'  => $packagedir,
131             // Where will package files be installed in
132             // the local PEAR repository?
133             'baseinstalldir'    => 'Seagull',
134             // Where should the package file be generated
135             'pathtopackagefile' => $packagedir,
136             // Just simple output, no MD5 sums and <provides> tags
137             #'simpleoutput'      => true,
138
139             'packagefile'       => 'package2.xml',
140             // Use standard file list generator, choose CVS, if you
141             // have your code in CVS
142             'filelistgenerator' => 'file',
143
144             // List of files to ignore and put not explicitly into the package
145             'ignore'            =>
146             array(
147                 'package.xml',
148                 'package2.xml',
149                 'generate_package_xml.php',
150                 'lib/pear/',
151                 'modules/',
152                 'www/themes/default_admin/',
153                 'www/themes/savant/',
154                 'www/themes/smarty/',
155                 '*tests*',
156                 '*.svn',
157             ),
158
159             // Global mapping of directories to file roles.
160             // @see http://pear.php.net/manual/en/guide.migrating.customroles.defining.php
161             'dir_roles'         =>
162             array(
163                 'docs' => 'doc',
164                 'lib' => 'php',
165 //                'modules' => 'php',
166                 'etc' => 'data',
167                 'var' => 'data',
168                 'www' => 'web',
169             ),
170
171             'roles'             =>
172             array(
173                 'php' => 'php',
174                 #'html' => 'web',
175                 #'png' => 'web',
176                 #'gif' => 'web',
177                 #'jpg' => 'web',
178                 '*' => 'php',
179             ),
180
181             // Define exceptions of previously defined role mappings,
182             // this part uses real file names and no directories.
183             'exceptions'        =>
184             array(
185                 'CHANGELOG.txt' => 'doc',
186                 'CODING_STANDARDS.txt' => 'doc',
187                 'README.txt' => 'doc',
188                 'COPYING.txt' => 'php',
189                 'INSTALL.txt' => 'doc',
190                 'VERSION.txt' => 'php',
191             ),
192
193             'installexceptions' =>
194             array(
195                 'mysql_SGL.php' => 'DB',
196                 'oci8_SGL.php' => 'DB',
197                 'maxdb_SGL.php' => 'DB',
198                 'db2_SGL.php' => 'DB',
199                 'Tree.php' => 'HTML',
200                 'WebSGL.php' => 'PEAR/Frontend',
201                 'RemoteSGL.php' => 'PEAR/Command',
202                 'RemoteSGL.xml' => 'PEAR/Command',
203             ),
204         )
205     );
206
207     // PEAR error checking
208     if (PEAR::isError($e)) {
209         die($e->getMessage());
210     }
211
212     // Set misc package information
213     $pkg->setPackage($package);
214     $pkg->setSummary($summary);
215     $pkg->setDescription($description);
216     $pkg->setChannel($channel);
217
218     $pkg->setReleaseStability('beta');
219     $pkg->setAPIStability('stable');
220     $pkg->setReleaseVersion($version);
221     $pkg->setAPIVersion($version);
222
223     $pkg->setLicense($license);
224     $pkg->setNotes($notes);
225
226     // Our package contains PHP files (not C extension files)
227     $pkg->setPackageType('php');
228
229     // Must be available in new package.xml format
230     $pkg->setPhpDep('4.3.0');
231     $pkg->setPearinstallerDep('1.4.6');
232
233     // Require custom file role for our web installation
234     $pkg->addPackageDepWithChannel('required', 'Role_Web', 'pearified.com', '1.1.0');
235
236     // Require PEAR_DB package for initializing the database in the post install script
237     $pkg->addPackageDepWithChannel('required', 'Cache_Lite', 'pear.php.net', '1.5.2');
238     $pkg->addPackageDepWithChannel('required', 'Config', 'pear.php.net', '1.10.4');
239     $pkg->addPackageDepWithChannel('required', 'DB', 'pear.php.net', '1.7.6');
240     $pkg->addPackageDepWithChannel('required', 'DB_DataObject', 'pear.php.net', '1.7.15');
241     $pkg->addPackageDepWithChannel('required', 'DB_NestedSet', 'pear.php.net', '1.3.6');
242     $pkg->addPackageDepWithChannel('required', 'Date', 'pear.php.net', '1.4.6');
243     $pkg->addPackageDepWithChannel('required', 'File', 'pear.php.net', '1.2.2');
244     $pkg->addPackageDepWithChannel('required', 'HTML_Common', 'pear.php.net', '1.2.2');
245     $pkg->addPackageDepWithChannel('required', 'HTML_QuickForm', 'pear.php.net', '3.2.5');
246     $pkg->addPackageDepWithChannel('required', 'HTML_QuickForm_Controller', 'pear.php.net', '1.0.5');
247     $pkg->addPackageDepWithChannel('required', 'HTML_Template_Flexy', 'pear.php.net', '1.2.3');
248     $pkg->addPackageDepWithChannel('required', 'Log', 'pear.php.net', '1.9.2');
249     $pkg->addPackageDepWithChannel('required', 'Mail_Mime', 'pear.php.net', '1.3.1');
250     $pkg->addPackageDepWithChannel('required', 'Net_Socket', 'pear.php.net', '1.0.6');
251     $pkg->addPackageDepWithChannel('required', 'Net_Useragent_Detect', 'pear.php.net', '1.2.0');
252     $pkg->addPackageDepWithChannel('required', 'Pager', 'pear.php.net', '2.3.4');
253     $pkg->addPackageDepWithChannel('required', 'Text_Password', 'pear.php.net', '1.1.0');
254     $pkg->addPackageDepWithChannel('required', 'Translation2', 'pear.php.net', '2.0.0beta8');
255     $pkg->addPackageDepWithChannel('required', 'Validate', 'pear.php.net', '0.6.2');
256     $pkg->addPackageDepWithChannel('required', 'XML_Parser', 'pear.php.net', '1.2.7');
257     #$pkg->addPackageDepWithChannel('required', 'XML_Tree', 'pear.php.net', '2.0.0RC2');
258     $pkg->addPackageDepWithChannel('required', 'XML_Util', 'pear.php.net', '1.1.1');
259
260     //  package deps
261     //  - default
262     require_once SGL_PKG_TMP_BUILD_DIR . '/modules/default/generatePearPackageXml.php';
263     $pkg->specifySubpackage($default_pkg, $dependency = false/* indicates subpackage */, $required = true);
264
265     //  - navigation
266     require_once SGL_PKG_TMP_BUILD_DIR . '/modules/navigation/generatePearPackageXml.php';
267     $pkg->specifySubpackage($navigation_pkg, $dependency = false/* indicates subpackage */, $required = true);
268
269     //  - user
270     require_once SGL_PKG_TMP_BUILD_DIR . '/modules/user/generatePearPackageXml.php';
271     $pkg->specifySubpackage($user_pkg, $dependency = false/* indicates subpackage */, $required = true);
272
273     //  - publisher
274 #    require_once SGL_PKG_TMP_BUILD_DIR . '/modules/publisher/generatePearPackageXml.php';
275 #    $pkg->specifySubpackage($publisher_pkg, $dependency = false/* indicates subpackage */, $required = false);
276
277     // Insert path to our include files into S9Y global configuration
278     #$pkg->addReplacement('serendipity_config.inc.php', 'pear-config', '@php_dir@', 'php_dir');
279
280     $pkg->addReplacement('lib/SGL/Task/Init.php', 'pear-config', '@PHP-DIR@''php_dir');
281     $pkg->addReplacement('lib/SGL/Task/Init.php', 'pear-config', '@DATA-DIR@', 'data_dir');
282     $pkg->addReplacement('lib/SGL/Task/Init.php', 'pear-config', '@WEB-DIR@''web_dir');
283     $pkg->addReplacement('lib/SGL/Install/WizardCreateAdminUser.php', 'pear-config', '@WEB-DIR@''web_dir');
284     $pkg->addReplacement('www/index.php', 'pear-config', '@DATA-DIR@', 'data_dir');
285     $pkg->addReplacement('www/index.php', 'pear-config', '@PHP-DIR@''php_dir');
286     $pkg->addReplacement('www/setup.php', 'pear-config', '@PHP-DIR@''php_dir');
287     $pkg->addReplacement('www/setup.php', 'pear-config', '@DATA-DIR@', 'data_dir');
288
289       // Define that we will use our custom file role in this script
290 //    $e = $pkg->addUsesRole('web', 'www');
291 //    if (PEAR::isError($e)) {
292 //        die($e->getMessage());
293 //    }
294
295     // Mapping misc roles to file name extensions
296     // Directly here, a dirty hack: Map all files without extension
297     // to "doc" role
298 #    $e = $pkg->addRole('', 'doc');
299 #    if (PEAR::isError($e)) {
300 #        die($e->getMessage());
301 #    }
302 //    $e = $pkg->addRole('lib', 'doc');
303 //    if (PEAR::isError($e)) {
304 //        die($e->getMessage());
305 //    }
306 //
307 //    $e = $pkg->addRole('html', 'web');
308 //    if (PEAR::isError($e)) {
309 //        die($e->getMessage());
310 //    }
311 //    $e = $pkg->addRole('gif', 'web');
312 //    if (PEAR::isError($e)) {
313 //        die($e->getMessage());
314 //    }
315 //    $e = $pkg->addRole('jpeg', 'web');
316 //    if (PEAR::isError($e)) {
317 //        die($e->getMessage());
318 //    }
319
320     // Create the current release and add it to the package definition
321     $pkg->addRelease();
322
323     // Package release needs a maintainer
324     $pkg->addMaintainer('lead', 'demianturner', 'Demian Turner', 'demian@phpkitchen.com');
325
326     // Internally generate the XML for our package.xml (does not perform output!)
327     $test = $pkg->generateContents();
328
329     //  get ver 1.0 compatible version
330     #$packagexml = &$pkg->exportCompatiblePackageFile1();
331     #$packagexml->addMaintainer('lead', 'demianturner', 'Demian Turner', 'demian@phpkitchen.com');
332     #$test1 = $packagexml->generateContents();
333
334
335     // If called without "make" parameter, we just want to debug the generated
336     // package.xml file and want to receive additional information on error.
337     if (isset($_GET['make']) || (isset($_SERVER['argv'][1]) &&
338             $_SERVER['argv'][1] == 'make')) {
339         $e = $pkg->writePackageFile();
340         #$e = $packagexml->writePackageFile();
341
342     } else {
343         $e = $pkg->debugPackageFile();
344         #$e = $packagexml->writePackageFile();
345     }
346
347     if (PEAR::isError($e)) {
348         echo $e->getMessage();
349     }
350
351 ?>
Note: See TracBrowser for help on using the browser.