# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 57375 2009-09-10 08:16:41Z ryandesign@macports.org $

PortSystem 1.0

name               sml-mode.el
version            4.0
categories         lang editors
maintainers        mcalhoun
description        An EMACS major mode for editing Standard ML
long_description   ${description}
homepage           http://www.iro.umontreal.ca/~monnier/elisp/
platforms          darwin
distname           sml-mode-${version}
master_sites       http://www.iro.umontreal.ca/~monnier/elisp/
checksums \
    md5 dddcadd1ee488a5f70e875e6d20f69fc \
    sha1 6a05274d02f7ea108f4171009c5a4e0989744ddb \
    rmd160 d585bdf15906f272fc1dac6c52f450a694ee823f

depends_lib        port:emacs

use_configure      no
build.target       elcfiles
destroot.target    install_elc install_el prefix=${destroot}${prefix}

variant docs description {Install extra documentation} {
	depends_build-append	path:${prefix}/texi2dvi:texinfo \
        path:${prefix}/makeinfo:texinfo \
        path:${prefix}/texi2dvi:texinfo \
        path:${prefix}/bin/dvips:texlive_base
	
    build.target-append	info dvi postscript
	
    destroot.target-append \
        install_info install_dvi \
        infodir=${destroot}${prefix}/share/info \
        docdir=${destroot}${prefix}/share/doc/${name}-${version}
	
    post-destroot {
		xinstall -m 0755 -d ${destroot}${prefix}/share/doc/${name}-${version}
		eval xinstall -m 0644 [glob ${worksrcpath}/*.ps] ${destroot}${prefix}/share/doc/${name}-${version}
	}
}

post-activate {
    ui_msg "To use this, put the following into your ~/.emacs:"
    ui_msg "(load \"${prefix}/share/emacs/site-lisp/sml-mode/sml-mode-startup\")"
}

livecheck.type  regex
livecheck.regex sml-mode-(\\d+(?:\\.\\d+)*)${extract.suffix}
