cvs: pearweb /doc pear_package_manager.txt

From: Date: Sun, 30 Dec 2001 17:17:37 +0000
Subject: cvs: pearweb /doc pear_package_manager.txt
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-1778@lists.php.net to get a copy of this message
cox Sun Dec 30 12:17:37 2001 EDT Modified files: /pearweb/doc pear_package_manager.txt Log: - install packages from the web - where to install documentation - others

Index: pearweb/doc/pear_package_manager.txt diff -u pearweb/doc/pear_package_manager.txt:1.3 pearweb/doc/pear_package_manager.txt:1.4 --- pearweb/doc/pear_package_manager.txt:1.3 Sun Dec 30 11:06:05 2001 +++ pearweb/doc/pear_package_manager.txt Sun Dec 30 12:17:37 2001 @@ -1,10 +1,11 @@ + +----------+-----------------------------------------+ | Title | Usage of the PEAR Package Manager | +----------+-----------------------------------------+ | Authors | Tomas V.V.Cox <cox@idecnet.com> | | | Michael Haertl <mhaertl@pressline.de> | +----------+-----------------------------------------+ - | Revision | $Revision: 1.3 $ | + | Revision | $Revision: 1.4 $ | +----------+-----------------------------------------+ @@ -38,7 +39,7 @@ ================================================================ -2. Installing from CVS +2. Getting the PEAR Package Manager ================================================================ @@ -52,15 +53,19 @@ manual, chapter 2. So we will not cover it here. The CVS module of php holds two different PEAR directories. -"php4/pear/" is the module which will go into the next release of PHP. In the future this will only contain the PEAR base modules including the Package Manager and the core components. All new PEAR projects go into the "pear/" module and all other elements from "php4/pear" will migrate to "pear/". +"php4/pear/" is the module which will go into the next release of PHP. +In the future this will only contain the PEAR base modules including +the Package Manager and the core components. All new PEAR projects +go into the "pear/" module and all other elements from "php4/pear" +will migrate to "pear/". The "php4/pear/" tree can be fetched from CVS with these commands: - # login to CVS - cvs -z3 -d :pserver:cvsread@cvs.php.net:/repository login - Password: [use "phpfi" as password] - # fetch the php4/pear tree - cvs -z3 -d :pserver:cvsread@cvs.php.net:/repository co php4/pear + # login to CVS + cvs -z3 -d :pserver:cvsread@cvs.php.net:/repository login + Password: [use "phpfi" as password] + # fetch the php4/pear tree + cvs -z3 -d :pserver:cvsread@cvs.php.net:/repository co php4/pear After this you can find the PEAR files in php4/pear. @@ -77,47 +82,78 @@ have this file in your PEAR install path. If you haven't, you can fetch this file with: - cvs -z3 -d :pserver:cvsread@cvs.php.net:/repository co \ - pear/Archive_Tar/Tar.php + cvs -z3 -d :pserver:cvsread@cvs.php.net:/repository co \ + pear/Archive_Tar/Tar.php Copy it to PATH_TO_PEAR/Archive/Tar.php manually. The Package Manager itself can be found in the PEAR install path, too: - PATH_TO_PEAR/scripts/pear.in + PATH_TO_PEAR/scripts/pear.in Copy this file somewhere into your search path (on Linux /usr/local/bin would be a good choice) and rename it to 'pear'. After all you have to set the correct path to the PHP interpreter in the first line of this script. On Linux this usually would be: - #!/usr/local/bin/php -Cq + #!/usr/local/bin/php -Cq Now the Package Manager is ready for use an can be started by entering 'pear'. If you run it without arguments you should get a -short help. +short help which will look like: + Usage: pear [options] command [command-options] <parameters> + Options: + -v increase verbosity level (default 1) + -q be quiet, decrease verbosity level + -c file find user configuration in `file' + -C file find system configuration in `file' + -d foo=bar set user config variable `foo' to `bar' + -D foo=bar set system config variable `foo' to `bar' + -s store user configuration + -s store system configuration + -u foo unset `foo' in the user configuration + -h, -? display help/usage (this message) + Commands: + help [command] + install [-r] <package file> + uninstall [-r] <package name> + package [package info file] + list-installed + list-available + info + show-config ================================================================ -3. Usage with CVS packages +3. Install packages from http://pear.php.net ================================================================ +As simple as: + + pear install http://pear.php.net/get/HTTP_Upload + +That will install the lastest version of the package HTTP_Upload +in your system. -In the future you will be able to install PEAR packages from -http://pear.php.net with a single command line like this: +If you don't know the name or want to browse the avaible packages, +point your web browser to http://pear.php.net and use the Package +Browser. Once you find the package you want to download, copy the +url location and launch the above command. Of course you can +download the package manually and install it locally. - # Install the HTML_QUICKFORM - package pear install \ - http://pear.php.net/packages/HTML_QUICKFORM-1.4.tgz +Currently the whole system is working in BETA state. -Currently there are no packages available yet on the PEAR website. -But you already can create and install packages from most of the -sub-projects form the CVS pear/. Therefore you will need the complete +================================================================ +4. Install packages from CVS +================================================================ + +You already can create and install packages from most of the +sub-projects from the CVS pear/. Therefore you will need the complete PEAR tree: - cvs -z3 -d :pserver:cvsread@cvs.php.net:/repository co pear/ + cvs -z3 -d :pserver:cvsread@cvs.php.net:/repository co pear/ In the pear/ directory every sub-project has it's own subdirectory. Please note that the directory structure in the CVS differs from that @@ -125,17 +161,17 @@ To create a package from a sub-project, call pear like this: - pear package path_to_project/package.xml + pear package path_to_project/package.xml Example: - # create and install the package for the QuickForm package - pear package HTML_QuickForm/package.xml - pear install HTML_QuickForm-1.4.tgz + # create and install the package for the QuickForm package + pear package HTML_QuickForm/package.xml + pear install HTML_QuickForm-1.4.tgz ================================================================ -4. Creating your own packages +5. Creating your own packages ================================================================ @@ -159,18 +195,18 @@ The core of a sub project is the XML file package.xml. It describes the contents of a package. An example shall explain how this works. -Suppose your project has a directory structure like this: +Suppose your project has a directory structure like this in CVS: - <actual path> - | - +---Net_Whois/ - | - +---package.xml // This file must be present in - | // the base dir of every package - +---Whois.php - +---docs/ - | - +---Whois_usage.txt + <actual path> + | + +---Net_Whois/ + | + +---package.xml // This file must be present in + | // the base dir of every package + +---Whois.php + +---docs/ + | + +---Whois_usage.txt The according package.xml would look like this: @@ -178,67 +214,67 @@ <?xml version="1.0" encoding="ISO-8859-1" ?> <package> -<!-- Package description --> + <!-- Package description --> - <name>Net_Whois</name> - <summary>A tool for querying Whois Servers</summary> + <name>Net_Whois</name> + <summary>A tool for querying Whois Servers</summary> <description> The PEAR::Net_Whois class - provides a tool for querying Whois Servers + provides a tool for querying Whois Servers </description> -<!-- Authors --> + <!-- Authors --> - <maintainers> - <maintainer> - <user>SN</user> <!-- php cvs user --> - <name>Sebastian Nohn</name> - <email>sebastian@nohn.net</email> + <maintainers> + <maintainer> + <user>SN</user> <!-- php cvs user --> + <name>Sebastian Nohn</name> + <email>sebastian@nohn.net</email> <role>lead</role> <!-- 'lead','developer','contributor','helper' --> - </maintainer> - </maintainers> + </maintainer> + </maintainers> -<!-- Current release --> + <!-- Current release --> <release> <!-- Release details --> - <version>0.1</version> + <version>0.1</version> <state>beta</state> <!-- 'alpha','beta','stable','snapshot' --> - <date>2001-08-22</date> - <notes> This is the initial independent release of - the Net_Whois package. - </notes> + <date>2001-08-22</date> + <notes> This is the initial independent release of + the Net_Whois package. + </notes> <!-- Dependencies --> - <deps></deps> <!-- see point 5. --> + <deps></deps> <!-- see point 6. --> <!-- Files --> - <filelist> - <dir name="/" BaseInstallDir="Net"> - <file role="php">Whois.php</file> - <dir name="docs" role="docs"> - <file>Whois_usage.txt</file> - </dir> - </dir> - </filelist> - </release> + <filelist> + <dir name="/" BaseInstallDir="Net"> + <file role="php">Whois.php</file> + <dir name="docs" role="docs"> + <file>Whois_usage.txt</file> + </dir> + </dir> + </filelist> + </release> </package> The upper part is self explanatory. It contains summary, version and maintainer information. The bottom part lists all contained files: - <filelist> - <dir name="/" BaseInstallDir="Net"> - <file role="php">Whois.php</file> - <dir name="docs" role="docs"> - <file>Whois_usage.txt</file> - </dir> - </dir> - </filelist> + <filelist> + <dir name="/" BaseInstallDir="Net"> + <file role="php">Whois.php</file> + <dir name="docs" role="docs"> + <file>Whois_usage.txt</file> + </dir> + </dir> + </filelist> <dir name="/" BaseInstallDir="Net"> specifies, where the package should be installed. "/" stands here for the base PEAR install path. @@ -249,7 +285,10 @@ Whois.php is "php". It must be one of "php" for source files, "docs" for documentation or "test" for test files. Test files will not be installed. Since this tag is contained inside the previous <Dir ..> -tag, Whois.php will be installed to PATH_TO_PEAR/Net. +tag, Whois.php will be installed to PATH_TO_PEAR/Net. Files marked +with "doc" role, will be installed in a PEAR central doc directory +at PHP_DATADIR/pear/doc/Package_name, in the example could be +/usr/local/share/php/pear/doc/Net_Whois/. A subdir is specified with <dir name="docs" role="docs">. A directory also has one of the mentioned types. In this case it will be of type @@ -259,18 +298,21 @@ This package will therefore be installed like this to the PEAR install path: - <PATH_TO_PEAR> - | - +---Net/ - | - +---Whois.php - +---docs/ - | - +---Whois_usage.txt + <PATH_TO_PEAR> + | + +---Net/ + | + +---Whois.php + + <PHP_DATADIR/pear/doc/Net_Whois> + | + +---docs/ + | + +---Whois_usage.txt ================================================================ -5. Specifying dependencies in package.xml +6. Specifying dependencies in package.xml ================================================================ Please refer to the Dependencies RFC document located at:
« previous php.pear.cvs (#1778) next »