# $Id$

PortSystem 1.0

name                ocaml-extlib
version             1.6.1
revision            1
categories          devel ml
maintainers         mww openmaintainer
license             LGPL-2.1
description         Extended Standard Library for OCaml
long_description    A User-supported Extended Standard Library for OCaml
homepage            http://code.google.com/p/ocaml-extlib/
platforms           darwin
master_sites        googlecode:ocaml-extlib

checksums           rmd160  4d92f55e71ee6effe58b07126458caa118472aa3 \
                    sha256  88d4b3638cb4da4e04d81ba157e7235e744373c5784cf4b906570d07b890aeca
distname            extlib-${version}

depends_build       port:ocaml-camlp4
depends_lib         port:ocaml port:ocaml-findlib

patchfiles          patch-install.ml

use_configure       no

build {}

destroot.cmd        "${prefix}/bin/ocaml"
destroot.pre_args   install.ml
destroot.args       -b -n -doc -min
destroot.post_args

pre-destroot {
        set extlib_destdir ${destroot}[exec ${prefix}/bin/ocamlfind printconf destdir]
        xinstall -m 755 -d ${extlib_destdir}
        reinplace s|##PREFIX##|${prefix}| ${worksrcpath}/install.ml
        reinplace s|##DESTDIR##|${extlib_destdir}| ${worksrcpath}/install.ml
}

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc
    file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
}