[ Index ] |
|
Code source de PHPonTrax 2.6.6-svn |
1 #!@PHP-BIN@ 2 <?php 3 /** 4 * Make a Pear installable package of the PHPonTrax distribution 5 * 6 * (PHP 5) 7 * 8 * To make a package, connect to the top directory and type 9 * <b>php makepkg.php</b> (or on Unix-type systems, <b>./makepkg.php</b>). 10 * Information about how to build the package and what to put in it 11 * comes from two sources: this script, and the information 12 * maintained by {@link http://subversion.tigris.org Subversion} in 13 * the various .svn directories that identifies which files are part 14 * of the distribution. 15 * 16 * Requires Pear package 17 * {@link http://pear.php.net/package/PEAR_PackageFileManager PEAR_PackageFileManager} . 18 * The Subversion plugin uses 19 * {@link http://pear.php.net/package/XML_Tree XML_Tree} . 20 * Unfortunately XML_Tree has a couple of methods named 21 * {@link http://www.php.net/manual/en/language.oop5.cloning.php clone} 22 * which is a reserved word in PHP 5. The fix is 23 * easy, just edit XML_Tree to change every use of 'clone' to 'clone4'. 24 * 25 * PackageFileManager has several undocumented limitations that 26 * seriously affect what you can do with it: 27 * <ul> 28 * <li>PackageFileManager will not add an empty directory to a 29 * package. Therefore you need to put at least one file in any 30 * directory that is to go into a package.</li> 31 * <li>The Pear Installer will not install an empty file. Therefore 32 * you need to put at least one character into any file to be 33 * installed as part of a package.</li> 34 * <li>The PackageFileManager options 'include' and 'ignore' use a 35 * regular expression match to identify the files and directories 36 * that they affect. For each file and directory managed by 37 * Subversion, PackageFileManager first attempts to apply the 38 * RE pattern as coded. Then it appends leading and trailing '/' 39 * to the pattern and tries again. The results are hard to 40 * predict.</li> 41 * </ul> 42 * 43 * @package PHPonTrax 44 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 45 * @copyright (c) Walter O. Haas 2006 46 * @version $Id: makepkg.php 266 2006-09-18 14:20:14Z john $ 47 * @author Walt Haas <haas@xmission.com> 48 */ 49 50 require_once('PEAR/PackageFileManager.php'); 51 require_once('PEAR/Packager.php'); 52 53 $packagexml = new PEAR_PackageFileManager; 54 55 $e = $packagexml->setOptions(array( 56 'package' => 'PHPonTrax', 57 'channel' => 'pear.phpontrax.com', 58 'summary' => 'Rapid Application Development Made Easy', 59 'description' => 'PHP port of Ruby on Rails', 60 'baseinstalldir' => 'PHPonTrax', 61 'version' => '266svn', 62 'packagedirectory' => '.', 63 'state' => 'beta', 64 'filelistgenerator' => 'svn', // generate from svn 65 'notes' => 'We\'ve implemented many new and exciting features', 66 'dir_roles' => array( 67 'doc' => 'doc', 68 'test' => 'test', 69 'data' => 'data' 70 ), 71 'exceptions' => array( 72 'pear-trax' => 'script', 73 'pear-trax.bat' => 'script', 74 'vendor/trax/templates/error.phtml' => 'php', 75 'vendor/trax/templates/view.phtml' => 'php', 76 'vendor/trax/templates/mailer_view.phtml' => 'php', 77 'vendor/trax/templates/scaffolds/add.phtml' => 'php', 78 'vendor/trax/templates/scaffolds/edit.phtml' => 'php', 79 'vendor/trax/templates/scaffolds/index.phtml' => 'php', 80 'vendor/trax/templates/scaffolds/layout.phtml' => 'php', 81 'vendor/trax/templates/scaffolds/show.phtml' => 'php', 82 'vendor/trax/templates/scaffolds/scaffold.css' => 'php', 83 'vendor/trax/templates/scaffolds/generator_templates/form_scaffolding.phtml' => 'php', 84 'vendor/trax/templates/scaffolds/generator_templates/layout.phtml' => 'php', 85 'vendor/trax/templates/scaffolds/generator_templates/view_add.phtml' => 'php', 86 'vendor/trax/templates/scaffolds/generator_templates/view_edit.phtml' => 'php', 87 'vendor/trax/templates/scaffolds/generator_templates/view_index.phtml' => 'php', 88 'vendor/trax/templates/scaffolds/generator_templates/view_show.phtml' => 'php', 89 'vendor/trax/templates/scaffolds/generator_templates/style.css' => 'php' 90 ), 91 'installexceptions' => array( 92 'pear-trax' => '/', 93 'dispatch.php' => 'public' 94 ), 95 'installas' => array( 96 'pear-trax' => 'trax', 97 'pear-trax.bat' => 'trax' 98 ) 99 )); 100 101 if(PEAR::isError($e)) { 102 die($e->getMessage()); 103 } 104 105 // Depends on PHP 5 106 $e = $packagexml->addDependency('php','5.0.3','ge','php','no'); 107 if(PEAR::isError($e)) { 108 die($e->getMessage()); 109 } 110 111 // Depends on these PEAR modules 112 $e = $packagexml->addDependency('MDB2','2.0'); 113 if(PEAR::isError($e)) { 114 die($e->getMessage()); 115 } 116 117 $e = $packagexml->addDependency('Mail','1.0'); 118 if(PEAR::isError($e)) { 119 die($e->getMessage()); 120 } 121 122 $e = $packagexml->addDependency('Mail_Mime','1.0'); 123 if(PEAR::isError($e)) { 124 die($e->getMessage()); 125 } 126 127 //$e = $packagexml->addDependency('PHPUnit2','1.0'); 128 //if(PEAR::isError($e)) { 129 //die($e->getMessage()); 130 //} 131 132 // Optionally uses these PEAR modules 133 $e = $packagexml->addDependency('PhpDocumentor','1.3.0','ge','pkg','yes'); 134 if(PEAR::isError($e)) { 135 die($e->getMessage()); 136 } 137 138 // Who maintains this package 139 $e = $packagexml->addMaintainer('john','lead','John Peterson','john@mytechsupport.com'); 140 if(PEAR::isError($e)) { 141 die($e->getMessage()); 142 } 143 144 $e = $packagexml->addMaintainer('haas','developer','Walt Haas','haas@xmission.com'); 145 if(PEAR::isError($e)) { 146 die($e->getMessage()); 147 } 148 149 // Substitute local configuration values for these symbols 150 $e = $packagexml->addGlobalReplacement('pear-config', '@BIN-DIR@', 'bin_dir'); 151 if(PEAR::isError($e)) { 152 die($e->getMessage()); 153 } 154 155 $e = $packagexml->addGlobalReplacement('pear-config', '@DOC-DIR@', 'doc_dir'); 156 if(PEAR::isError($e)) { 157 die($e->getMessage()); 158 } 159 160 $e = $packagexml->addGlobalReplacement('pear-config', '@PHP-DIR@', 'php_dir'); 161 if(PEAR::isError($e)) { 162 die($e->getMessage()); 163 } 164 165 $e = $packagexml->addGlobalReplacement('pear-config', '@DATA-DIR@', 'data_dir'); 166 if(PEAR::isError($e)) { 167 die($e->getMessage()); 168 } 169 170 $e = $packagexml->addGlobalReplacement('pear-config', '@PHP-BIN@', 'php_bin'); 171 if(PEAR::isError($e)) { 172 die($e->getMessage()); 173 } 174 175 $e = $packagexml->addGlobalReplacement('pear-config', '@TEST-DIR@', 'test_dir'); 176 if(PEAR::isError($e)) { 177 die($e->getMessage()); 178 } 179 180 // Platform-dependent command lines 181 $e = $packagexml->addPlatformException('pear-trax.bat', 'windows'); 182 if(PEAR::isError($e)) { 183 die($e->getMessage()); 184 } 185 186 $e = $packagexml->addPlatformException('pear-trax', '*ix|*ux|*BSD|Darwin'); 187 if(PEAR::isError($e)) { 188 die($e->getMessage()); 189 } 190 191 // Study the Subversion .svn directories to see what goes in the 192 // package, then write package.xml 193 // (Needs: XML_Tree with patch s/clone/clone4/g) 194 $e = $packagexml->writePackageFile(); 195 if(PEAR::isError($e)) { 196 die($e->getMessage()); 197 } 198 199 // Make a tarball of the files listed in package.xml 200 $packager = new PEAR_Packager; 201 $e = $packager->package(); 202 if(PEAR::isError($e)) { 203 die($e->getMessage()); 204 } 205 206 // -- set Emacs parameters -- 207 // Local variables: 208 // tab-width: 4 209 // c-basic-offset: 4 210 // c-hanging-comment-ender-p: nil 211 // indent-tabs-mode: nil 212 // End: 213 214 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 20:04:38 2007 | par Balluche grâce à PHPXref 0.7 |