# $Id: Portfile,v 1.1 2004/02/18 19:27:34 pguyot Exp $

PortSystem			1.0
name				tuareg-mode.el
version				1.41.3
categories			lang editors
maintainers			pguyot@kallisys.net
description			A GNU Emacs/XEmacs major mode for editing Caml and OCaml programs.
long_description	Tuareg is a Caml mode for GNU Emacs  and XEmacs. It handles \
					automatic indentation of Objective Caml and Camllight codes. \
					Key parts of the code are hilighted using Font-Lock. Support \
					to run an interactive Caml toplevel and debbuger is provided.
homepage			http://www-rocq.inria.fr/~acohen/tuareg/
platforms			darwin
distname			tuareg-mode-${version}
use_bzip2			yes
master_sites		http://www-rocq.inria.fr/~acohen/tuareg/mode/
checksums			md5 cd58f6702c6e47dc7bf7ff8673f61777

# We want emacs from DP since this will install stuff in emacs' site-lisp and we want
# it to go into ${prefix}'s site-lisp.
depends_lib			path:${prefix}/bin/emacs:emacs
depends_run			bin:ocaml:ocaml

use_configure		no

build				{
	system "cd ${worksrcpath} && \
		emacs --batch --eval \
			'(progn (setq load-path (cons \".\" load-path)) \
				(byte-compile-file \"tuareg.el\") \
				(byte-compile-file \"camldebug.el\"))'"
}

destroot			{
	file mkdir ${destroot}${prefix}/share/emacs/site-lisp
	xinstall ${worksrcpath}/tuareg.el ${destroot}${prefix}/share/emacs/site-lisp/
	xinstall ${worksrcpath}/tuareg.elc ${destroot}${prefix}/share/emacs/site-lisp/
	xinstall ${worksrcpath}/camldebug.el ${destroot}${prefix}/share/emacs/site-lisp/
	xinstall ${worksrcpath}/camldebug.elc ${destroot}${prefix}/share/emacs/site-lisp/
	xinstall ${worksrcpath}/sym-lock.el ${destroot}${prefix}/share/emacs/site-lisp/
}

post-install {
	ui_msg "To use this, put the following into your ~/.emacs:"
	ui_msg "(setq auto-mode-alist"
	ui_msg "  (cons '(\"\\\\.ml\\\\w?\" . tuareg-mode) auto-mode-alist))"
	ui_msg "(autoload 'tuareg-mode \"tuareg\" \"Major mode for editing Caml code.\" t)"
	ui_msg "(autoload 'camldebug \"cameldeb\" \"Run the Caml debugger.\" t)"
}