Here is a quick, up-to-date (as of 05/2009) guide to installing and troubleshooting trac, mercurial and trac-mercurial on FC10. I started with a fresh VM install for this guide.

1. Get the dependencies and tools

yum install wget yum install python mercurial trac trac-mercurial yum install python-devel python-setuptools python-genshi python-docutils python-pygments mod_python

2. Get easy_install to work on FC10


Here is the first (minor) pitfall. You need to force the update of easy_install. If you only run "python", then you will not get the easy_install command (bash will not recognize it). Run:

python -U setuptools

3. Install the mercurial plugin


Check out the mercurial plugin: svn co

Build the mercurial plugin. From within the checked-out directory, build the egg file (it will end up in the dist subdirectory):

python bdist_egg

Check out the multirepos branch:

svn co

Install the multirepos version of trac (from within the multirepos directory, as root):

python install

4. Get the development branch of Genshi

Here you will run into the error "No local packages or download links found for Genshi>=0.6dev-r960". To fix this, you need to force an update of Genshi to the latest dev version:

easy_install -U "Genshi==dev"

5. Create your trac environment directory

For example:

trac-admin /path/to/trac/myproject initenv chown -R apache:apache /path/to/trac/myproject

6. Setup Apache for Trac

nano etc/httpd/conf/httpd.conf

Add something like:

<Location "/trac"> SetHandler mod_python PythonInterpreter main_interpreter PythonHandler trac.web.modpython_frontend PythonOption TracEnvParentDir /path/to/trac PythonOption TracUriRoot /trac </Location>

And if you haven't added mod_python already:

LoadModule python_module modules/

7. Continue with the setup


Copy the mercurial plugin egg file to the <trac-env>/plugins directory. Make sure the following is somewhere in <trac-env>/conf/trac.ini, adding all the desired repositories to the [repositories] section: [components] tracext.hg.* = enabled[repositories] my_repo_a.dir = path_to_a_repository

[trac] repository_dir = path_to_default_repository repository_type = hg

Note that when the repository .type is not specified, the value of [trac] repository_type is used.

8. Restart apache and test

service httpd restart

Navigate to http://localhost/trac .

Some possible errors

If you get something like:

Available Projects
    * attachments: Error
      ([Errno 2] No such file or directory:

Check your TracEnvParentDir in httpd.conf, it is probably incorrect. (And restart apache.)

If you get the error:

"Unsupported version control system "hg": Can't find an appropriate component, maybe the corresponding plugin was not enabled? "

Check if you copied the TracMercurial- file to the correct location. (And restart apache.)



Vern B: Thanks for the page...

Step 1: My CentOS 5.4 system was missing these packages (for step 5); one is from base and one from rpmforge:

yum install sqlite-devel python-sqlite2

Step 3: The URL for Trac and Mercurial Plugin moved, use:

 svn co

 svn co trac-trunk

Step 6: Before adding to 'http.conf' check for a file at: /etc/httpd/conf.d/trac.conf

In the end, though, Genshi 0.6 doesn't seem to be available for CentOS -- so, I didn't get this working (yet).