PortSystem          1.0
PortGroup           ocaml 1.0

name                ocsigen
version             2.1
revision            6
categories          www devel ml
platforms           darwin
license             {LGPL-2.1 OpenSSLException}
maintainers         nomaintainer
description         ocaml based web and application server
long_description    ${description}
homepage            http://ocsigen.org/ocsigenserver/
master_sites        http://ocsigen.org/download/
checksums           rmd160  a32552e49c8a0eaec5c01c9d95c54685df7b093e \
                    sha256  433bf98754c198b1752a8893f52dcb69352e7265dd3634c45eacfdf9702d0cbd

distname            ocsigenserver-${version}

depends_lib         port:ocaml port:ocaml-findlib port:ocaml-react \
                    port:ocaml-ssl port:ocaml-lwt port:ocaml-ocamlnet \
                    port:ocaml-pcre port:ocaml-cryptokit port:ocaml-text \
                    port:tyxml port:ocaml-sqlite3 port:ocaml-zip

post-extract {
    file attributes ${worksrcpath}/configure -permissions +x
}

configure.pre_args  --prefix ${prefix}
configure.args      --with-sqlite --with-camlzip \
                    --temproot ${destroot} \
                    --sysconfdir ${prefix}/etc/${name} \
                    --logdir ${prefix}/var/log/${name} \
                    --staticpagesdir ${prefix}/var/www/${name} \
                    --datadir ${prefix}/var/lib/${name} \
                    --enable-natdynlink \
                    --commandpipe ${prefix}/var/run/ocsigenserver_command \
                    --ocsigen-user _www \
                    --ocsigen-group _www

use_parallel_build  no
build.target        all doc

destroot.target     install install.doc
destroot.asroot     yes

livecheck.type      regex
livecheck.url       http://ocsigen.org/ocsigenserver/install
livecheck.regex     ocsigenserver-(\[0-9.\]+)${extract.suffix}