# HG changeset patch # User Brendan Cully # Date 1183217483 25200 # Node ID 544a5e3d7d1c6afa90dc829f371bff380e2abd9b # Parent 778bab992732b7280a752e38ff0d2e661b99e140# Parent cc7a43af709d8ac5296439140bd7ab1932b3bf4e Merge with Adam Spiers diff --git a/contrib/buildrpm b/contrib/buildrpm --- a/contrib/buildrpm +++ b/contrib/buildrpm @@ -29,7 +29,7 @@ tmpspec=/tmp/`basename "$specfile"`.$$ version=`hg tags | perl -e 'while(){if(/^(\d\S+)/){print$1;exit}}'` # Compute the release number as the difference in revision numbers # between the tip and the most recent tag. -release=`hg tags | perl -e 'while(){/^(\S+)\s+(\d+)/;if($1eq"tip"){$t=$2}else{print$t-$2+1;exit}}'` +release=`hg tags | perl -e 'while(){($tag,$id)=/^(\S+)\s+(\d+)/;if($tag eq "tip"){$tip = $id}elsif($tag=~/^\d/){print $tip-$id+1;exit}}'` tip=`hg -q tip` # Beat up the spec file @@ -40,6 +40,19 @@ sed -e 's,^Source:.*,Source: /dev/null,' -e 's,^%setup.*,,' \ $specfile > $tmpspec +cat <> $tmpspec +%changelog +* `date +'%a %b %d %Y'` `hg showconfig ui.username` $version-$release +- Automatically built via $0 + +EOF +hg log \ + --template '* {date|rfc822date} {author}\n- {desc|firstline}\n\n' \ + .hgtags \ + | sed -e 's/^\(\* [MTWFS][a-z][a-z]\), \([0-3][0-9]\) \([A-Z][a-z][a-z]\) /\1 \3 \2 /' \ + -e '/^\* [MTWFS][a-z][a-z] /{s/ [012][0-9]:[0-9][0-9]:[0-9][0-9] [+-][0-9]\{4\}//}' \ + >> $tmpspec + rpmbuild --define "_topdir $rpmdir" -bb $tmpspec if [ $? = 0 ]; then rm -rf $tmpspec $rpmdir/BUILD diff --git a/contrib/mercurial.spec b/contrib/mercurial.spec old mode 100644 new mode 100755 --- a/contrib/mercurial.spec +++ b/contrib/mercurial.spec @@ -8,6 +8,17 @@ Source: http://www.selenic.com/mercurial URL: http://www.selenic.com/mercurial BuildRoot: /tmp/build.%{name}-%{version}-%{release} +# From the README: +# +# Note: some distributions fails to include bits of distutils by +# default, you'll need python-dev to install. You'll also need a C +# compiler and a 3-way merge tool like merge, tkdiff, or kdiff3. +# +# python-devel provides an adequate python-dev. The merge tool is a +# run-time dependency. +# +BuildRequires: python >= 2.3, python-devel, make, gcc, asciidoc, xmlto + %define pythonver %(python -c 'import sys;print ".".join(map(str, sys.version_info[:2]))') %define pythonlib %{_libdir}/python%{pythonver}/site-packages/%{name} %define hgext %{_libdir}/python%{pythonver}/site-packages/hgext @@ -21,23 +32,51 @@ rm -rf $RPM_BUILD_ROOT %setup -q %build -python setup.py build +make all %install -python setup.py install --root $RPM_BUILD_ROOT +python setup.py install --root $RPM_BUILD_ROOT --prefix %{_prefix} +make install-doc DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} + +install contrib/hgk $RPM_BUILD_ROOT%{_bindir} +install contrib/convert-repo $RPM_BUILD_ROOT%{_bindir}/mercurial-convert-repo +install contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir} +install contrib/git-viz/{hg-viz,git-rev-tree} $RPM_BUILD_ROOT%{_bindir} + +bash_completion_dir=$RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d +mkdir -p $bash_completion_dir +install contrib/bash_completion $bash_completion_dir/mercurial.sh + +zsh_completion_dir=$RPM_BUILD_ROOT%{_datadir}/zsh/site-functions +mkdir -p $zsh_completion_dir +install contrib/zsh_completion $zsh_completion_dir/_mercurial + +lisp_dir=$RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp +mkdir -p $lisp_dir +install contrib/mercurial.el $lisp_dir %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) -%doc doc/* *.cgi +%doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html doc/ja *.cgi +%{_mandir}/man?/hg*.gz %dir %{pythonlib} %dir %{hgext} +%{_sysconfdir}/bash_completion.d/mercurial.sh +%{_datadir}/zsh/site-functions/_mercurial +%{_datadir}/emacs/site-lisp/mercurial.el +%{_bindir}/hg +%{_bindir}/hgk %{_bindir}/hgmerge -%{_bindir}/hg +%{_bindir}/hg-ssh +%{_bindir}/hg-viz +%{_bindir}/git-rev-tree +%{_bindir}/mercurial-convert-repo %{pythonlib}/templates %{pythonlib}/*.py* %{pythonlib}/hgweb/*.py* %{pythonlib}/*.so %{hgext}/*.py* +%{hgext}/convert/*.py* diff --git a/doc/Makefile b/doc/Makefile old mode 100644 new mode 100755 --- a/doc/Makefile +++ b/doc/Makefile @@ -36,8 +36,8 @@ MANIFEST: man html install: man for i in $(MAN) ; do \ subdir=`echo $$i | sed -n 's/..*\.\([0-9]\)$$/man\1/p'` ; \ - mkdir -p $(DESTDIR)/$(MANDIR)/$$subdir ; \ - $(INSTALL) $$i $(DESTDIR)/$(MANDIR)/$$subdir ; \ + mkdir -p $(DESTDIR)$(MANDIR)/$$subdir ; \ + $(INSTALL) $$i $(DESTDIR)$(MANDIR)/$$subdir ; \ done clean: