# $Id: Portfile 53793 2009-07-14 05:05:41Z ryandesign@macports.org $

PortSystem          1.0
name                caml-camlzip
version             1.04
categories          devel ml
maintainers         erickt openmaintainer
description         Automated code generation for converting OCaml-values to S-expressions
homepage            http://cristal.inria.fr/~xleroy/software.html
platforms           darwin

master_sites        http://caml.inria.fr/distrib/bazar-ocaml
distfiles           camlzip-${version}.tar.gz
worksrcdir          camlzip-${version}

checksums           md5     b3930f4f2e2563b9a5e1b17aa455e635 \
                    sha1    43660307fba6243bf2e2e0c8c6ac078477c9d9f9 \
                    rmd160  37a1aae1f84ee30c5f2f0ee2e4b603bf2b5bf397

depends_lib         port:ocaml port:caml-findlib

patchfiles          Makefile.diff

post-patch {
    file copy ${filespath}/META ${worksrcpath}
}

use_configure       no

build.env           PREFIX=${prefix}
build.target        all allopt


pre-destroot {
    # Set these in pre-destroot so the Portfile can be evaluated on a
    # system without caml-findlib (eg, the portindex server)
    set ocamlfind_destdir ${destroot}[exec ocamlfind printconf destdir]
    destroot.env        OCAMLFIND_INSTFLAGS="-ldconf ignore -destdir $ocamlfind_destdir"
    destroot.target     ocamlfind-install
    file mkdir $ocamlfind_destdir
}

livecheck.check     regex
livecheck.regex     "camlzip-(.*?).tar.gz"
