# -*- 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                maildrop
version             3.1.6
revision            0
checksums           rmd160  bd753fb9cfb12c5c75382ebc55d0345c869cfd62 \
                    sha256  e78b04041b7c1d46fd9b248323877f80dc1e4223d9f06f3dc77f0a8f0cd3adfd \
                    size    2156136

categories          mail
license             {GPL-3 OpenSSLException}
maintainers         nomaintainer
description         Mail delivery agent (MDA) with filtering abilities
long_description    {*}${description}
homepage            https://www.courier-mta.org/maildrop/
master_sites        sourceforge:project/courier/maildrop/${version}/
use_bzip2           yes

depends_build-append \
                    port:pkgconfig

depends_lib-append  port:courier-unicode \
                    port:gdbm \
                    port:libidn2 \
                    port:pcre2

# courier-unicode needs C++11 or later
compiler.cxx_standard 2011
configure.cxxflags-append -std=c++11

set etcdir          ${prefix}/etc
configure.args      --with-etcdir=${etcdir} \
                    --enable-syslog=1

variant vpopmail description {For use with vpopmail} {
    configure.args-append    --enable-maildrop-gid=vchkpw
}

variant qmail description {For use with qmail-spamcontrol} {
    depends_lib-append       port:qmail-spamcontrol
    configure.args-append    --enable-sendmail=${prefix}/var/qmail/bin/sendmail
}

pre-configure {
    if {[variant_isset vpopmail]} {
        addgroup vchkpw gid=2109
    }
}

notes "
The default maildrop mailfilter is in the ${etcdir} directory.
"

livecheck.regex     {maildrop-([0-9]+\.[0-9]+\.[0-9]+)\.tar\.bz2}
