How to install trac, mercurial and trac-mercurial on Fedora Core 10
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
wget http://peak.telecommunity.com/dist/ez_setup.py
Here is the first (minor) pitfall. You need to force the update of easy_install. If you only run "python ez_setup.py", then you will not get the easy_install command (bash will not recognize it). Run:
python ez_setup.py -U setuptools
3. Install the mercurial plugin
From: http://trac.edgewall.org/wiki/MultipleRepositorySupport
Check out the mercurial plugin:
svn co http://svn.edgewall.com/repos/trac/sandbox/mercurial-plugin-0.12
Build the mercurial plugin. From within the checked-out directory, build the egg file (it will end up in the dist subdirectory):
python setup.py bdist_egg
Check out the multirepos branch:
svn co http://svn.edgewall.com/repos/trac/sandbox/multirepos
Install the multirepos version of trac (from within the multirepos directory, as root):
python setup.py 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/mod_python.so
7. Continue with the setup
From: http://trac.edgewall.org/wiki/MultipleRepositorySupport
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:
'/path/to/trac/env/attachments/VERSION')
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-0.12.0.6dev_r7902-py2.5.egg file to the correct location. (And restart apache.)
References:
http://trac.edgewall.org/wiki/TracOnFedoraCore http://trac.edgewall.org/wiki/TracMercurial http://trac.edgewall.org/wiki/TracModPython http://trac.edgewall.org/wiki/MultipleRepositorySupport http://www.smallroomsoftware.com/articles/2008/2/14/trac-0-11-installation-on-centos-fedora
Comments
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 http://svn.edgewall.org/repos/trac/plugins/0.12/mercurial-plugin
svn co http://svn.edgewall.com/repos/trac/trunk 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).