by ed0t - Published: April 21st, 2008

Since we wanted to install Trac on our DreamHost domain we have followed the Natmaster tutorial. Anyway we came in trouble so here we describe how we have installed Trac. The proceeding is quite similar to Natmaster one, but we found some missing pieces that we describe below.

Here is the list of programs that we have installed:

  • virtual-python
  • Trac 0.10.4
  • Clearsilver 0.10.3
  • SQLite 3.5.2
  • PySqlite 2.3.5
  • Swig 1.3.31

If you have already tried to install Trac remove all installed programs in your directory (ex: packages) and remove the other files created (ex: .pydistutils.cfg) or paths setted in .bash_profile or .bash_rc.

Let’s start with a new installation!

First of all we have to create in our Home folder three directories

  • packages: the directory where we will install all programs
  • install_files: the directory in which we put downloaded tarballs
  • trac_sites: the directory where we put all Trac environments

so:

mkdir packages
mkdir install_files
mkdir trac_sites

Install Virtual-Python

If you are on a Linux, BSD, Cygwin, or other similar Unix-like operating system, but don’t have root access, you can create your own “virtual” Python installation, which uses its own library directories and some symlinks to the site-wide Python.

  • cd ~/install_files
  • wget http://peak.telecommunity.com/dist/virtual-python.py
  • python virtualpython.py –prefix=$HOME/packages

Install Trac

  • cd ~/install_files
  • wget http://ftp.edgewall.com/pub/trac/trac-0.10.4.tar.gz
  • tar zxvf trac-0.10.4.tar.gz
  • cd trac-0.10.4
  • python setup.py install –prefix=$HOME/packages

Install ClearSilver

  • cd ~/install_files
  • wget http://www.clearsilver.net/downloads/clearsilver-0.10.3.tar.gz
  • tar zxvf clearsilver-0.10.3.tar.gz
  • cd clearsilver-0.10.3
  • PYTHON_SITE=`~/packages/bin/python -c \
    “import sys; print [path for path in sys.path if path.find('site-packages') != -1][0]“` ./configure –with-python=~/packages/bin/python –prefix=$HOME/packages –disable-ruby –disable-java –disable-apache –disable-csharp –disable-perl
  • make
  • make install

Install SQLite

  • cd ~/install_files
  • wget http://www.sqlite.org/sqlite-3.5.2.tar.gz
  • tar zxvf sqlite-3.5.2.tar.gz
  • cd sqlite-3.5.2
  • ./configure –prefix=$HOME/packages
  • make
  • make install
  • ln -s $HOME/packages/bin/sqlite3 $HOME/packages/bin/sqlite

Install PySQLite

  • unlink $HOME/packages/lib/python2.3/site-packages/pysqlite2
  • cd ~/install_files
  • wget http://initd.org/pub/software/pysqlite/releases/2.3/2.3.5/pysqlite-2.3.5.tar.gz
  • tar zxvf pysqlite-2.3.5.tar.gz
  • cd pysqlite-2.3.5
  • python setup.py install –prefix=$HOME/packages

The first command is an unlink. This is needed because pysqlite is already installed on DreamHost. But with the default pysqlite the trac-admin command fails.

Install SWIG

  • cd ~/install_files
  • wget http://dl.sourceforge.net/sourceforge/swig/swig-1.3.31.tar.gz
  • tar zxvf swig-1.3.31.tar.gz
  • cd swig-1.3.31
  • ./configure –prefix=$HOME/packages/ –with-python=/$HOME/packages/bin/python
  • make
  • make install

Now we have to create a new Trac environment, but before we have to edit the .bash_profile and add this rows:

export PYTHONPATH="$HOME/packages/lib/python2.3/site-packages"
export LD_LIBRARY_PATH="$HOME/packages/lib"
export PATH="$HOME/packages/bin:$PATH"

then reload the .bash_profile:

source .bash_profile

To create a Trac environment use this command:

trac-admin $HOME/trac_sites/PROJECTNAME initenv

as you can see trac_sites folder is the third directory that we have created above. Here we store all projects. The trac-admin command asks you some questions and we it is ended a new Trac environment is set up!

Now follow the Natmaster tutorial beginning at “Make Trac Web Accessible” section.

Comments: 1 Comment - Category: howto

Rss Comments

1 Comment

  1. [...] assume you have installed Trac on your local server, or on your Dreamhost account. To enable communication between Trac and Mylyn we have to install and enable the XmlRpcPlugin that [...]

    1. DevOnLinux | Use Eclipse with Mylyn and Trac via TracXMLRPC

Leave a Comment