rpms/mercurial/F-7 mercurial.spec,1.28,1.29

Neal Becker (nbecker) fedora-extras-commits at redhat.com
Tue Apr 8 15:54:22 UTC 2008


Author: nbecker

Update of /cvs/pkgs/rpms/mercurial/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11164

Modified Files:
	mercurial.spec 
Log Message:
Fixes for emacs packaging



Index: mercurial.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mercurial/F-7/mercurial.spec,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- mercurial.spec	26 Mar 2008 15:01:36 -0000	1.28
+++ mercurial.spec	8 Apr 2008 15:53:25 -0000	1.29
@@ -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 @@
 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 @@
 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
+Requires:       emacs(bin) >= %{emacs_version}
+Obsoletes:	%{pkg}-emacs
 
-%description emacs
-%{summary}.
+%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 @@
 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 @@
 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 <<EOF
+[extensions]
+# enable hgk extension ('hg help' shows 'view' as a command)
+hgk=
+EOF
+install hgk.rc $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d
+
+install contrib/mergetools.hgrc $RPM_BUILD_ROOT%{_sysconfdir}/mercurial/hgrc.d
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%files -f %{name}.files
+%files -f %{name}-base.files
 %defattr(-,root,root,-)
 %doc CONTRIBUTORS COPYING doc/README doc/hg*.txt doc/hg*.html doc/ja *.cgi contrib/*.fcgi
 %doc %attr(644,root,root) %{_mandir}/man?/hg*.gz
-%doc %attr(644,root,root) contrib/*.svg contrib/*.hgrc
+%doc %attr(644,root,root) contrib/*.svg contrib/sample.hgrc
 %{_sysconfdir}/bash_completion.d/mercurial.sh
 %{_datadir}/zsh/site-functions/_mercurial
 %{_bindir}/hg-ssh
@@ -93,20 +181,48 @@
 %{_bindir}/mercurial-convert-repo
 %dir %{_sysconfdir}/mercurial
 %dir %{_sysconfdir}/mercurial/hgrc.d
+%{_sysconfdir}/mercurial/hgrc.d/mergetools.hgrc
 
-%files emacs
-%{_datadir}/emacs/site-lisp/mercurial.el
-%{_datadir}/xemacs/site-packages/lisp/mercurial.el
-%{_datadir}/emacs/site-lisp/site-start.d/*
-%{_datadir}/xemacs/site-packages/lisp/site-start.d/*
+%files -n emacs-%{pkg}
+%{emacs_lispdir}/*.elc
+%{emacs_startdir}/*.el
 
-%files hgk
+%files -n emacs-%{pkg}-el
+%{emacs_lispdir}/*.el
+
+%files -n xemacs-%{pkg}
+%{xemacs_lispdir}/*.elc
+%{xemacs_startdir}/*.el
+
+%files -n xemacs-%{pkg}-el
+%{xemacs_lispdir}/*.el
+
+
+%files hgk -f %{name}-hgk.files
 %{_bindir}/hgk
+%{_sysconfdir}/mercurial/hgrc.d/hgk.rc
 
 #%check
 #cd tests && python run-tests.py
 
 %changelog
+* Tue Apr  8 2008 Neal Becker <ndbecker2 at gmail.com> - 1.0-9
+- Add '-l mercurial.el' for emacs also
+
+* Tue Apr  8 2008 Neal Becker <ndbecker2 at gmail.com> - 1.0-8
+- BR xemacs-packages-extra
+
+* Tue Apr  8 2008 Neal Becker <ndbecker2 at gmail.com> - 1.0-7
+- Various fixes
+
+* Tue Apr  8 2008 Neal Becker <ndbecker2 at gmail.com> - 1.0-6
+- fix to comply with emacs packaging guidelines
+
+* Thu Mar 27 2008 Neal Becker <ndbecker2 at gmail.com> - 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 <ndbecker2 at gmail.com> - 1.0-4
 - Rename mercurial-site-start -> mercurial-site-start.el
 




More information about the fedora-extras-commits mailing list