# $Id: Portfile 92137 2012-04-19 20:29:39Z mww@macports.org $

PortSystem          1.0
PortGroup ocaml 1.0

name                ocaml-dypgen
version             20120419-1
categories          lang devel ml
platforms           darwin
maintainers         mww openmaintainer
description         Self-extensible parsers and lexers for the Objective Caml programming language.
long_description    ${description}
homepage            http://dypgen.free.fr/
master_sites        ${homepage}

distname            dypgen-${version}
use_bzip2           yes

checksums           md5     326fe9b096a4ded6eb95128682eb12cf \
                    sha1    4652cb780a9a821d3e6f5a64892b386d947b7907 \
                    rmd160  66a8f04314648429e72936abea91fc95b4ce3fa7

depends_lib         port:ocaml-findlib \
                    port:ocaml

worksrcdir          dypgen

patchfiles          patch-Makefile.diff patch-dyplib-Makefile.diff

configure {
    reinplace "s|@ocamlfind@|${ocamlfind_wrapper}|g" ${worksrcpath}/dyplib/Makefile
}

use_configure       no

use_parallel_build  no

build.target        dyp

destroot.args       BINDIR=${prefix}/bin MANDIR=${prefix}/share/man/man1

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/examples \
        ${destroot}${prefix}/share/doc/${name}
    file copy ${worksrcpath}/demos ${destroot}${prefix}/share/examples/${name}
    xinstall -m 644 -W ${worksrcpath} dypgen-doc.pdf CHANGES \
        CREDITS INSTALL Licence_CeCILL-B_V1-en.txt Licence_CeCILL-B_V1-fr.txt \
        ${destroot}${prefix}/share/doc/${name}
}

livecheck.type      regex
livecheck.url       http://dypgen.free.fr/download.html
livecheck.regex     dypgen-(\[0-9.-\]+).tar.bz2
