%global pkg tuareg %global pkgname Tuareg-mode # 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 $?) %global emacs_version 22.1 %global emacs_lispdir %{_datadir}/emacs/site-lisp %global emacs_startdir %{_datadir}/emacs/site-lisp/site-start.d %else %global emacs_version %(pkg-config emacs --modversion) %global emacs_lispdir %(pkg-config emacs --variable sitepkglispdir) %global 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 $?) %global xemacs_version 21.5 %global xemacs_lispdir %{_datadir}/xemacs/site-lisp %global xemacs_startdir %{_datadir}/xemacs/site-lisp/site-start.d %else %global xemacs_version %(pkg-config xemacs --modversion) %global xemacs_lispdir %(pkg-config xemacs --variable sitepkglispdir) %global xemacs_startdir %(pkg-config xemacs --variable sitestartdir) %endif Name: emacs-common-%{pkg} Version: 2.0.10 Release: 2%{?dist} Summary: Emacs and XEmacs mode for editing ocaml License: GPLv2+ URL: https://github.com/ocaml/%{pkg} Source0: https://github.com/ocaml/tuareg/releases/download/%{version}/tuareg-%{version}.tar.gz Source1: COPYING BuildArch: noarch BuildRequires: emacs, emacs-el BuildRequires: xemacs, xemacs-devel # Needs caml-types.el in order to use *.annot files properly. # In Debian this is merely a recommendation, to avoid pulling # in all of OCaml just to edit an OCaml file. Requires: ocaml-emacs %description Tuareg is an OCaml mode for GNU Emacs and XEmacs. It handles automatic indentation of Objective Caml and Caml Light code. Key parts of the code are highlighted using Font-Lock. Support to run an interactive Caml toplevel and debbuger is provided. This package contains the common files. Install emacs-%{pkg} to get the complete package. %package -n emacs-%{pkg} Summary: Compiled elisp files to run %{pkgname} under GNU Emacs Requires: emacs(bin) >= %{emacs_version} Requires: emacs-common-%{pkg} = %{version}-%{release} # May be removed in Fedora 25. Obsoletes: emacs-%{pkg}-el <= %{version}-%{release} Provides: emacs-%{pkg}-el <= %{version}-%{release} %description -n emacs-%{pkg} Tuareg is an OCaml mode for GNU Emacs and XEmacs. It handles automatic indentation of Objective Caml and Caml Light code. Key parts of the code are highlighted using Font-Lock. Support to run an interactive Caml toplevel and debbuger is provided. Install this package if you need to edit OCaml code in Emacs. %package -n xemacs-%{pkg} Summary: Compiled elisp files to run %{pkgname} under XEmacs Requires: xemacs(bin) >= %{xemacs_version} Requires: emacs-common-%{pkg} = %{version}-%{release} # May be removed in Fedora 25. Obsoletes: xemacs-%{pkg}-el <= %{version}-%{release} Provides: xemacs-%{pkg}-el <= %{version}-%{release} %description -n xemacs-%{pkg} Tuareg is an OCaml mode for GNU Emacs and XEmacs. It handles automatic indentation of Objective Caml and Caml Light code. Key parts of the code are highlighted using Font-Lock. Support to run an interactive Caml toplevel and debbuger is provided. Install this package if you need to edit OCaml code in XEmacs. %prep %setup -q -n %{pkg}-%{version} %build make make elc # Upstream sources no longer contain 'COPYING' although they are still # licensed under the GPL. cp %{SOURCE1} . %install rm -rf $RPM_BUILD_ROOT # For unknown reasons, the upstream 'make install' rule has been # commented out. This code hopefully does the right thing. Don't # install 'tuareg-site-file.el' since the upstream source doesn't # compile it and it didn't exist in previous versions at all. # Emacs. mkdir -p $RPM_BUILD_ROOT/%{emacs_lispdir}/%{pkg} echo %{version} > $RPM_BUILD_ROOT/%{emacs_lispdir}/%{pkg}/version install -m 0644 *.el *.elc $RPM_BUILD_ROOT/%{emacs_lispdir}/%{pkg} rm $RPM_BUILD_ROOT/%{emacs_lispdir}/%{pkg}/tuareg-site-file.el # XEmacs. mkdir -p $RPM_BUILD_ROOT/%{xemacs_lispdir}/%{pkg} echo %{version} > $RPM_BUILD_ROOT/%{xemacs_lispdir}/%{pkg}/version install -m 0644 *.el *.elc $RPM_BUILD_ROOT/%{xemacs_lispdir}/%{pkg} rm $RPM_BUILD_ROOT/%{xemacs_lispdir}/%{pkg}/tuareg-site-file.el %files %doc COPYING README.md tuareg-site-file.el %files -n emacs-%{pkg} %doc COPYING %{emacs_lispdir}/%{pkg}/*.elc %{emacs_lispdir}/%{pkg}/*.el %{emacs_lispdir}/%{pkg}/version #%{emacs_startdir}/*.el %dir %{emacs_lispdir}/%{pkg} %files -n xemacs-%{pkg} %doc COPYING %{xemacs_lispdir}/%{pkg}/*.elc %{xemacs_lispdir}/%{pkg}/*.el %{xemacs_lispdir}/%{pkg}/version #%{xemacs_startdir}/*.el %dir %{xemacs_lispdir}/%{pkg} %changelog * Fri Feb 10 2017 Fedora Release Engineering - 2.0.10-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Sat Nov 05 2016 Richard W.M. Jones - 2.0.10-1 - Upstream release 2.0.10. * Wed Feb 03 2016 Fedora Release Engineering - 2.0.10-0.2.1c837e26 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Tue Jul 14 2015 Richard W.M. Jones - 2.0.10-0.1 - Move to pre-release of 2.0.10 (from git). * Wed Jun 17 2015 Fedora Release Engineering - 2.0.9-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Sat Mar 28 2015 Richard W.M. Jones - 2.0.9-1 - New upstream version 2.0.9. - New upstream URL and source location (on github). - Move the elisp source files into main package to comply with updated packaging guidelines (https://fedoraproject.org/wiki/Packaging:Emacs). - Update COPYING from upstream git. - README -> README.md. * Sat Jun 07 2014 Fedora Release Engineering - 2.0.6-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Sun Sep 15 2013 Richard W.M. Jones - 2.0.6-1 - New upstream version 2.0.6. - Modernize the spec file. * Sat Aug 03 2013 Fedora Release Engineering - 2.0.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Wed Feb 13 2013 Fedora Release Engineering - 2.0.4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Wed Jul 18 2012 Fedora Release Engineering - 2.0.4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Fri Jan 13 2012 Fedora Release Engineering - 2.0.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Mon Aug 8 2011 Richard W.M. Jones - 2.0.4-1 - New upstream version 2.0.4 (RHBZ#729130). - Upstream build system is much more sane than before, so remove a lot of non-conventional hacks and just use make/make install. * Tue Feb 08 2011 Fedora Release Engineering - 1.45.6-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Wed Aug 12 2009 Richard W.M. Jones - 1.45.6-9 - Improve description (RHBZ#516997). * Fri Jul 24 2009 Fedora Release Engineering - 1.45.6-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Tue Feb 24 2009 Fedora Release Engineering - 1.45.6-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Wed Apr 30 2008 Richard W.M. Jones - 1.45.6-6 - Add runtime requires ocaml-emacs, because tuareg mode uses the file caml-types.el in order to do type annotation (C-c C-t). * Sat Apr 19 2008 Richard W.M. Jones - 1.45.6-5 - Add commas in dependencies & rebuild. * Thu Feb 21 2008 Richard W.M. Jones - 1.45.6-4 - Disable sym-lock in xemacs - this fixes xemacs support. * Wed Feb 20 2008 Richard W.M. Jones - 1.45.6-3 - Reenable support for xemacs. * Tue Feb 19 2008 Richard W.M. Jones - 1.45.6-1 - Initial RPM release.