Compiling subversion from source on Bluehost

I recently had to install the subversion client in a shared hosting environment (specifically Bluehost, but these instructions probably work with other web hosts as well). It goes like this:

1) Add these lines into ~/.bash_profile

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

2) Download the subversion source code

mkdir ~/src
cd ~/src
wget http://subversion.tigris.org/downloads/subversion-1.4.6.tar.gz
wget http://subversion.tigris.org/downloads/subversion-deps-1.4.6.tar.gz
tar -xzvf subversion-1.4.6.tar.gz
tar -xzvf subversion-deps-1.4.6.tar.gz
cd subversion-1.4.6

3) Compile dependencies

cd apr
./configure --enable-shared --prefix=$HOME
make && make install

cd ../apr-util
./configure --enable-shared --prefix=$HOME --with-expat=builtin --with-apr=$HOME --without-berlekey-db
make && make install

cd ../neon
EXTRA_CFLAGS="-L/usr/lib64 -fPIC"
CFLAGS="-L/usr/lib64 -fPIC"
./configure --prefix=/home/zzzzz/system --enable-shared --with-ssl
make && make install

Note: replace zzzzz with your user directory.

4) Compile subversion

cd ..
./configure --prefix=/home/zzzzz/system --with-expat=builtin --with-ssl --with-neon=/usr/lib64
make && make install

Note: replace zzzzz with your user directory.

5) Edit ~/.bash_profile to add ~/system/bin to your path

vim ~/.bash_profile

replace:

PATH=$PATH:$HOME/bin

with:

PATH=$PATH:$HOME/bin:$HOME/system/bin

6) Logout of your session and then log back in again. Subversion should now be working.

Written on January 27, 2010