Prereqs
=======

* Trac 0.10.x or 0.11
* Setuptools for Python
* TracXMLRPC Plugin
* (for 0.11+) Genshi 0.5 or better
* (for 0.10) a couple of patches to Trac core

Systemwide Installation
=======================

To install the plugins (TracXMLRPC and Trac-Launchpad) systemwide, simply
perform this in each directory::

    sudo python setup.py install

To then activate the plugin in a specific Trac instance, edit
$TRAC_ENV/conf/trac.ini to add the following lines::

    # for 0.10
    [components]
    tracrpc.* = enabled
    tracext.launchpad.* = enabled

    [ticket-custom]
    launchpad_bug = text
    launchpad_bug.label = Launchpad Bug

You must then grant the special 'launchpad' user permission to access the
XML-RPC interface, by executing::

    trac-admin $TRAC_ENV permission add launchpad XML_RPC
    trac-admin $TRAC_ENV permission add launchpad LAUNCHPAD_RPC

If using 0.10, you need to apply the patches provided in the 0.10-patches
subdir (cd /path/to/trac; patch -p1 < /path/to/trac-launchpad/0.10-patches/*)

Then after restarting your webserver, launchpad should be able to sync bugs.
In order to verify whether the plugin was enabled correctly, you can always
log in with TRAC_ADMIN privileges and then visit $YOUR_TRAC_URL/plugins if
you have version 0.11.


Troubleshooting
===============

To set up a test tokenserver, edit the environment's trac.ini as follows::

    [launchpad]
    auth_server = http://localhost:8081/tokens/%s/+bugtracker-handshake

Find simple_tokenserver.py in the tarball and run as follows::

    python simple_tokenserver.py +

The plus gives the default policy, which allows all requested tokens to
match.

Now visit $TRAC_URL/launchpad-auth/abc in your browser, and you should get
an "OK" along with a cookie.  Now visit $TRAC_URL/xmlrpc and you should get
a listing of XML-RPC endpoints.  If you get a listing but launchpad is not
in it, check the permissions for the launchpad user.
