SyntaxHighlighter

2008/12/17

How to Install Mercurial-1.1 on CentOS-5.2

NOTE: I wrote a new post to install Mercurial-1.5.4. Please refer to it!

Mercurial-1.1 package for CentOS-5.2 doesn't exist. Here is the memo of how to make the package and install it.
To install Mercurial-1.1 on CentOS-5.2, asciidoc and xmlto package are needed.

  1. asciidoc
  2. wget http://apt.sw.be/redhat/el5/en/SRPMS.rpmforge/asciidoc-8.3.1-1.rf.src.rpm
    rpmbuild --rebuild asciidoc-8.3.1-1.rf.src.rpm
    rpm -ivh /usr/src/redhat/RPMS/noarch/asciidoc-8.3.1-1.rf.noarch.rpm
  3. xmlto
  4. yum install xmlto
  5. Mercurial-1.1
  6. wget http://www.selenic.com/mercurial/release/mercurial-1.1.1.tar.gz
    cp mercurial-1.1.1.tar.gz mercurial-1.1.1.tar.gz.orig
    gtar zxvf mercurial-1.1.1.tar.gz
    cp mercurial-1.1.1/contrib/mercurial.spec mercurial-1.1.1/contrib/mercurial.spec.orig
    sed -i -e's/snapshot/1\.1\.1/' mercurial-1.1.1/contrib/mercurial.spec
    sed -i -e's/^\(%{_libdir}\)/#\1/' mercurial-1.1.1/contrib/mercurial.spec
    gtar cvf - mercurial-1.1.1 | gzip > mercurial-1.1.1.tar.gz
    rpmbuild -tb mercurial-1.1.1.tar.gz
    rpm -ivh /usr/src/redhat/RPMS/i386/mercurial-*.rpm

Please note that some operations need root privilege.

7 件のコメント:

dcuartielles さんのコメント...

Hej,

I tried this but it stopped at the last step claiming a dependency to /usr/local/bin/python ... but it is there!! Do you have any idea why this could be?

(What I got:)

rpm -ivh /usr/src/redhat/RPMS/i386/mercurial-*.rpm
error: Failed dependencies:
/usr/local/bin/python is needed by mercurial-1.1.1-0.i386

dcuartielles さんのコメント...

I solved my problem by doing:

cd mercurial-1.1.1
sudo /usr/local/bin/python setup.py install

thanks, seems to be up now!

moririn さんのコメント...

I don't know exactly why you failed... Could you check your RPM file dependencies? My result is below:
# LANG=C rpm -qR -p /usr/src/redhat/RPMS/i386/mercurial-1.1.1-0.i386.rpm
/bin/sh
/usr/bin/env
/usr/bin/python
libc.so.6
libc.so.6(GLIBC_2.0)
libc.so.6(GLIBC_2.1.3)
libc.so.6(GLIBC_2.2)
libc.so.6(GLIBC_2.4)
libpthread.so.0
libpthread.so.0(GLIBC_2.0)
libpthread.so.0(GLIBC_2.2)
python(abi) = 2.4
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rtld(GNU_HASH)

As you see, my mercurial-1.1.1 package doesn't depend on /usr/local/bin/python but /usr/bin/python.

...Congratulations! You did it by yourself :).

Agustín さんのコメント...

Hello, I had two problems installing this on a centos 5.3.
I try to install the last version of mercurial (1.4.1), changing the names according to that. It was all fine, until a message error like this appear
"Failed dependency, docutils=>5 required"
I was not able to actually find any simple way to solve this, but it seems only have to do with the documentation, so I remove it from /contrib/mercurial.spec
Then it was ok.
The thing is, the rpmbuild seems to end fine, don´t show me any error, but no rpm are made...
I can find mercurial directories and files in /var/tm/mercurial-1.4.1-0-root/usr/bin, but sign of .rpm files...
Any idea or suggestion? Will be greatly appreciated.
Thanks in advance...

moririn-japan さんのコメント...

Agustin,

Thank you for comments.

Here's the diff of the specfile:
3c3
< Version: snapshot
---
> Version: 1.4.1
20c20
< BuildRequires: python >= 2.4, python-devel, make, gcc, docutils >= 0.5
---
> BuildRequires: python >= 2.4, python-devel, make, gcc
83c83
< %{_libdir}/python%{pythonver}/site-packages/%{name}-*-py%{pythonver}.egg-info
---
> #%{_libdir}/python%{pythonver}/site-packages/%{name}-*-py%{pythonver}.egg-info


Using this, I installed mercurial-1.4.1 on CentOS-5.3.

Agustín さんのコメント...

Moririn, that was great!!!
I was not expecting you answer me so quickly!
And yes, your solution work like a charm!
Thank you so much!!!

moririn-japan さんのコメント...

Agustín,

Thanks to you, I made a new post for Mercurial-1.4.1 and CentOS-5.4.