Edgewall Software

Version 7 (modified by anonymous, 15 years ago) ( diff )

Fix link for swig-1.3.31

Building Trac on OS X from Sources

Here are some revised instructions on building trac 0.10.3 (including subversion 1.4.3 and some of the required dependencies) on Mac OS X (10.4.8 is the system I ran this on).

This does not build Python, Apache or SQL Lite as these are already pre-installed in the Mac OS and work just fine.

Copy the below code snippet as a shell script, and it should all run in one big hit. You'll need to sit and enter your admin password for the commands prefixed with 'sudo'. Alternatively you could sudo the execution of the whole script. (I prefer to not have the root user doing downloads and compilations).

Special note: most of these components are the latest at the time of writing this page and work fine. Except for neon. Subversion has a problem with the latest version of neon, so stick with neon 0.25.5 until you know that Subversion will work with something newer.

Here it is:


#!/bin/sh
#
#	installing trac on mac os x
#
#	including subversion, and other needed components
#


# first clean out any of the old stuff.
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*


# make a new directory to download all the source into
cd
mkdir source
cd source

# download the source tarballs
curl http://apache.mirror.pacific.net.au/apr/apr-util-0.9.13.tar.gz > apr-util-0.9.13.tar.gz
curl http://apache.mirror.pacific.net.au/apr/apr-0.9.13.tar.gz > apr-0.9.13.tar.gz
curl http://subversion.tigris.org/downloads/subversion-1.4.3.tar.gz > subversion-1.4.3.tar.gz
curl http://dfn.dl.sourceforge.net/sourceforge/swig/swig-1.3.31.tar.gz > swig-1.3.31.tar.gz
curl http://www.webdav.org/neon/neon-0.25.5.tar.gz > neon-0.25.5.tar.gz
curl http://www.clearsilver.net/downloads/clearsilver-0.9.14.tar.gz > clearsilver-0.9.14.tar.gz
curl http://optusnet.dl.sourceforge.net/sourceforge/docutils/docutils-0.4.tar.gz > docutils-0.4.tar.gz
curl http://initd.org/pub/software/pysqlite/releases/2.3/2.3.3/pysqlite-2.3.3.tar.gz > pysqlite-2.3.3.tar.gz
curl http://ftp.edgewall.com/pub/trac/trac-0.10.3.tar.gz > trac-0.10.3.tar.gz

# expand them
tar -zxf apr-util-0.9.13.tar.gz
tar -zxf apr-0.9.13.tar.gz
tar -zxf subversion-1.4.3.tar.gz
tar -zxf swig-1.3.31.tar.gz
tar -zxf neon-0.25.5.tar.gz
tar -zxf clearsilver-0.9.14.tar.gz
tar -zxf docutils-0.4.tar.gz
tar -zxf pysqlite-2.3.3.tar.gz
tar -zxf trac-0.10.3.tar.gz


# make 'apr'
cd apr-0.9.13
./configure
make
sudo make install

cd ..


# make 'apr-util'

cd apr-util-0.9.13
./configure --with-apr=/usr/local/apr
sudo make
sudo make install

cd ..



# make 'neon'

cd neon-0.25.5
./configure --with-ssl
make
sudo make install

cd ..



# make 'swig'

cd swig-1.3.31
./configure --with-python=/usr/bin/python
make
sudo make install

cd ..



# make 'subverion'

cd subversion-1.4.3
./configure --with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr \
--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
make
sudo make install

make swig-py
sudo make install-swig-py
echo /usr/local/lib/svn-python > /Library/Python/2.3/site-packages/svn-python.pth

cd ..



# make 'clearsilver'

cd clearsilver-0.9.14
# ruby is disabled here. you may wish to disable other parts of clearsilver
# type "./configure --help" for more info.
./configure --prefix=/usr/local --with-python=/usr/bin/python --disable-ruby
make
# this is a hack to fix the files that want to run '/usr/local/bin/python'
# when it should just be '/usr/bin/python' as per the configure line above
if [ -f /usr/bin/python -a ! -e /usr/local/bin/python ]; 
then
	sudo ln -s /usr/bin/python /usr/local/bin/python
fi
sudo make install

cd ..



# make 'docutils'

cd docutils-0.4
sudo python setup.py install

cd ..


# make 'pysqlite'
cd pysqlite-2.3.3
sudo python setup.py install

cd ..


# and now for the finale!!!
# making 'trac'

cd trac-0.10.3
sudo ./setup.py install

# make these available in '/usr/local/bin/'
# this assumes that '/usr/local/bin/' is in the user's path to run tracd / trac-admin
sudo ln -s /System/Library/Frameworks/Python.framework/Versions/Current/bin/trac* /usr/local/bin

Contact the author of this page: Matt Connolly at matt-at-soundevolution.com.au for updates/comments.

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.