Outsourced Clue

Providing big company technology recommendations to the masses

Archive for the ‘centos’ tag

Build a RPM of Python 2.5 on CentOS 5 / Redhat Enterprise (RHEL) 5

without comments

It’s such a pain to get a newer version of Python installed on Redhat/CentOS.  RHEL 4/CentOS 4 comes with Python 2.3, and RHEL 5/CentOS 5 comes with Python 2.4.  I have noticed more and more apps requiring Python >= 2.5, so I had to find a good way to build an RPM of Python 2.5.  Based on some sites I found out there and some mods I made, here are the instructions:

% sudo yum install autoconf bzip2-devel db4-devel elf-utils \
  expat-devel findutils gcc-c++ gdbm-devel glibc-devel gmp-devel \
  mesa-libGL-devel libX11-devel libtermcap-devel ncurses-devel \
  openssl-devel pkgconfig readline-devel sqlite-devel tar \
  tix-devel tk-devel rpm-build zlib-devel
% test -f ~/.rpmmacros || echo %_topdir %\(echo \"\$HOME\"\)/rpm >> ~/.rpmmacros
% mkdir -p $HOME/rpm/{BUILD,RPMS,SOURCES,SPECS}
% wget ftp://mirrors.kernel.org:/fedora/releases/10/Fedora/source/SRPMS/python-2*.src.rpm
% rpm -ivh python-2*.src.rpm
% rm python-2*.src.rpm
% sed -ie 's/DBLIBVER=4.7/DBLIBVER=4.3/' $HOME/rpm/SOURCES/python-2.5-config.patch
% sed -ie 's/db4-devel >= 4.7/db4-devel >= 4.3/' $HOME/rpm/SPECS/python.spec
% rpmbuild --define '__python_ver 25' -bb $HOME/rpm/SPECS/python.spec


Written by sleach

April 22nd, 2009 at 1:33 pm

Posted in Misc

Tagged with , ,