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

   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

    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 apr
    cd apr
    cd ..
    svn co apr-util
    cd apr-util
    cd ..

5) Build subversion

    ./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!!!



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