How to build Mercurial 1.5 RPM's on CentOS/Redhat Linux 5

This is pretty easy, but there just a couple things I had to do to make it work so I thought I would document it.

  1. yum install -y rpm-build python-devel
  2. cd /usr/src/redhat/SOURCES
  3. wget http://mercurial.selenic.com/release/mercurial-1.5.2.tar.gz
  4. tar zxvf mercurial-1.5.2.tar.gz
  5. cd mercurial-1.5.2.tar.gz/contrib
  6. edit mercurial.spec and change Version: snapshot to Version: 1.5.2  and then remove the dependency of docutils
  7. rpmbuild -ba mercurial.spec
  8. That’s it - files are now in /usr/src/redhat/RPMS/<arch>/mercurial-1.5.2-0.<arch>.rpm

Posted by Sean Leach