# -*- 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                bahamut
conflicts           expect whois
version             2.0.7
revision            2
maintainers         ryandesign openmaintainer
categories          irc
platforms           darwin
license             GPL

description         Bahamut is an Internet Relay Chat Daemon (IRCd) designed for DALnet.

long_description    ${description}

homepage            http://www.dal.net/?page=Bahamut
master_sites        http://code.dal.net/release/

checksums           rmd160  4280b8229a99d56e1334e6fc68023661a2a35ad5 \
                    sha256  4c085425c31c48b241b63a85bc693510732051b79636b341cdc4f1ee534dc4b8

depends_lib         path:lib/libssl.dylib:openssl

patchfiles          patch-CPPFLAGS.diff \
                    patch-support.c.diff

# Undefined symbols:
#  "_first_visible_channel", referenced from:
#      _m_who in m_who.o
patchfiles-append   patch-src-m_who.c.diff

configure.args      --enable-openssl=${prefix}

configure.universal_args-delete --disable-dependency-tracking

destroot.destdir    INSTALL_DIR=${destroot}${prefix}

post-destroot {
    foreach f {ircd mkpasswd make-cert.sh} {
        move ${destroot}${prefix}/${f} ${destroot}${prefix}/bin
    }
    foreach f {ircd.motd make-cert.cnf opers.txt reference.conf template.conf} {
        move ${destroot}${prefix}/${f} ${destroot}${prefix}/etc
    }
    reinplace "s|${destroot}${prefix}|${prefix}/etc|g" ${destroot}${prefix}/bin/make-cert.sh
}

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