PortSystem          1.0
PortGroup ocaml 1.0

name                ocaml-dypgen
version             20120619-1
revision            4
categories          lang devel ocaml
platforms           darwin
license             CeCILL-B
maintainers         nomaintainer
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           rmd160  c5e9bd52d964c0cd2a68780d40f28735700bb747 \
                    sha256  ecb53d6e469e9ec4d57ee6323ff498d45b78883ae13618492488e7c5151fdd97

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