# This is an RPM spec file that specifies how to package # haskell-mode for Red Hat Linux and, possibly, similar systems. # It has been tested on Red Hat Linux 7.2. # # If this file is part of a tarball, you can build RPMs directly from # the tarball by using the following command: # # rpm -ta haskell-mode-(VERSION).tar.gz # # The resulting package will be placed in the RPMS/noarch subdirectory # of your RPM build directory (usually /usr/src/redhat or ~/rpm), with # the name emacs-haskell-mode-(VERSION)-(RELEASE).noarch.rpm. A # corresponding source RPM package will be in the SRPMS subdirectory. # # NOTE TO HASKELL MODE MAINTAINERS: When you release a new version of # Haskell mode, update the version definition below to match the # version label of your release tarball. %define name emacs-haskell-mode %define version 1.43 %define release 4align Summary: Haskell editing mode for Emacs Name: %{name} Version: %{version} Release: %{release} Copyright: GPL (?) Group: Applications/Editors Source: http://www.haskell.org/haskell-mode/haskell-mode-%{version}.tar.gz URL: http://www.haskell.org/haskell-mode/ Packager: Tom Moertel BuildRoot: %{_tmppath}/%{name}-root Prefix: %{_prefix} BuildArchitectures: noarch BuildRequires: emacs Requires: emacs Patch0: haskell-mode-align-column.patch Patch1: haskell-mode-prompt.patch %description This package adds a Haskell major mode to Emacs. The Haskell mode supports font locking, declaration scanning, documentation, indentation, and interaction with Hugs and GHCi. The basic mode was written by Graeme E Moss, Tommy Thorn and Simon Marlow. The modules that provide additional features are maintained by their respective authors. %prep %setup -n haskell-mode-%{version} %patch0 %patch1 %build # byte-compile all the .el files for better performance emacs -batch -f batch-byte-compile *.el # create an init file that is loaded when a user starts up emacs to # tell emacs to use Haskell mode for editing Haskell files cat > haskell-mode-init.el <<"EOF" ;;; Set up Haskell mode for Emacs. ;;; ;;; This file is automatically loaded by emacs's site-start.el ;;; when you start a new emacs session. (setq auto-mode-alist (append auto-mode-alist '(("\\.[hg]s\\'" . haskell-mode) ("\\.hi\\'" . haskell-mode) ("\\.l[hg]s\\'" . literate-haskell-mode)))) (autoload 'haskell-mode "haskell-mode" "Major mode for editing Haskell scripts." t) (autoload 'literate-haskell-mode "haskell-mode" "Major mode for editing literate Haskell scripts." t) (add-hook 'haskell-mode-hook 'turn-on-haskell-font-lock) (add-hook 'haskell-mode-hook 'turn-on-haskell-decl-scan) (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode) (add-hook 'haskell-mode-hook 'turn-on-haskell-indent) ;; can't have above and this: (add-hook 'haskell-mode-hook ;; 'turn-on-haskell-simple-indent) ; use Hugs for interactive Haskell (add-hook 'haskell-mode-hook 'turn-on-haskell-hugs) EOF # create a README.RPM file to document any quirks of this package cat > README.RPM < EOF %install rm -rf ${RPM_BUILD_ROOT} INSTDIR=${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp/haskell-mode-%{version} install -d $INSTDIR install *.elc $INSTDIR INITDIR=${RPM_BUILD_ROOT}%{_datadir}/emacs/site-lisp/site-start.d install -D haskell-mode-init.el $INITDIR/haskell-mode-init.el # Uncomment to print the README file after install. # # %post # echo # cat %{_defaultdocdir}/%{name}-%{version}/README.RPM # echo %clean rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,root) %doc README.RPM *.html %dir %{_datadir}/emacs/site-lisp/haskell-mode-%{version} %{_datadir}/emacs/site-lisp/haskell-mode-%{version}/* %{_datadir}/emacs/site-lisp/site-start.d/* %changelog * Mon Sep 2 2002 - Revised patch to handle ModuleA ModuleB ... > prompts * Sat Aug 31 2002 - Added patch to handle new *ModuleName> prompts * Tue Jul 23 2002 - Added support for aligning rhsides on a given column. * Fri Mar 22 2002 Tom Moertel - Created spec file - Added README.RPM - Added site-lisp/site-start.d init file for emacs-haskell-mode.