# $Id: Portfile 98499 2012-10-07 11:42:35Z mww@macports.org $

PortSystem          1.0
PortGroup           ocaml 1.0

name                ocaml-text
version             0.6
revision            2
categories          devel ml
license             BSD
platforms           darwin
maintainers         mww openmaintainer
description         library for Unicode text in OCaml
long_description    OCaml-Text is a library for dealing with text, \
                    i.e. sequence of unicode characters, in a convenient way.
homepage            http://forge.ocamlcore.org/projects/ocaml-text/
master_sites        http://forge.ocamlcore.org/frs/download.php/937/

depends_lib         port:ocaml port:ocaml-findlib port:ocaml-pcre port:libiconv

checksums           rmd160  3044869456e099d755ace144266eed7aaeda4f22 \
                    sha256  cfd4d224ec0b776ce462c5ba5cb6e4eae8cf397ede6d3b91add44a05a6520f49

patchfiles          patch-setup.ml.diff
post-patch {
    reinplace "s|@prefix@|${prefix}|g" ${worksrcpath}/setup.ml
}

use_oasis           yes
use_oasis_doc       yes

configure.args-append --override pcre true --override datarootdir ${destroot}${prefix}/share

livecheck.type      regex
livecheck.url       http://forge.ocamlcore.org/frs/?group_id=100
livecheck.regex     {>ocaml-text-(.*)\.tar\.gz}

pre-activate {
    if { [file exists ${prefix}/share/doc/ocaml-text] } {
        delete ${prefix}/share/doc/ocaml-text
    }
}

