# $Id: Portfile,v 1.2 2004/02/18 19:30:02 pguyot Exp $

PortSystem			1.0
name				ocaml-mode.el
version				3.05
categories			lang editors
maintainers			pguyot@kallisys.net
description			An EMACS major mode for editing OCaml programs.
long_description	${description}
homepage			http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/ocaml.html
platforms			darwin
distname			ocaml-mode-${version}
master_sites		http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/dist/
checksums			md5 ace102dfb75a20e15a60d962cc3a5edb

# 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

patchfiles			patch-Makefile

post-patch {
	reinplace "s|__DESTROOT|${destroot}|g" ${worksrcpath}/Makefile
}

use_configure		no
build				{}

destroot.args		SCRIPTDIR=${destroot}${prefix}/bin

post-install {
	ui_msg "To use this, put the following into your ~/.emacs:"
	ui_msg "(setq auto-mode-alist"
	ui_msg "  (cons '(\"\\\\.ml\[iylp\]?$\" . caml-mode) auto-mode-alist))"
	ui_msg "(autoload 'caml-mode \"caml\" \"Major mode for editing Caml code.\" t)"
	ui_msg "(autoload 'run-caml \"inf-caml\" \"Run an inferior Caml process.\" t)"
}