# -*- 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           bitbucket 1.0

bitbucket.setup     mahlon volta 0.3.0
bitbucket.tarball_from downloads
categories          www net
platforms           darwin
maintainers         nomaintainer
license             BSD

description         a high performance Squid compatible URI redirector

long_description    Volta is a high performance, low resource URI rewriter \
                    for use with the Squid caching proxy server (or \
                    alternatively Polipo!) With it, you can dynamically alter \
                    URI requests on various criteria. It uses a finite state \
                    machine to parse URIs and rules, and a constant database \
                    for storage. It can perform conditional rewrites \
                    internally or by evaluating Lua scripts.

extract.suffix      .tgz

checksums           rmd160  6904a79e1ae709189abb0703de2f7194ee5bbbb2 \
                    sha256  499e2ba9167b2b1663790961f13d1289bfcb9339d2032b7e2076314bc96fba5c

depends_build       port:pkgconfig \
                    port:tinycdb

depends_lib         port:lua

use_configure       no

variant universal {}

build.target        ${name}

build.args          CC="${configure.cc} [get_canonical_archflags cc]"

destroot {
    xinstall -m 755 ${worksrcpath}/volta ${destroot}${prefix}/bin/
    
    set docdir ${prefix}/share/doc/${subport}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        ChangeLog \
        LICENSE \
        README \
        ${destroot}${docdir}
}

livecheck.type      regex
livecheck.regex     /${name}-(\[0-9.\]+)${extract.suffix}