Installing git and git-svn from source

Getting git-svn installed without root privileges is truly epic, given there are virtually no installation instructions for it, and its homepage seems to be down. This doesn't bode well for git-svn adoption in managed environments like mine where users don't have root. In fairness, the hard bit is Subversion and its perl bindings, but those do need to be current, and the commonly available advice to install Alien::SVN using cpan is totally broken for non-root installs. I hope that the git-svn guys can simplify this down the road...

So, I thought I'd share my solution here to save others the trouble...

###Don't use cpan to install Alien::SVN -- it should have made this whole thing really easy, but it has a number of known bugs when installing without root.###

Here's what worked for me. I have a folder ~/usr for my usual user-local installs, that's already been set up with the usual environment variables in my .bashrc:

   export PATH=~/usr/bin:$PATH
   export LD_LIBRARY_PATH=~/usr/lib:$LD_LIBRARY_PATH
   export PKG_CONFIG_PATH=~/usr/lib/pkgconfig:$PKG_CONFIG_PATH

1) Download and install openssl from www.openssl.org/source

   tar zvxf openssl-0.9.8i.tar.gz
   cd openssl-0.9.8i
   ./configure --prefix=/home/mdroe/usr
   make -j
   make install

2) Download subversion tarball

   cd ..
   tar jxvf subversion-1.5.4.tar.bz2
   cd subversion-1.5.4

3) Download neon inside the subversion source tree, and configure

    wget http://www.webdav.org/neon/neon-0.27.2.tar.gz
    tar zvxf neon-0.27.2.tar.gz
    mv neon-0.27.2 neon
    cd neon
    ./configure --prefix=/home/mdroe/usr --without-gssapi --with-ssl=openssl

4) Get apr and apr-util, and configure

    svn co http://svn.apache.org/repos/asf/apr/apr/branches/0.9.x apr
    cd apr
    ./buildconf
    cd ..
    svn co http://svn.apache.org/repos/asf/apr/apr-util/branches/0.9.x apr-util
    cd apr-util
    ./buildconf
    cd ..

5) Build subversion

    ./autogen.sh
    ./configure --prefix=/home/mdroe/usr --with-ssl --enable-shared
    make -j
    make install

6) Build perl bindings

    make swig-pl
    make swig-pl-lib
    make install-swig-pl-lib
    cd subversion/bindings/swig/perl/native
    perl Makefile.PL PREFIX=/home/mdroe/usr
    make install
    cd ../../../../../..

7) Download, build and install git

   tar zvxf get-1.6.0.tar.gz
   cd git-1.6.0
   ./configure --prefix=/home/mdroe/usr
   make install

... follow Andrew Straw's git instructions ... (???) ... profit!!!

Mike

···

--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA