= Installing Trac on Mac OS X, without Fink = 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 [http://fink.sf.net/ 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 [http://svn.collab.net/repos/svn/trunk/notes/fsfs 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@ruggier.org'' about it. You should allow yourself a good hour of time 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, inconistent, or just contradictory documentation that is currently available! == Requirements == * Apache 1.3, the one that bundled with OS X 10.3 * [http://www.python.org/ Python], use the stock python 2.3 that comes with your OS X 10.3 system (in {{{/usr/bin/python}}}) * [http://www.webdav.org/neon/ neon], version >= 0.24.7 * [http://www.swig.org/ swig], version 1.3.21, and '''not''' 1.3.24 !! * [http://subversion.tigris.org/ Subversion], >= 1.1.3 * [http://www.sqlite.org/ SQLite], version >= 3.0.8 * [http://pysqlite.org/ PySQLite], version >= 1.1.6 * [http://clearsilver.net/ Clearsilver], version >= 0.9.13 * [http://docutils.sourceforge.net/ docutils], version >= 0.3.7 * [http://projects.edgewall.com/trac/ trac], version >= 0.8 == Preliminaries == === 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}}}. === clean-up === '''Note:''' you may prefer to do this clean-up step only if a first installation process fails. Clean out any previosly installed libs and executables prior to doing the installation process. The files to remove (or renamed) 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 -r /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. === neon === 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. See this [http://subversion.tigris.org/servlets/ReadMsg?list=users&msgNo=26484 note on the svn users list] as to why we may want to install neon separately. * Get source tarball from (http://www.webdav.org/neon/) {{{ cd ./configure make sudo make install }}} === swig === The latest version of swig (1.3.24) will '''not''' work! You need version 1.3.21, as stated in this [http://subversion.tigris.org/servlets/ReadMsg?list=users&msgNo=26451 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 from (http://www.swig.org/) * See the generalized [http://svn.collab.net/repos/svn/trunk/subversion/bindings/swig/INSTALL INSTALL] procedure, from which highlights are extracted below: {{{ cd ./configure --with-python=/usr/bin/python make make runtime sudo make install sudo make install-runtime }}} === subversion === * Get source tarball from (http://subversion.tigris.org/) {{{ cd ./configure --without-berkeley-db --enable-swig-bindings=python PYTHON=/usr/bin/python make sudo make install }}} === swig svn python bindings === {{{ cd make swig-py sudo make install-swig-py echo /usr/local/lib/svn-python > /Library/Python/2.3/svn-python.pth }}} === sqlite, pysqlite === * Get sqlite source tarball from (http://www.sqlite.org/) and pysqlite source tarball from (http://pysqlite.org/) * Follow their respectives installation instructions. === clearsilver === * Get source tarball from (http://www.clearsilver.net/) * Installation procedure slightly different from those given by TracOnOsx {{{ cd ./configure --prefix=/usr/local --with-python=/usr/bin/python --disable-ruby make # >>> here modify first line of scripts/document.py to use same python sudo make install }}} === docutils === * Get source tarball from (http://docutils.sourceforge.net/). * Standard distutils installation. === trac === * Standard distutils installation * Will put executables and shared files in: {{{ /System/Library/Frameworks/Python.framework/Versions/2.3/bin/trac* /System/Library/Frameworks/Python.framework/Versions/2.3/share/trac/* }}} For setting up access from Apache, see TracInstall, TracOnOsx, TracMultipleProjects. == Creating a trac environment == First decide the locations for your subversion repository, e.g. {{{/var/svn/test}}}, and 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 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 {{{web}}} user should be one of these. If you need a nice description of how to do this, look at the [http://developer.apple.com/internet/opensource/cvsoverview.html Apple CVSOverview] (then search for the text ""to create a group"). 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. ''mario@ruggier.org'' ---- See also: TracGuide, TracInstall, TracOnOsx, TracInstallPlatforms,