Edgewall Software

Version 29 (modified by 2wav, 15 years ago) ( diff )

clearsilver 0.10.5 for OS-X Server 10.4.10

Installing Trac on Mac OS X, without Fink or MacPorts

I have found that trying to install Trac and all its dependencies, notably subversion and the swig bindings, on OS X 10.3 without using Fink, to be surprisingly difficult and full of gotchas. With some perseverance, and considerable help from kind folks on the trac and subversion users lists, I have succeeded. In the hope that this may help others, I am documenting here what has worked for me.

This procedure intentionally specifies that subversion be installed without Berkeley DB, thus svn repositories will be only FSFS, as per current recommendation.

The details here are quite tightly bound to the specific version of each package installed, and therefore are likely to change quickly. Please take this into account, and do not follow them blindly! Also, if you discover any incorrectness, or obsoleteness, please be so kind as to either update this document yourself, or just contact me on mario@… about it.

You should allow yourself a comfortable hour or so for this installation procedure… and that is real quick and easy when compared to the few days of frustration I spent figuring out why things were not working, due to incomplete, inconsistent, or just contradictory documentation that is currently available!


  • Apache 1.3, the one bundled with OS X 10.3
  • Python, use the stock python 2.3 that comes with your OS X 10.3 system (in /usr/bin/python)
  • neon, version 0.25.x (0.25.3 is OK)
  • swig, version = 1.3.21, and not 1.3.24 !!
  • Subversion, version 1.x.x (1.2.3 is OK) (1.4 not recommended with XCode ⇐ 2.4 see below)
  • SQLite, version 3.x.x (3.2.5 is OK)
  • PySQLite, version 1.1.6, and not 2.0 and up
  • Clearsilver, version 0.9.14, and not 0.10.1
  • docutils, version 0.3.x (0.3.9 is OK)
  • trac, version 0.8.x

Andrew Durdin says: I'm using OS X 10.4, and successfully installed trac with the following library versions (somewhat contrary to the notes above):

Apache1.3.33 (as installed with OS X 10.4
Python2.3.5 (as installed with OS X 10.4
Subversion1.3.1 (source tar includes neon and APR)

"Paul Yu says:" I'm using OS X 10.4.7 Server, and successfully install trac with the following library versions:

Apache1.3.33 (as installed with OS X 10.4)
Python2.3.5 (as installed with OS X 10.4)
Subversion1.3.2 (source tar includes neon and APR)
docutilsLatest snapshot (8/17/2006)

I did have to mv /usr/lib/libsqlite3.0.dylib and /usr/lib/sqlite3 (directory) to *.old. This overcame a problem with the PySQLite installation and test. see this link. http://lists.initd.org/pipermail/pysqlite/2006-April/000484.html

"(2007-07-23) Nico C says:" Successfully installed on OS X 10.4.10 (Xcode 2.4.1 installed) with these versions:

Apache1.3.33 (as installed with OS X 10.4)
Python2.3.5 (as installed with OS X 10.4)
Subversion1.4.4 (don't forget to install 'subversion-deps' wich includes neon and APR)

I'm running Trac with the supplied tracd server because CGI is realy too slow and the Apache installed by Apple doesn't include mod_python.


no fink

Preferably you do not have fink in your environment, to avoid that the various configure scripts pick up libraries to link to from under fink. So, make sure that your env path does not include any /sw dirs, and that the file /sw/bin/init.sh is not being executed from anywhere in your .profile.

tar over zip

When downloading the various packages, and have the choice between zip or tar source archives, prefer the tar distributions as zip has sometimes given carriage return problems, resulting in bizarre errors later on.


Note: you may prefer to do this clean-up step only if a first installation attempt fails.

Clean out any previously installed libs and executables prior to doing the installation process. The files to remove (or rename) are:

sudo rm -rf /usr/local/apr
sudo rm -f /usr/local/lib/libneon*
sudo rm -f /usr/local/lib/libsvn*
sudo rm -f /usr/local/lib/pkgconfig/neon.pc
sudo rm -f /usr/local/bin/swig 
sudo rm -f /usr/local/bin/neon-config
sudo rm -f /usr/local/bin/svn*
sudo rm -rf /usr/local/bin/subversion-1

Plus, if you happen to have any previous installations of the swig svn python bindings in your site packages, then remove (or rename) them:

sudo rm -rf /Library/Python/2.3/libsvn
sudo rm -rf /Library/Python/2.3/svn

Installing the Packages

I will only describe the essentials that are particular to OS X, and to installing without Fink. Please substitute any steps not detailed here with their generic equivalents in TracInstall.


In theory you should not need to install this separately, but doing so may avoid some confusing warnings when installing subversion, due to missing entry for darwin in the neon configure script (the neon currently bundled with subversion). See this note on the svn users list as to why we may want to install neon separately.

  • Get latest source tarball from (http://www.webdav.org/neon/)
    cd <neon-distribution-top-dir>
    ./configure --with-ssl 
    sudo make install
  • For OS 10.4, if it doesn't install try commenting out NE_HAVE_I18N and HAVE_TIMEZONE in config.h


The latest version of swig (1.3.24) will not work! You need version 1.3.21, as stated in this message on the svn users list: "subversion 1.1.x currently REQUIRES swig ≥ 1.3.19 and ⇐ 1.3.21. Swig1.3.24 is _not_ supported."

  • Get source tarball for 1.3.21 from (http://www.swig.org/)
  • See the generalized INSTALL procedure, from which highlights are extracted below:
    cd <swig-distribution-top-dir>
    ./configure --with-python=/usr/bin/python
    make runtime
    sudo make install
    sudo make install-runtime


Get latest source tarball from (http://subversion.tigris.org/). Note that you may get a prepared package for subversion from (http://www.codingmonkeys.de/mbo/), thanks to Martin Ott. You probably will anyhow still need the tarball above though for compiling the python bindings. Note: The Ott package does not have everything that is needed to work with trac, so it is better to just follow the make install instructions below. I was able to install Ott's package and then make install from the source with no ill effects.

For 10.3:

cd <subversion-distribution-top-dir>
./configure --with-zlib --with-ssl --with-neon=/usr/local --without-berkeley-db --enable-swig-bindings=python --with-swig=/usr/local/bin/swig PYTHON=/usr/bin/python
sudo make install

For Mac OS X 10.4, the following works:

cd <subversion-distribution-top-dir>
GXX=yes ./configure --without-berkeley-db --enable-swig-bindings=python --with-swig=/usr/local/bin/swig PYTHON=/usr/bin/python PYTHON2=/usr/bin/python2.3
sudo make install

NOTE: make sure you download the tar archive as the zip (for subversion 1.2.3) gave problems with carraige returns, specifically in the file ac-helpers/install-sh. You should see something like the output below (no bizarre chars) when you do:

$ grep -n ^# ac-helpers/* | grep ':1:' | grep /bin/sh | cat -vte
ac-helpers/config.guess:1:#! /bin/sh$
ac-helpers/config.sub:1:#! /bin/sh$

COMPATIBILITY: Subversion 1.4 has changed the format of the .svn/entries files in a way that XCode version ⇐ 2.4 does not understand. Your options are as follows:

swig svn python bindings

For 10.3 do:

cd <subversion-distribution-top-dir>
make swig-py
sudo make install-swig-py
echo /usr/local/lib/svn-python > /Library/Python/2.3/svn-python.pth

For 10.4 do:

cd <subversion-distribution-top-dir>
make swig-py
sudo make install-swig-py
echo /usr/local/lib/svn-python > /Library/Python/2.3/site-packages/svn-python.pth

sqlite, pysqlite

  • Get sqlite latest source tarball from (http://www.sqlite.org/) and pysqlite latest source tarball from (http://pysqlite.org/)
  • Follow their respectives installation instructions.
  • NOTE (sqlite): The sqlite OS X install instructions that I found said to configure with the '—disable-shared' option, claiming that OS X's libtool is busted and thus generates bad dynamic/shared libraries. However, disabling shared libraries generated an error during the make install step, because one of the install scripts looks for a shared library (identified by extension .dylib) regardless of the configure options. So, in good UNIX fashion, I ignored the instructions and tried it with the shared libraries. I did a 'make test' and all the regression tests passed, so it seems that the problem with libtool has been fixed and '—disable-shared' is no longer necessary.
  • NOTE (pysqlite): The build step ('python setup.py build') failed with a "No such file or directory" error on "/opt/local/lib". I opened up setup.py and found that for OS X (and only OS X), it sets the lib path to /opt/local/lib. On my system, this was wrong, so I changed it to /usr/local/lib.
  • NOTE (pysqlite): Just to clear up any confusion regarding API versions - and this probably only applies if you're going to use SQLite 3, either installed by hand or as shipped with OS X 10.4 - PySQLite v2.0x will not work with Trac (as of 0.9-pre). Instead, get the latest stable 1.1.x (1.1.6 as of this writing) version. DO NOT install PySQLite 2.x as it is a new version that will not work with Trac.


  • Get the 0.9.14 (not the latest) tarball from (http://www.clearsilver.net/)
  • Installation procedure slightly different from those given by TracOnOsx
    cd <clearsilver-distribution-top-dir>
    ./configure --prefix=/usr/local --with-python=/usr/bin/python --disable-ruby
    # >>> here modify first line of scripts/document.py to use same python 
    sudo make install 

2007-11-06 Andy W says: I have been using clearsilver 0.10.4 successfully on OS-X 10.4 installations. But On OS-X Server 10.4.10 (i386), clearsilver 0.10.4 could not build neo_cgi.so. Clearsilver 0.10.5 built and installed neo_cgi.so, but put it in a funky directory /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/site-packages (note the double site-packages). When I moved the library to just python2.3/site-packages, it worked.



  • Standard distutils installation
  • Will put executables and shared files in:

For setting up access from Apache, see TracInstall, TracOnOsx, TracMultipleProjects.

Creating a trac environment

First choose a location for your subversion repository, e.g. /var/svn/test, and one for you trac environment, e.g. /var/trac/test.

svn repository

Specifying fs-type is actually not necessary, as we have built without bdb, thus making fsfs the default backend file system.

svnadmin create --fs-type=fsfs /var/svn/test

To make sure the repository is ok, play with it a little:

cd /tmp
mkdir proj
cd proj
mkdir trunk branches tags
cd ..
svn import proj file:///var/svn/test -m "Import First"
rm -r proj
svn co file:///var/svn/test proj
cd proj
svn update 

trac environment

trac-admin /var/trac/test initenv

You may need to manage access rights on the trac env directory tree. This may be done by first creating a unix group dedicated to this trac project, e.g. trac, and assigning the various users to this group. The apache www user should be one of these. If you need a nice description of how to do this, look at the Apple CVSOverview (then search for the text "create a new group" or "NetInfo Manager").

Your trac-admin binary may not be in your search path - if trac-admin isn't found, try:

cd /System/Library/Frameworks/Python.framework/Versions/Current/bin
sudo ln -s tracd trac-admin /usr/local/bin

to create links to them in /usr/local/bin.

To apply chgrp and chmod recursively, you may do:

cd /var/trac/test
find . -name "*" -exec chgrp trac {} \; -ls
find . -name "*" -exec chmod g+sw {} \; -ls

For further trac configuration, see TracGuide.


See also: TracGuide, TracInstall, TracOnOsx, TracInstallPlatforms

Note: See TracWiki for help on using the wiki.