diff --git a/mercurial.spec b/mercurial.spec index fc1c7a5..631cb38 100644 --- a/mercurial.spec +++ b/mercurial.spec @@ -1,7 +1,7 @@ Summary: A fast, lightweight distributed source control management system Name: mercurial Version: 1.0 -Release: 4%{?dist} +Release: 9%{?dist} License: GPLv2 Group: Development/Tools URL: http://www.selenic.com/mercurial/ @@ -9,6 +9,8 @@ Source0: http://www.selenic.com/mercurial/release/%{name}-%{version}.tar.gz Source1: mercurial-site-start.el BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: python-devel asciidoc xmlto +BuildRequires: emacs emacs-el +BuildRequires: xemacs xemacs-devel xemacs-packages-extra Requires: python Provides: hg = %{version}-%{release} @@ -20,19 +22,84 @@ 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 emacs +%define pkg mercurial +#%define pkgname Foo + +# If the emacs-el package has installed a pkgconfig file, use that to determine +# install locations and Emacs version at build time, otherwise set defaults. +%if %($(pkg-config emacs) ; echo $?) +%define emacs_version 22.1 +%define emacs_lispdir %{_datadir}/emacs/site-lisp +%define emacs_startdir %{_datadir}/emacs/site-lisp/site-start.d +%else +%define emacs_version %(pkg-config emacs --modversion) +%define emacs_lispdir %(pkg-config emacs --variable sitepkglispdir) +%define emacs_startdir %(pkg-config emacs --variable sitestartdir) +%endif + +# If the xemacs-devel package has installed a pkgconfig file, use that to determine +# install locations and Emacs version at build time, otherwise set defaults. +%if %($(pkg-config xemacs) ; echo $?) +%define xemacs_version 21.5 +%define xemacs_lispdir %{_datadir}/xemacs/site-packages +%define xemacs_startdir %{_datadir}/xemacs/site-packages/site-start.d +%else +%define xemacs_version %(pkg-config xemacs --modversion) +%define xemacs_lispdir %(pkg-config xemacs --variable sitepkglispdir) +%define xemacs_startdir %(pkg-config xemacs --variable sitestartdir) +%endif + +%package -n emacs-%{pkg} Summary: Mercurial version control system support for Emacs Group: Applications/Editors Requires: hg = %{version}-%{release}, emacs-common - -%description emacs -%{summary}. +Requires: emacs(bin) >= %{emacs_version} +Obsoletes: %{pkg}-emacs + +%description -n emacs-%{pkg} +Contains byte compiled elisp packages for %{pkg}. +To get started: start emacs, load hg-mode with M-x hg-mode, and show +help with C-c h h + +%package -n emacs-%{pkg}-el +Summary: Elisp source files for %{pkg} under GNU Emacs +Group: Applications/Editors +Requires: emacs-%{pkg} = %{version}-%{release} + +%description -n emacs-%{pkg}-el +This package contains the elisp source files for %{pkg} under GNU Emacs. You +do not need to install this package to run %{pkg}. Install the emacs-%{pkg} +package to use %{pkg} with GNU Emacs. + +%package -n xemacs-%{pkg} +Summary: Compiled elisp files to run %{pkg} under XEmacs +Group: Applications/Editors +Requires: hg = %{version}-%{release}, xemacs-common +Requires: xemacs(bin) >= %{xemacs_version} + +%description -n xemacs-%{pkg} +This package contains the byte compiled elisp packages to use %{pkg} with +XEmacs. +To get started: start xemacs, load hg-mode with M-x hg-mode, and show +help with C-c h h + + +%package -n xemacs-%{pkg}-el +Summary: Elisp source files for %{pkg} under XEmacs +Group: Applications/Editors +Requires: xemacs-%{pkg} = %{version}-%{release} + +%description -n xemacs-%{pkg}-el +This package contains the elisp source files for %{pkg} under XEmacs. You do +not need to install this package to run %{pkg}. Install the xemacs-%{pkg} +package to use %{pkg} with XEmacs. %package hgk Summary: Hgk interface for mercurial Group: Development/Tools Requires: hg = %{version}-%{release}, tk + %description hgk A Mercurial extension for displaying the change history graphically using Tcl/Tk. Displays branches and merges in an easily @@ -53,6 +120,9 @@ rm -rf $RPM_BUILD_ROOT python setup.py install -O1 --root $RPM_BUILD_ROOT --prefix %{_prefix} --record=%{name}.files make install-doc DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} +grep -v 'hgk.py*' < %{name}.files > %{name}-base.files +grep 'hgk.py*' < %{name}.files > %{name}-hgk.files + 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} @@ -66,25 +136,43 @@ zsh_completion_dir=$RPM_BUILD_ROOT%{_datadir}/zsh/site-functions mkdir -p $zsh_completion_dir install -m 644 contrib/zsh_completion $zsh_completion_dir/_mercurial -lisp_dir=$RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp -mkdir -p $lisp_dir -install -m 644 contrib/mercurial.el $lisp_dir -xlisp_dir=$RPM_BUILD_ROOT%{_datadir}/xemacs/site-packages/lisp -mkdir -p $xlisp_dir -install -m 644 contrib/mercurial.el $xlisp_dir +mkdir -p $RPM_BUILD_ROOT%{emacs_lispdir} +mkdir -p $RPM_BUILD_ROOT%{xemacs_lispdir} +pushd contrib +for file in mercurial.el mq.el; do + emacs -batch -l mercurial.el --no-site-file -f batch-byte-compile $file + install -m 644 $file ${file}c $RPM_BUILD_ROOT%{emacs_lispdir} + rm ${file}c + xemacs -batch -l mercurial.el --no-site-file -f batch-byte-compile $file + install -m 644 $file ${file}c $RPM_BUILD_ROOT%{xemacs_lispdir} + rm ${file}c +done +popd + + + mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d -mkdir -p $lisp_dir/site-start.d/ && install -m644 %SOURCE1 $lisp_dir/site-start.d/ -mkdir -p $xlisp_dir/site-start.d/ && install -m644 %SOURCE1 $xlisp_dir/site-start.d/ +mkdir -p $RPM_BUILD_ROOT%{emacs_startdir} && install -m644 %SOURCE1 $RPM_BUILD_ROOT%{emacs_startdir} +mkdir -p $RPM_BUILD_ROOT%{xemacs_startdir} && install -m644 %SOURCE1 $RPM_BUILD_ROOT%{xemacs_startdir} + +cat >hgk.rc < - 1.0-9 +- Add '-l mercurial.el' for emacs also + +* Tue Apr 8 2008 Neal Becker - 1.0-8 +- BR xemacs-packages-extra + +* Tue Apr 8 2008 Neal Becker - 1.0-7 +- Various fixes + +* Tue Apr 8 2008 Neal Becker - 1.0-6 +- fix to comply with emacs packaging guidelines + +* Thu Mar 27 2008 Neal Becker - 1.0-5 +- Move hgk-related py files to hgk +- Put mergetools.hgrc in /etc/mercurial/hgrc.d +- Add hgk.rc and put in /etc/mercurial/hgrc.d + * Wed Mar 26 2008 Neal Becker - 1.0-4 - Rename mercurial-site-start -> mercurial-site-start.el