# $Id: Portfile 40948 2008-10-18 20:05:04Z ryandesign@macports.org $

PortSystem          1.0

name                caml-pgocaml
version             1.1
categories          devel ocaml
maintainers         landonf openmaintainer
description         Type-safe OCaml-interface to the PostgreSQL-database
long_description    PG'OCaml is a type-safe, simple interface to PostgreSQL \
                    from OCaml. It lets you embed SQL statements directly \
                    into OCaml code.

homepage            http://developer.berlios.de/projects/pgocaml/
platforms           darwin
master_sites        http://download.berlios.de/pgocaml/

distname            pgocaml-${version}

checksums           md5 e52d0f88b4ce850aa592a033c7e7b64d \
                    sha1 6f0daa89777a8b93380ad0857b50efc996df322e \
                    rmd160 625caad4c1f5eeda00374f34a1bbe1ce06ee066b

depends_lib         port:ocaml \
                    port:caml-findlib \
                    port:caml-calendar \
                    port:caml-csv \
                    port:caml-pcre

patchfiles          patch-Makefile

post-patch {
    set ocaml_site_path [exec ocamlfind printconf destdir]

    reinplace       "s|ocamlfind install|ocamlfind install -destdir ${destroot}/${ocaml_site_path}|g" \
                    ${worksrcpath}/Makefile
}

pre-destroot {
    set ocaml_site_path [exec ocamlfind printconf destdir]
    file mkdir ${destroot}/${ocaml_site_path}
}

destroot.target     findlib_install

use_configure        no
