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

name                mod_qos
version             11.75
revision            0
categories          www
license             Apache-2
maintainers         nomaintainer
description         mod_qos is a quality of service module for the Apache web server
long_description    {*}${description} implementing control mechanisms that can provide \
                    different levels of priority to different HTTP requests.
homepage            http://mod-qos.sourceforge.net/index.html
master_sites        sourceforge:project/mod-qos/

checksums           rmd160  a370e290acdf694027c9839b3de26adf689de0bf \
                    sha256  acc7b457399a8a33e0e06638a98b40e5abf3139e09bd9eda85faf6cfb52030b2 \
                    size    1289194

depends_build       port:autoconf \
                    port:automake

depends_lib         port:apache2 \
                    port:db48 \
                    port:libpng \
                    path:lib/libssl.dylib:openssl \
                    port:pcre2

patchfiles          patch-tools-Makefile.in.diff

configure.dir       ${worksrcpath}/tools
configure.env       LDFLAGS=-L${prefix}/lib/db48
build.dir           ${configure.dir}

pre-configure { copy ${filespath}/aclocal.m4 ${worksrcpath}/tools }

use_autoreconf      yes
autoreconf.dir      ${configure.dir}

set apxs            ${prefix}/bin/apxs
set mdir            ${destroot}${prefix}/lib/apache2/modules/

post-build {
   system -W ${worksrcpath}/apache2 "${apxs} -c mod_qos.c -lcrypto -lpcre"
}

pre-destroot {
   xinstall -m 755 -d ${mdir}
}

post-destroot {
    xinstall -m 755 ${worksrcpath}/apache2/.libs/mod_qos.so ${mdir}
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/images
    xinstall -m 644 {*}[glob -type f ${worksrcpath}/doc/*] \
        ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 {*}[glob ${worksrcpath}/doc/images/*] \
        ${destroot}${prefix}/share/doc/${name}/images
}

livecheck.type      regex
livecheck.url       https://sourceforge.net/projects/mod-qos/rss
livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}
