Installing Git on Railsmachine (CentOS 4.4)

Posted by jeff

[updated 03/09/2008]

[updated 03/21/2008 for Git 1.5.4.4]

[you can also follow the RailsMachine wiki instructions ]

Keeping up with the Joneses

A few days ago I read that mephisto 0.8 was released and that all of the cool kids were grabbing it from the git repository. I promptly got hip to git from John Nunemaker’s post on git and github and grabbed the peepcode screencast to get started.

A few minutes later I was ready to deploy to my Rails Machine slice running CentOS 4.4.

Not so yummy

I dig package managers, and since git is really a collection of a few dozen executables it’s the perfect candidate. So I naively typed

1
yum install git

thinking that it might “just work”, but instead it completely blew up on me with errors such as:

1
2
Error: Missing Dependency: libaprutil-0.so.0 is needed by package subversion
Error: Missing Dependency: libapr-0.so.0 is needed by package subversion

After a few support emails with Rails Machine, it seemed like there might be some discrepancies with the rpms from the RailsMachine repo and the rpmforge repo. Not being familiar with yum, I had no idea what to do (and still don’t), so I abandoned yum altogether.

Consider the source

Thanks to Rob over at Rails Machine and cactus over at the slicehost forum I got git installed from source on the slice. Here’s what worked for me:

Follow the instructions from Dan Insley and setup the following repositories:

to follow the steps below and git will be installed in a snap:

$ sudo touch /etc/yum.repos.d/atrpms.repo /etc/yum.repos.d/dag.repo
[atrpms]
name=ATrpms for Enterprise Linux $releasever - $basearch
baseurl=http://dl.atrpms.net/el$releasever-$basearch/atrpms/stable
enabled=0
gpgcheck=1
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
[dag]
name=Dag
enabled=0
baseurl=http://dag.freshrpms.net/redhat/el4/en/$basearch/dag
http://ftp.heanet.ie/pub/freshrpms/pub/dag/redhat/el4/en/i386/dag/
gpgcheck=1
gpgkey=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
1
2
3
4
5
6
7
8
9
10
sudo yum --enablerepo=dag --enablerepo=atrpms install asciidoc xmlto curl curl-devel
mkdir -p ~/sources
cd ~/sources
wget http://kernel.org/pub/software/scm/git/git-1.5.4.4.tar.gz
tar xvzf git-1.5.4.4.tar.gz
cd git-1.5.4.4
make configure
./configure --prefix=/usr/local
NO_TCLTK=yes make all doc
NO_TCLTK=yes sudo make install install-doc

You can also save yourself some time if you don’t need the docs by changing those last 2 lines to:

NO_TCLTK=yes make all
NO_TCLTK=yes sudo make install

Depending on your setup, the “NO_TCLTK=yes” flag might not be necessary. You can always try it without first if you are unsure, but I’ve needed it on all of my RailsMachine slices.

References