Subversion Installation

WAIT!!!. As of mid-2007, DreamHost has a pretty recent Subversion installed by default on hosts. See Subversion to see how to use it if that suits you. The instructions there are much simpler, and, unlike these ones, they are to some extent supported by DreamHost.

The Subversion Installation guide walks you through the instructions to install Subversion with and without Python bindings. Python bindings aren't required unless you are using Subversion with a package that requires it. You can follow the instructions to install the bindings for Ruby or Perl also if you replace several commands.

= From Source =

You may want to install your own subversion if you need something that the DreamHost pre-installed version doesn't provide (e.g. Python bindings). However, you can't access your manually created repositories via web.

A compromise would be to locally install the same version as the one provided by DreamHost and to use the DreamHost Panel to create the repository. You can then access the repository with your local tools and it should also be available via web.

Prerequisites

 * Requires Environment Setup or Unix account setup to install correctly.


 * If you want to use Python bindings, install Python and SWIG locally.


 * If you want to use Ruby bindings, install Ruby locally.

Choose your subversion version
In order to be able to use your own compiled subversion with repositories created with the DreamHost Panel, you should choose the same version as the one installed in your host: SVNVERSION=`/usr/bin/svn --version --quiet` Alternatively, choose the version you like... the latest as of August 2007 is 1.4.5: SVNVERSION=1.4.5 but, be warned that you may run into problems if you use an  to modify a repository created with the DreamHost Panel.

Downloading
Download both subversion and subversion-deps in the same directory so that the  in subversion finds and builds the dependencies automatically. mkdir -pv ${HOME}/soft cd ${HOME}/soft wget http://subversion.tigris.org/downloads/subversion-${SVNVERSION}.tar.gz wget http://subversion.tigris.org/downloads/subversion-deps-${SVNVERSION}.tar.gz tar xzvf subversion-${SVNVERSION}.tar.gz tar xzvf subversion-deps-${SVNVERSION}.tar.gz cd subversion-${SVNVERSION}

Choose an installation destination
If you use the Unix account setup you have already a  environment variable set up (in .bashrc) and you install everything there.

If you install packages directly in your home directory, then type: export RUN=${HOME}

If you install packages in other directory of your choice (e.g.  directly under your home directory - ), then type: export RUN=${HOME}/packages (replace packages above by the directory name you want).

If you have installed your own version of Python, create an environment variable to hold the version number and another to hold the directory where packages are installed: export PYVERS=`${RUN}/bin/python -V 2>&1 | cut -d ' ' -f 2` export PYLIBPKG=`${RUN}/bin/python <<EOF import sys print sys.path[-1] EOF`
 * 1) ${PYVERS} Python version
 * 1) ${PYLIBPKG} Python library site packages directory

Configure
Make sure that the versions you installed of Python, SWIG and Ruby (if you have them) are found in your ${PATH} before the DreamHost supplied versions (if you have installed them following the Environment Setup or Unix account setup then, they probably are OK).

Local SWIG
If you have compiled SWIG locally, set the following: SVNSWIG=" --with-swig=${RUN}/bin/swig"

Python bindings
If you want Python bindings (with your locally compiled Python), set the following SVNPYTHON=" PYTHON=${RUN}/bin/python"

Ruby bindings
If you want Ruby bindings (with your locally compiled Ruby), set the following SVNRUBY=" RUBY=${RUN}/bin/ruby"

Run the configuration script
./configure ${SVNPYTHON} ${SVNRUBY} --prefix=${RUN} \ --without-berkeley-db --with-ssl --enable-shared \ ${SVNSWIG}

Compile and Install
make make install

Python Bindings
If you need to install the python bindings then do the following steps after you installed Subversion.

make swig-py make install-swig-py echo ${RUN}/lib/svn-python > ${PYLIBPKG}/subversion.pth
 * 1) tell your Python where to find the subversion bindings

Test Subversion and Python bindings before you continue.
 * If it returns "Module SVN not found", then you need to redo the SWIG and Subversion install until it returns successfully.

${RUN}/bin/python -c "from svn import client"

Ruby Bindings
The following instructions worked with a custom Ruby installation, gem installation and $GEM_HOME. But it should work with the standard install as well. Swig was already installed on my server. When installing subversion swig and ruby were found automatically.

make swig-rb make install-swig-rb

Perl Bindings
make swig-pl-lib make install-swig-pl-lib pushd subversion/bindings/swig/perl/native perl Makefile.PL PREFIX=${RUN} make install popd

Troubleshooting
If when you try to use the make commands you get some warnings with .so files, you can try the following

cd ${RUN}/lib/python2.3/site-packages mv libsvn libsvn.b0rk ln -s /usr/lib/python2.3/site-packages/libsvn ln -s /usr/lib/python2.3/site-packages/svn

= Precompiled Binary =

Static builds of the Subversion software are available for Linux and can be installed in your home directory.

Go back to your home directory cd $HOME

Download the latest subversion-VERSION-linux-x86.tar.gz. Replace VERSION with the version you want. wget http://www.uncc.org/svntools/clients/linux/subversion-VERSION-linux-x86.tar.gz

Untar the package. Replace VERSION with the version you downloaded. tar -xzvf subversion-VERSION-linux-x86.tar.gz

This will create a bin/ directory (if you don't already have it) and place the svn, svnadmin, svnserve, etc. binaries there.

=See Also=

Subversion