Installing and configuring trac-0.9.3This will install trac for use with apache and mod_python. Emerge trac with the sqlite and the silvercity useflags enabled: echo "www-apps/trac sqlite silvercity" >> /etc/portage/package.use In addition I activated zlib and python support for the clearsilver package: echo "dev-libs/clearsilver zlib python" >> /etc/portage/package.use Now trac can be emerged. emerge www-apps/trac While the Gentoo trac ebuild is actually based on the webapp.eclass there is no reason to actually run webapp-config if you use mod_python to run trac. Now let's create the subversion repositories: svnadmin create /var/svn/repos/myrepo chown -R apache\: /var/svn/repos/myrepo And the corresponding trac environment: trac-admin /var/lib/trac/myrepo initenv This will initiate a short dialog that should look similar to this one: Creating a new Trac environment at /var/lib/trac/myrepo Trac will first ask a few questions about your environment in order to initalize and prepare the project database. Please enter the name of your project. This name will be used in page titles and descriptions. Project Name [My Project]> My repository Please specify the connection string for the database to use. By default, a local SQLite database is created in the environment directory. It is also possible to use an already existing PostgreSQL database (check the Trac documentation for the exact connection string syntax). Database connection string [sqlite:db/trac.db]> Please specify the absolute path to the project Subversion repository. Repository must be local, and trac-admin requires read+write permission to initialize the Trac database. Path to repository [/var/svn/test]> /var/svn/repos/myrepo Please enter location of Trac page templates. Default is the location of the site-wide templates installed with Trac. Templates directory [/usr/share/trac/templates]> ... Since the trac project will be published via Apache, the internal trac database needs to be write accessible to the apache user: chown -R apache /var/lib/trac/myrepo/db Now emerge mod_python: emerge mod_python Add -D PYTHON to /etc/conf.d/apache2: APACHE2_OPTS="-D SSL -D PHP5 -D PHP4CGI -D DAV -D DAV_FS -D SVN -D LDAP -D AUTH_LDAP -D SVN_AUTHZ -D PYTHON" Create a new virtual host with /etc/apache2/vhosts.d/25-projects.conf:
<VirtualHost *:80>
ServerName projects.mysite.de
DocumentRoot /var/www/projects.mysite.de
ErrorLog logs/projects-mysite-de_error_log
CustomLog logs/projects-mysite-de_access_log combined
<Location />
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /var/lib/trac/
PythonOption TracUriRoot /
</Location>
<LocationMatch "/[^/]+/login">
AuthType Basic
AuthName "My trac projects"
AuthUserFile /var/svn/conf/developers
Require valid-user
</LocationMatch>
<IfDefine SVN>
<IfModule !mod_dav_svn.c>
LoadModule dav_svn_module modules/mod_dav_svn.so
</IfModule>
<Location /svn>
DAV svn
SVNPath /var/svn/repos/myrepo
AuthType Basic
AuthName "My trac projects"
AuthUserFile /var/svn/conf/developers
Require valid-user
</Location>
</IfDefine>
</VirtualHost>
Finally create a first user: htpasswd2 -c /var/svn/conf/developers wrobel Overlays in tracThere are a number of Gentoo overlays managed with trac now. While the trac wiki allows you to generate a page that lists the overlay contents this is somewhat redundant. The ebuilds present in the tree could be read from the subversion repository directly.Luckily trac allows you to create short macros that can be used within the wiki system. I wrote such a macro to generate an overview of the overlay contents. You can download it here. Simply add it to the wiki-macros sub directory within your trac site: wget http://www.gunnarwrobel.de/downloads/lay2wiki.py mv lay2wiki.py /var/lib/trac/myrepo/wiki-macros/ Now you can use the following macro within the wiki to publish a content listing: [[lay2wiki()]] This only works if your overlay at the root node. If the overlay is somewhere in a sub directory, you can specify the path to it as an argument to the macro: [[lay2wiki(/trunk/overlay)]] This will automatically provide the following information for each ebuild in the overlay:
If you want additional information listed, you can add a info.trac file into the ebuild directory. You can provide the following information in there:
If you specify a type, the ebuilds within a Gentoo category will be subdivided according to these types. This can be useful if the overlay provides a lot of ebuilds in one category. Here is an example info.trac: NOTE="This allows you to submit del.icio.us links from within emacs. Very handy tool to manage your link collection. Will be added to portage once planner has been released." BUG="102295" LINK="<a href='http://www.gunnarwrobel.de/wiki/EmacsDeliciousAPI.html'>My notes on configuring delicious-el</a>" You can also place a file called overlay.trac into the root of the overlay. The text in that file will be published as a comment at the top of the overlay listing. Links Back to Personal Wiki |