# -*- 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                ngircd
version             26.1
revision            1

categories          irc
platforms           darwin
license             GPL-2+
maintainers         nomaintainer

description         next generation IRC daemon
long_description    ngIRCd is a free open source daemon for Internet \
                    Relay Chat (IRC). It's written from scratch and is \
                    not based upon the original IRCd like many others.

homepage            http://ngircd.barton.de/
master_sites        http://arthur.barton.de/pub/ngircd/
use_xz              yes

checksums           rmd160  097809c717fdb296bd783556324de33ccfd8fdee \
                    sha256  55c16fd26009f6fc6a007df4efac87a02e122f680612cda1ce26e17a18d86254 \
                    size    375812

depends_lib         port:libiconv \
                    port:libident \
                    port:tcp_wrappers \
                    port:zlib

patchfiles          patch-contrib-MacOSX-Makefile.in.diff \
                    patch-doc-Makefile.in.diff

configure.args      --enable-ipv6 \
                    --enable-sniffer \
                    --with-tcp-wrappers \
                    --with-iconv \
                    --with-ident

# It's easier to create our own startup item than to patch and install
# the provided plist.
startupitem.create      yes
startupitem.executable  ${prefix}/sbin/ngircd --nodaemon
startupitem.logfile     ${prefix}/var/log/ngIRCd.log
startupitem.logevents   yes

post-activate {
    if {![file exists ${prefix}/etc/ngircd.conf]} {
        xinstall -m 0644 ${prefix}/share/doc/${name}/sample-ngircd.conf \
            ${prefix}/etc/ngircd.conf
    }
}

variant gnutls conflicts openssl description {Build with GnuTLS} {
    configure.args-append   --with-gnutls
    depends_lib-append      path:lib/pkgconfig/gnutls.pc:gnutls
}

variant openssl conflicts gnutls description {Build with OpenSSL} {
    configure.args-append   --with-openssl
    depends_lib-append      path:lib/libssl.dylib:openssl
}

if {![variant_isset gnutls]} {
    default_variants        +openssl
}

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