sml-mode / sml-mode.spec

%define lispdir		%{_datadir}/emacs/site-lisp
%define startupfile	%{lispdir}/site-start.el

Summary:	Emacs mode for editing Standard ML source code
Name:		sml-mode
Version:	$Name$
Release:	0.1
Group:		Applications/Editors
Copyright:	GPL
Packager:	Stefan Monnier
Source:		ftp://flint.cs.yale.edu/pub/monnier/%{name}/%{name}.tar.gz
Buildroot:	%{_tmppath}/%{name}-buildroot
BuildPreReq:	emacs >= 20 xemacs >= 21
BuildArch:	noarch

%description
SML-MODE is a major Emacs mode for editing Standard ML. It provides
syntax highlighting and automatic indentation and comes with sml-proc
which allows interaction with an inferior SML interactive loop.

%prep
%setup -q -n %{name}

%install
make install \
  prefix=%{buildroot}%{_prefix} \
  infodir=%{buildroot}%{_infodir} \
  lispdir=%{buildroot}%{lispdir}
gzip -9f %{buildroot}%{lispdir}/sml-mode/*.el

texi2pdf sml-mode.texi

%post
cat >> %{lispdir}/site-start.el <<EOF
;; sml-mode-start
;; This section was automatically generated by rpm
(load "sml-mode-startup")
;; End of automatically generated section
;; sml-mode-end
EOF

/sbin/install-info %{_infodir}/sml-mode.info.gz %{_infodir}/dir

%postun
ed -s %{lispdir}/site-start.el <<EOF
/^;; sml-mode-start$/,/^;; sml-mode-end$/d
wq
EOF

/sbin/install-info --delete %{_infodir}/sml-mode.info.gz %{_infodir}/dir \
    --section=Emacs \
    --entry="* SML: (sml-mode).    Editing & Running Standard ML from Emacs"

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc BUGS ChangeLog INSTALL NEWS README TODO
%doc sml-mode.texi sml-mode.pdf
%doc %{_infodir}/*.info*
%dir %{lispdir}/%{name}
%{lispdir}/%{name}/*.elc
%{lispdir}/%{name}/*.el
%{lispdir}/%{name}/*.el.*

%changelog
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.