# $Id: Portfile 60452 2009-11-12 23:28:18Z ryandesign@macports.org $

PortSystem          1.0

name                caml-xmlm
version             1.0.2
categories          devel ml textproc
maintainers         mww openmaintainer
platforms           darwin
license             BSD
description         streaming XML input/output module for OCaml
long_description    Xmlm is an OCaml module providing streaming XML \
                    input/output. It aims at making XML processing robust and \
                    painless. The streaming interface can process documents \
                    without building an in-memory representation. It lets the \
                    programmer translate its data structures to XML documents \
                    and vice-versa. Functions are provided to easily transform \
                    arborescent data structures to/from XML documents.

homepage            http://erratique.ch/software/xmlm
master_sites        http://erratique.ch/software/xmlm/releases/

distname            xmlm-${version}
use_bzip2           yes
extract.suffix      .tbz

checksums           md5     8c891f84b6e64892445071b7706ba1a2 \
                    sha1    051ec8bbffbf2d720e5bc5a845cbf300f3f5f61f \
                    rmd160  e1feec0805e43e2e15ac7386b0e5d2375d44fe81

depends_lib         port:ocaml \
                    port:caml-findlib

use_configure       no

build.cmd           ./build
build.target

destroot {
    set ocaml_site_path [exec ocamlfind printconf destdir]
    system "cd ${worksrcpath} && INSTALLDIR=${destroot}${ocaml_site_path}/xmlm ./build install"
    xinstall -m 755 -d ${destroot}${prefix}/share/doc
    file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} CHANGES README \
        ${destroot}${prefix}/share/doc/${name}
}

