# $Id: Portfile 59973 2009-10-28 07:05:26Z pguyot@kallisys.net $

PortSystem			1.0
name				ocaml-mode.el
version				3.05
categories			lang editors ml
maintainers			nomaintainer
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 MacPorts 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)"
}

livecheck.type		regex
livecheck.regex		{<A HREF="dist/ocaml-mode-(.*).tar.gz">Ocaml-mode \1</A>}
