Building bzr on RHEL AS 4

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 http://www.python.org/ftp/python/2.4.5/Python-2.4.5.tar.bz2

Now lets use tar to decompress it.

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

Python-2.4.5/
Python-2.4.5/Include/
Python-2.4.5/Include/pymem.h
Python-2.4.5/Include/compile.h
Python-2.4.5/Include/pgenheaders.h
Python-2.4.5/Include/complexobject.h
Python-2.4.5/Include/objimpl.h
Python-2.4.5/Include/setobject.h
Python-2.4.5/Include/enumobject.h
[  …………….  ]

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 EXTRAPLATDIR…
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 http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/Pyrex-0.9.8.5.tar.gz

patrickd tmp $ wget http://effbot.org/media/downloads/cElementTree-1.0.5-20051216.tar.gz

patrickd tmp $ wget http://www.lag.net/paramiko/download/paramiko-1.7.4.tar.gz

As before decompress them,

patrickd tmp $ tar xfzv Pyrex-0.9.8.5.tar.gz

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-0.9.8.5/

patrickd Pyrex-0.9.8.5 $ python setup.py install

patrickd Pyrex-0.9.8.5 $ cd ..

patrickd tmp $ cd cElementTree-1.0.5-20051216/

patrickd cElementTree-1.0.5-20051216 $ python setup.py install

[ ………… ]

patrickd cElementTree-1.0.5-20051216 $ cd ..

patrickd tmp $ cd paramiko-1.7.4/

patrickd paramiko-1.7.4 $ python setup.py 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 https://launchpadlibrarian.net/17315400/bzr-1.6.1.tar.gz

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

patrickd tmp $ cd bzr-1.6.1

patrickd bzr-1.6.1 $ python setup.py 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.
http://bazaar-vcs.org/

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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: