A new .spec file for Mercurial on Fedora

Eric Hopper hopper at omnifarious.org
Wed Mar 26 02:51:54 CDT 2008


The attached file is the spec file I've used for my personal build of
Mercurial for Fedora.  It contains numerous enhancements over both the
included spec file and the spec file for Fedora.

Here is a possibly incomplete list:

* The hgk extension is installed in a way that just works.

* The gpg and hgk extensions have been split out as separate packages as
  they both have important dependencies that the rest of Mercurial
  doesn't.

* Some useful scripts, including the hgwebdir.cgi and hgweb.cgi scripts
  as well as the logo .svg file are now installed in
  /usr/share/mercurial.

* The mergetools.hgrc and sample.hgrc files are installed in
  /usr/share/doc.

-- 
"It does me no injury for my neighbor to say there are twenty gods or no God.
It neither picks my pocket nor breaks my leg."  --- Thomas Jefferson
"Go to Heaven for the climate, Hell for the company."  -- Mark Twain
-- Eric Hopper (http://www.omnifarious.org/~hopper) --
-------------- next part --------------
Summary: A fast, lightweight distributed source control management system
Name: mercurial
Version: 1.0.0.6390
Release: 8hopper
License: GPL
Group: Development/Tools
URL: http://www.selenic.com/mercurial/
Source0: http://www.selenic.com/mercurial/release/%{name}-%{version}.tar.bz2
Source1: http://hg.kublai.com/mercurial/extensions/localbranch/archive/247db18653a4.tar.gz/localbranch-247db18653a4.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: python-devel >= 2.3 asciidoc xmlto gcc
Patch0: mercurial-hgk.patch

%description
Mercurial is a fast, lightweight source control management system designed
for efficient handling of very large distributed projects.

Mercurial ships with several extensions, and more are available
through additional RPMs.  The extensions Merucurial is known to ship
with as of 0.8.1 are patchbomb, mq, and hbisect.

Quick start: http://www.selenic.com/mercurial/wiki/index.cgi/QuickStart
Tutorial: http://www.selenic.com/mercurial/wiki/index.cgi/Tutorial
Extensions: http://www.selenic.com/mercurial/wiki/index.cgi/CategoryExtension

%package gpg
Group: Development/Tools
Summary: Mercurial extension for signing changesets with gpg keys.
Requires: mercurial = %{version}-%{release}, gnupg

%description gpg
A Mercurial extension for signing particular changesets with gpg keys
and verifying those signatures later.  See 'hg help sig' after
installing this extension in your ~/.hgrc file

%package hgk
Group: Development/Tools
Summary: Mercurial extension for graphically displaying the change history.
Requires: mercurial = %{version}-%{release}, /usr/bin/wish

%description hgk
A Mercurial extension for displaying the change history graphically
using Tcl/Tk.  Displays branches and merges in an easily
understandable way and shows diffs for each revision.  Based on
gitk for the git SCM.

See http://www.selenic.com/mercurial/wiki/index.cgi/UsingHgk for more
documentation.

%prep
%setup -q
%setup -D -T -a 1
mkdir otherext
mv localbranch-247db18653a4 otherext
cd otherext
cp localbranch-247db18653a4/localbranch.py ../hgext
cd ..
%patch0 -p1
ln contrib/hgk .

%build
python ./setup.py build

# not built by default.  kind of lame
pushd doc ; make man ; popd

%install
rm -rf $RPM_BUILD_ROOT
python ./setup.py install -O1 --root=$RPM_BUILD_ROOT --record=%{name}.files
egrep '^(.*/)?(hgk|(hgext/hgk\..*))$' %{name}.files >%{name}.files.hgk
egrep '^(.*/)?hgext/gpg\..*$' %{name}.files >%{name}.files.gpg
egrep -v '^(.*/)?(hgk|(hgext/(hgk|gpg)\..*))$' %{name}.files >%{name}.files.base

# and we have to install the man pages
mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1 $RPM_BUILD_ROOT/%{_mandir}/man5
install -m 0444 doc/hg.1 $RPM_BUILD_ROOT/%{_mandir}/man1/hg.1
install -m 0444 doc/hgrc.5 $RPM_BUILD_ROOT/%{_mandir}/man5/hgrc.5
install -m 0444 doc/hgignore.5 $RPM_BUILD_ROOT/%{_mandir}/man5/hgignore.5

# and we install the CGI scripts
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/mercurial
install -m 0555 hgweb.cgi $RPM_BUILD_ROOT/%{_datadir}/mercurial/hgweb.cgi
install -m 0555 hgwebdir.cgi $RPM_BUILD_ROOT/%{_datadir}/mercurial/hgwebdir.cgi
install -m 0555 contrib/hgwebdir.fcgi $RPM_BUILD_ROOT/%{_datadir}/mercurial/hgwebdir.fcgi
install -m 0555 contrib/hg-ssh $RPM_BUILD_ROOT/%{_datadir}/mercurial/hg-ssh
install -m 0555 contrib/hgdiff $RPM_BUILD_ROOT/%{_datadir}/mercurial/hgdiff
install -m 0444 contrib/logo-droplets.svg $RPM_BUILD_ROOT/%{_datadir}/mercurial/logo-droplets.svg

%clean
rm -rf $RPM_BUILD_ROOT


%files -f %{name}.files.base
%defattr(-,root,root,-)
%doc CONTRIBUTORS README contrib/sample.hgrc contrib/mergetools.hgrc doc/hg.1.txt doc/hgignore.5.txt doc/hgrc.5.txt
%{_mandir}/man*/*
%{_datadir}/mercurial/*

%files gpg -f %{name}.files.gpg

%files hgk -f %{name}.files.hgk

%changelog
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial/attachments/20080326/5be10c3b/attachment.pgp 


More information about the Mercurial mailing list