# -*- 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 78772 2011-05-21 19:58:31Z mcalhoun@macports.org $

PortSystem 1.0

name               sml-mode.el
version            4.1
categories         lang editors
maintainers        mcalhoun openmaintainer
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 70ace31a95cdc4de99b02adcd3c0d098 \
    sha1 d28a4dd7051bf843305bd73855f169f92134c64d \
    rmd160 303332d3ed84180320df96d0ba978afdb76cf268

supported_archs    noarch

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-basic
	
    build.target-append	info dvi postscript
	
    destroot.target-append \
        install_info install_dvi \
        infodir=${destroot}${prefix}/share/info \
        docdir=${destroot}${prefix}/share/doc/${name}
	
    post-destroot {
		xinstall -m 0755 -d ${destroot}${prefix}/share/doc/${name}
		eval xinstall -m 0644 [glob ${worksrcpath}/*.ps] ${destroot}${prefix}/share/doc/${name}
	}
}

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

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