Compiling subversion 1.5.1 on OS X 10.5.4

I've just tried to compile the subversion 1.5.1 client from its two source tarballs (subversion-1.5.1-tar.bz2 and subversion-deps-1.5.1-tar.bz2). I took care to first hide the /usr/local libraries from my existing subversion installation. Even so, the compilation failed, complaining

/usr/lib/libexpat.a: No such file or directory

The workaround was to temporarily move the system's /usr/lib/libexpat* dynamic libraries, and then to rebuild.

Here's the build script which worked for me:

set -e
rm -rf subversion-${VERSION}
tar xjf subversion-${VERSION}.tar.bz2
tar xjf subversion-deps-${VERSION}.tar.bz2
cd subversion-${VERSION}
./configure --without-apxs --with-ssl 
sudo make install
sudo make install-swig-py