Building Git on Red Hat-based systems

Posted on October 7th, 2009 by David Luhman and tagged .

I had a case where I had to build Git on an older Red Hat based system. Unfortunately, the system was so old that yum wasn't really supported. So I had to install the needed libraries (RPMs) "by hand" via rpm -i. There was one package that I had to update via rpm -U.

On my rather bare system, I found I had to install the following RPMs to get Git to compile :

cpp
curl
curl-devel
e2fsprogs-devel
gcc
glibc-devel
glibc-headers
glibc-kernheaders
krb5-devel
krb5-libs
make
openssl
openssl-devel
wget
zlib-devel

The above two curl libraries are not required if you don't need curl. Without curl you have no git-http-pull/push and no http nor https transports. I also didn't want to install the libraries for Tcl/TK. This means no GUI tools, but using things like vimdiff should suffice.

Based on the libraries we chose to omit, edit the Makefile to ignore these two dependencies :

NO_TCLTK=true

...
STRIP ?= strip

#DKL - Add this line
NO_CURL = true

# Among the variables below, these:
...

Here's the actual build procedure :


# cd /tmp
# mkdir gitSrc
# cd gitSrc
# wget http://git-core.googlecode.com/files/git-1.7.6.3.tar.gz
# gunzip 1.7.6.3.tar.gz
# tar -xvf 1.7.6.3.tar
# cd git-1.7.6.3
# vi Makefile    (make above edits)
# make           (just try to make and ensure all libraries are there)
# make clean     (start over)
# make prefix=/usr install           (
# which git
/usr/bin/git
# git --version
git version 1.7.6.3

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options