<?xml version="1.0" encoding="UTF-8"?>
<chapter xmlns:db="http://docbook.org/docbook-ng" xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xml:id="gettingstarted">
    <title>Getting started</title>
    <section>
        <abstract>
            <para>Since CherryPy is pure Python and has no dependencies, obtaining and installing it
            is a snap. You can install using a release package, or by using Subversion.</para>
        </abstract>
        <title>Installing CherryPy from a release package</title>
        <section>
            <title>Obtaining a release package</title>
            <para>A "release package" is an official stable release of CherryPy. It means that the
            main features and issues that were decided to be integrated and fixed for a particular
            milestone, have been.</para>
            <para>The latest package is available from <ulink
            url="http://sourceforge.net/project/showfiles.php?group_id=56099">the sourceforge
            repository</ulink> of the CherryPy project. You need to pick up the latest version of the
            package.</para>
        </section>
        <section>
            <title>Installing from a release package</title>
            <para>Installing CherryPy from a release package will take three steps only. Type the
            following commands :</para>
            <cmdsynopsis>
                <command>tar</command>
                <arg choice="req">zxvf</arg>
                <arg choice="req">CherryPy-2.1.0.tar.gz</arg>
            </cmdsynopsis>
            <para>Which will create the CherryPy-2.1.0 directory.</para>
            <cmdsynopsis>
                <command>cd</command>
                <arg choice="req">CherryPy-2.1.0</arg>
            </cmdsynopsis>
            <para>Then issue the following command (if you are under Unix or Linux, you should be
            root):</para>
            <cmdsynopsis>
                <command>python</command>
                <arg choice="req">setup.py</arg>
                <arg choice="req">install</arg>
            </cmdsynopsis>
        </section>
    </section>
    <section>
        <title>Installing CherryPy from the Subversion repository</title>
        <section>
            <title>Obtaining the package from the Subversion repository</title>
            <para>The CherryPy project uses Subversion to control access to its source code. Getting
            CherryPy from the latest changeset is sometimes required because a bugfix or a feature is
            only available from it. Keep in mind that subversion code is subject to change on a
            regular basis; therefore, only use it if you know what you are doing.</para>
            <para>To get the latest source code from the subversion repository, you first need to
            install a SVN client. On Microsoft Windows, <ulink
            url="http://tortoisesvn.tigris.org/">TortoiseSVN</ulink> is a good choice. Under Linux,
            you can either use the <ulink url="http://subversion.tigris.org/">svn</ulink> command
            line tools or use a graphical user interface such as <ulink
            url="http://esvn.umputun.com/">eSVN</ulink>.</para>
            <para>Once you have installed a svn client, you need to type the following command
            :</para>
            <cmdsynopsis>
                <command>svn</command>
                <arg choice="req">co</arg>
                <arg choice="req">http://svn.cherrypy.org</arg>
            </cmdsynopsis>
            <para>This will download the complete source code to your computer.</para>
        </section>
        <section>
            <title>Installing the package from the Subversion repository</title>
            <para>If you have downloaded the source code from the CherryPy subversion repository,
            then you should have a directory called svn.cherrypy.org. Then type the following
            commands:</para>
            <cmdsynopsis>
                <command>cd</command>
                <arg choice="req">svn.cherrypy.org/trunk</arg>
            </cmdsynopsis>
            <para>Then issue the following command (as root if you are under Unix/Linux):</para>
            <cmdsynopsis>
                <command>python</command>
                <arg choice="req">setup.py</arg>
                <arg choice="req">install</arg>
            </cmdsynopsis>
            <para>Alternately, since CherryPy has no dependencies, you don't have to run setup.py.
            Simply checkout the code into a directory which is on your Python path, such as your
            site-packages directory.
            </para>
        </section>
    </section>
    <section>
        <title>Running the test programs</title>
        <para>If you have installed CherryPy from the source code downloaded from the subversion
        repository, you can run the test suite to check if everything is fine on your system. Type
        the following commands:</para>
        <cmdsynopsis>
            <command>cd</command>
            <arg choice="req">svn.cherrypy.org/trunk/cherrypy/test</arg>
        </cmdsynopsis>
        <cmdsynopsis>
            <command>python</command>
            <arg choice="req">test.py</arg>
        </cmdsynopsis>
        <para>If all tests pass, then they will be flagged as <code>ok</code>. If an error occurs,
        please visit the main CherryPy website to report the issue.</para>
    </section>
</chapter>