# $Id: Portfile 106417 2013-05-25 15:58:56Z mww@macports.org $

PortSystem 1.0

name                ocaml-extlib
version             1.5.4
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           md5     329041625309b9e49051e5b097a9185d \
                    rmd160  15d038abb9a2d5a8cab2d9c51035f7ab9120b345 \
                    sha256  df142ba5a04ccbd4b239a124bd0f634989781b4da63e517c05a036fd419cd9cd
distname            extlib-${version}

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
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}/extlib-doc ${destroot}${prefix}/share/doc/${name}
}
