PortSystem      1.0

name            infobot
version         0.45.3
revision        1
categories      irc
license         {Artistic-1 GPL}
maintainers     nomaintainer
supported_archs noarch

description     IRC Bot written in Perl with a rabid AI
long_description        The infobot connects to an Internet Relay Chat (IRC) server, joins \
                        some channels (maybe), and begins accumulating factoids. To run one, \
                        download the source, uncompress it, untar it, edit the config files, \
                        and it up.

platforms       darwin freebsd
homepage        http://www.infobot.org/
master_sites    ${homepage}src/
checksums       md5 897a005182928613eadd30c267ce9c5b
use_configure   no
build           {}

destroot {
    xinstall ${filespath}/infobot.in ${destroot}${prefix}/bin/infobot
    reinplace "s|@PREFIX@|${prefix}|g" ${destroot}${prefix}/bin/infobot
    xinstall -d ${destroot}${prefix}/share
    copy ${worksrcpath} ${destroot}${prefix}/share/infobot
}

pre-activate {
    # infobot @0.45.3_0 installed files outside the destroot; remove them if found
    foreach file {bin/infobot} {
        set filepath ${prefix}/${file}
        if {[file exists ${filepath}] && [registry_file_registered ${filepath}] == "0"} {
            if {[catch {delete ${filepath}}]} {
                ui_warn "Cannot delete ${filepath}; please remove it manually"
            }
        }
    }
}
