Blob Blame History Raw
%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.6
Release:        1%{?dist}
Summary:        Emacs and XEmacs mode for editing ocaml

License:        GPLv2+
URL:            https://forge.ocamlcore.org/projects/tuareg/
Source0:        https://forge.ocamlcore.org/frs/download.php/882/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}

%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 emacs-%{pkg}-el
Summary:        Elisp source files for %{pkgname} under GNU Emacs
Requires:       emacs-%{pkg} = %{version}-%{release}

%description -n emacs-%{pkg}-el
This package contains the elisp source files for %{pkgname} under GNU
Emacs. You do not need to install this package to run
%{pkgname}. Install the emacs-%{pkg} package to use %{pkgname} with
GNU 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}

%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.


%package -n xemacs-%{pkg}-el
Summary:        Elisp source files for %{pkgname} under XEmacs
Requires:       xemacs-%{pkg} = %{version}-%{release}

%description -n xemacs-%{pkg}-el
This package contains the elisp source files for %{pkgname} under
XEmacs. You do not need to install this package to run
%{pkgname}. Install the xemacs-%{pkg} package to use %{pkgname} with
XEmacs.


%prep
%setup -q -n %{pkg}-%{version}


%build
make

# 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 tuareg-site-file.el


%files -n emacs-%{pkg}
%doc COPYING
%{emacs_lispdir}/%{pkg}/*.elc
%{emacs_lispdir}/%{pkg}/version
#%{emacs_startdir}/*.el
%dir %{emacs_lispdir}/%{pkg}


%files -n emacs-%{pkg}-el
%doc COPYING
%{emacs_lispdir}/%{pkg}/*.el


%files -n xemacs-%{pkg}
%doc COPYING
%{xemacs_lispdir}/%{pkg}/*.elc
%{xemacs_lispdir}/%{pkg}/version
#%{xemacs_startdir}/*.el
%dir %{xemacs_lispdir}/%{pkg}


%files -n xemacs-%{pkg}-el
%doc COPYING
%{xemacs_lispdir}/%{pkg}/*.el


%changelog
* Sun Sep 15 2013 Richard W.M. Jones <rjones@redhat.com> - 2.0.6-1
- New upstream version 2.0.6.
- Modernize the spec file.

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Mon Aug  8 2011 Richard W.M. Jones <rjones@redhat.com> - 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 <rel-eng@lists.fedoraproject.org> - 1.45.6-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Aug 12 2009 Richard W.M. Jones <rjones@redhat.com> - 1.45.6-9
- Improve description (RHBZ#516997).

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.45.6-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.45.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Wed Apr 30 2008 Richard W.M. Jones <rjones@redhat.com> - 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 <rjones@redhat.com> - 1.45.6-5
- Add commas in dependencies & rebuild.

* Thu Feb 21 2008 Richard W.M. Jones <rjones@redhat.com> - 1.45.6-4
- Disable sym-lock in xemacs - this fixes xemacs support.

* Wed Feb 20 2008 Richard W.M. Jones <rjones@redhat.com> - 1.45.6-3
- Reenable support for xemacs.

* Tue Feb 19 2008 Richard W.M. Jones <rjones@redhat.com> - 1.45.6-1
- Initial RPM release.