Building bzr on RHEL AS 4

13 September, 2008

In order to use the bzr distributed version control system on Redhat Enterprise Linux 4 (RHEL) you first have to build python 2.4+ (and some additional modules) as RHEL shipped with 2.3.* of python which isn’t supported by bzr. In this article I will be building python 2.4.5 and the addional modules required for bzr 1.6.1 into a folder in my home directory so as not upset any of the applications that rely on the RHEL supported version of python. So lets get started;

First get python 2.4.5 using wget as the downloader

patrickd tmp $ wget -c

Now lets use tar to decompress it.

patrickd tmp $ tar xfjv Python-2.4.5.tar.bz2

[  …………….  ]

Enter the directory that tar just decompressed it to and configure it, so that it will be installed into the directory ‘/home/patrickd/apps/python’

patrickd Python-2.4.5 $ cd Python-2.4.5

patrickd Python-2.4.5 $ ./configure –prefix=/home/patrickd/apps/python

checking MACHDEP… linux2
checking for –without-gcc… no

[ ……… ]

creating Setup
creating Setup.local
creating Makefile

Once, python is configured. It is time to build it using the ‘make’ command, then create the directory that we intend to install python to and then finally install python into the preconfigured directory.

patrickd Python-2.4.5 $ mkdir -p /home/patrickd/apps/python

patrickd Python-2.4.5 $ make

[  ……  ]

patrickd Python-2.4.5 $ make install

[ ……  ]

After python has been installed, it now time to setup some environment variables. That will enable the new 2.4 version of python to be used as the default python rather than the redhat compilied version of python.

patrickd Python-2.4.5 $ export PATH=$HOME/apps/python/bin:$PATH

patrickd Python-2.4.5 $ export PYTHONPATH=/home/patrickd/apps/python/lib/python;

Check to make sure that the environment variables are correctly set by calling python and checking the version number.

patrickd Python-2.4.5 $ python -V
Python 2.4.5

Now we need to get some additional python modules that are used by bzr.

patrickd tmp $ wget

patrickd tmp $ wget

patrickd tmp $ wget

As before decompress them,

patrickd tmp $ tar xfzv Pyrex-

patrickd tmp $ tar xfzv cElementTree-1.0.5-20051216.tar.gz

patrickd tmp $ tar xfzv paramiko-1.7.4.tar.gz

Now build and install each of them in turn.

patrickd tmp $ cd Pyrex-

patrickd Pyrex- $ python install

patrickd Pyrex- $ cd ..

patrickd tmp $ cd cElementTree-1.0.5-20051216/

patrickd cElementTree-1.0.5-20051216 $ python install

[ ………… ]

patrickd cElementTree-1.0.5-20051216 $ cd ..

patrickd tmp $ cd paramiko-1.7.4/

patrickd paramiko-1.7.4 $ python install

[ ……… ]

patrickd paramiko-1.7.4 $ cd ..

Finally its time to get the bzr source code and install it into the new 2.4.5 python installation.

patrickd tmp $ wget

patrickd tmp $ tar xfzv bzr-1.6.1.tar.gz

patrickd tmp $ cd bzr-1.6.1

patrickd bzr-1.6.1 $ python install –home /home/patrickd/apps/python/

patrickd bzr-1.6.1 $ cd ~

After building and installing bzr its now time to check that bzr is correctly installed.

patrickd ~ $ bzr version
Bazaar (bzr) 1.6.1
Python interpreter: /home/patrickd/apps/python/bin/python 2.4.5
Python standard library: /home/patrickd/apps/python/lib/python2.4
bzrlib: /home/patrickd/apps/python/lib/python/bzrlib
Bazaar configuration: /home/patrickd/.bazaar
Bazaar log file: /home/patrickd/.bzr.log

Copyright 2005, 2006, 2007, 2008 Canonical Ltd.

bzr comes with ABSOLUTELY NO WARRANTY.  bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

Now that you have finished installing bzr, I would suggest your next point of call should be bzr user guide and then the main bzr documentation page.