As version numbers of both CentOS and Mercurial increase, my former post for Mercurial-1.1.1 and CentOS-5.2 seems to have been obsoleted already. Because somebody asked me, I tried installing the newest version of mercurial on CentOS-5.4. Here I make a memo of that.
This memo is useful for those who want to use RPM installation on CentOS. (As you may know, Mercurial can be installed by using Python setup module without RPM.)
And this memo is based on the former post. So if you don't have packages needed by Mercurial-1.4, please see the post, and install lacked packages using RPM.
wget http://mercurial.selenic.com/release/mercurial-1.4.1.tar.gz cp mercurial-1.4.1.tar.gz mercurial-1.4.1.tar.gz.orig tar zxvf mercurial-1.4.1.tar.gz cd mercurial-1.4.1/ cp contrib/mercurial.spec contrib/mercurial.spec.orig sed -i -e's/snapshot/1\.4\.1/' contrib/mercurial.spec sed -i -e's/, docutils >= 0.5//' contrib/mercurial.spec cd ../ tar cvf - mercurial-1.4.1 | gzip > mercurial-1.4.1.tar.gz rpmbuild -tb mercurial-1.4.1.tar.gz rpm -Uvh /usr/src/redhat/RPMS/i386/mercurial-1.4.1-0.i386.rpm hg --version |
Thank you for comments to the former post.
The first post was very useful for me. Very good work!
返信削除I just try it with mercurial 1.4.2.
返信削除I replace everything in the commands with 1.4.2 (including -e's/snapshot/1\.4\.2/') but I still have to change it manually from mercurial.spec, I´m not sure why.
Except for that, it work great, as far as I can tell.
That's great! Thanks!
返信削除What's more I didn't know a "-i" switch in sed. I always used some tmp output file.
One tip for you:
instead of
tar cvf - mercurial-1.4.1 | gzip > mercurial-1.4.1.tar.gz
you can use
tar zcvf mercurial-1.4.1.tar.gz mercurial-1.4.1
Less processes and more convenient.
Thanks once again.
Regards
Piotr
Piotr,
返信削除Thank you for your comment and advice. It must be a smart way which reduces our task!
By the way, dividing a sequential flow into two processes sometimes increases the processing speed.
Actually single tar process costs more than 1 sec, while two process use less than 1 sec on my Macbook Pro [Core2Duo + SATA].
I guess the result comes from multi-core CPU and IO wait.
Anyway, I appreciate the smarter and more simple way!
I use it from now on. :)
Need to have rpmbuild available too:
返信削除sudo yum install rpm-build
...
Garen,
返信削除That's right! Thank you. :)
Thanks.
返信削除I used this receipt to install mercurial -1.5.1 on OEL 5.4(RHEL 5 based) - it works, just change release numbers :)
lativ,
返信削除Thank you so much for your report! I'll try the new version of Mercurial you wrote.
# rpmbuild -tb mercurial-1.6.3.tar.gz
返信削除got error
error: Failed build dependencies:
python-docutils >= 0.5 is needed by mercurial-1.6.3-0.i386
Gadelkareem,
返信削除Thanks for the comment. Could you refer to the newest post?