# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           php 1.1

name                php-mongodb
categories          php databases devel
platforms           darwin
maintainers         {ryandesign @ryandesign} openmaintainer
license             Apache-2

php.branches        5.3 5.4 5.5 5.6 7.0 7.1 7.2
php.pecl            yes

if {[vercmp ${php.branch} 5.5] >= 0} {
    version         1.5.3
    revision        0
    checksums       rmd160  6a2e8f85687c068402d72b7d85df640c5bb5b30e \
                    sha256  8def2c74aa28e64839dee4b878bc92ad9164a45d84f55b519ac92f338ff8e1ba \
                    size    1059580
} elseif {[vercmp ${php.branch} 5.4] >= 0} {
    version         1.2.11
    revision        0
    checksums       rmd160  dc35e448324877d8c56be9c6bb1a3f8fa8b9ccc7 \
                    sha256  bac347be2277dd64b1b6f414234a6057eccf2d208409ce60973107a41267df49 \
                    size    786669
} else {
    version         1.1.0
    revision        0
    checksums       rmd160  63ac89588ee5912177fdb73b959b86d6dab8596e \
                    sha256  33b92909c2f9584d8c6cfd0bd0438092f0d09a019241ef100813203620612b71 \
                    size    630585
}

description         MongoDB Database Driver

long_description    This package provides a PHP interface for communicating \
                    with MongoDB database servers.

if {${name} ne ${subport}} {
    depends_build-append    port:cyrus-sasl2 \
                            path:lib/libssl.dylib:openssl

    configure.args-append   --enable-mongodb \
                            --with-mongodb-sasl=${prefix} \
                            --with-openssl-dir=${prefix}
}