# -*- 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
# $Id: Portfile 84550 2011-09-27 21:05:11Z snc@macports.org $

PortSystem          1.0

set version_mysql   5
name                dbslayer
version             beta-12
categories          databases lang www
maintainers         pixilla
platforms           darwin
license             Apache-2.0

description         The DBacesslayer aka DBSlayer is a lightweight database abstraction layer \
                    suitable for high-load websites where you need the scalable advantages of \
                    connection pooling.
long_description    ${description} Written in C for speed, DBSlayer talks to clients via JSON over \
                    HTTP, meaning it's simple to monitor and can swiftly interoperate with any web \
                    framework you choose.

homepage            http://code.nytimes.com/projects/dbslayer/wiki
master_sites        http://code.nytimes.com/downloads/

patchfiles          patch-configure.ac.diff

checksums           sha1    fbf1c5563a6ee45783e31f6b49612e64fc141186 \
                    rmd160  439414996072ce36c7361d1188ebe115c70e0151

worksrcdir          ${name}

depends_lib-append  port:apr-util \
                    path:${prefix}/lib/mysql${version_mysql}/bin/mysql_config:mysql${version_mysql}

extract.suffix      .tgz

post-extract {
    foreach svn_dirs [glob -nocomplain -path ${worksrcpath}/ -type d .svn */.svn */*/.svn ] {
        delete $svn_dirs
    }
}
use_autoreconf      yes

configure.args      --with-mysql-config=${prefix}/bin/mysql_config${version_mysql} \
                    --with-apr-1-config=${prefix}/bin/apr-1-config \
                    --with-apu-1-config=${prefix}/bin/apu-1-config

post-destroot {
    xinstall -d ${destroot}${prefix}/share/${name}
    copy ${worksrcpath}/htdocs \
            ${destroot}${prefix}/share/${name}
    copy ${worksrcpath}/test \
            ${destroot}${prefix}/share/${name}
}


livecheck.url       ${master_sites}
livecheck.type      regex
livecheck.regex     ">${name}-((?!\${extract.suffix}).*)${extract.suffix}<"
