Installing Git, Curl, and Expat from Source

The install path is easy enough to find. Most configure scripts are pretty standard, and the usually have a -h flag that prints a help message. Have a look at git's:

$ ./configure -h | grep -A 2 Insta
Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]

So, you installed curl using --prefix=/home/downloads/curl and it was detected by git with --with-curl=/home/downloads/curl. Therefore, if you had installed to the default locations, you would have run --with-curl=/usr/local/.

As for other possible problems, no idea. You'll cross that bridge when you get to it.


On a more general note, I recommend you try searching for RPM packages before installing from source. You don't need yum to install RPM packages, you can simply do:

rpm -i rpmfile.rpm

I found RHEL 6 RPMs for git and curl on rpm.pbone.net. Couldn't find a RHEL 6 one for expat but there were various for Fedora and CentOS, one of them would probably work for you too.


I think I would suggest not installing these items from source directly but rather harness the power of your package manager to still maintain these packages.

locally installing

You can use a command line tool such as curl or wget to still download the packages necessary to install them either using yum or rpm directly.

$ sudo yum localinstall some.rpm
-or-
$ sudo rpm -ivh some.rpm

I would suggest looking to the repositories RepoForge as well as EPEL for RPMs. For example the git packages are here.

  • http://pkgs.repoforge.org/git/

A simple command in the terminal will download it:

$ wget http://pkgs.repoforge.org/git/git-1.7.10.4-1.el6.rfx.x86_64.rpm

Rebuilding a source RPM

On the off chance you have to have the latest versions, you can still make use of RPMs but rather than download the .rpm version of a package, you'll want to get the .src.rpm version. These can be rebuilt using the following command:

$ rpmbuild --rebuild some.src.rpm

Rebuilding a tar.gz using a donor source RPM

You can also take your .tar.gz tarballs and reuse the .spec file that's included in the above .src.rpm. You do this through the following commands.

$ mkdir -p ~/rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS,tmp}

Then create a ~/.rpmmacros file.

%packager Your Name
%_topdir /home/YOUR HOME DIR/rpm
%_tmppath /home/YOUR HOME DIR/rpm/tmp

Now we're ready to "install" the donor .src.rpm.

$ rpm -ivh some.src.rpm

This will deposit a tarball and a .spec file in your ~/rpm directories. You can then edit this .spec file and replace the tarball with the newer one.

Now to rebuild it:

$ rpmbuild -ba ~/rpm/SPECS/some.spec

This will create a .rpm and a new .src.rpm file once it's complete.

Additional tips

You can use the tool yum-builddep to make sure you have all the required RPMs installed before getting started.

$ sudo yum-builddep some.src.rpm

Tags:

Git

Rhel

Source