# -*- 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
PortGroup           perl5 1.0

perl5.branches      5.28 5.30 5.32 5.34
perl5.setup         Net-Dict 2.23 ../../authors/id/N/NE/NEILB/
revision            0
categories-append   textproc
license             {Artistic-1 GPL}
maintainers         nomaintainer
description         Net::Dict - client API for accessing dictionary servers (RFC 2229)
long_description    {*}${description}

platforms           {darwin any}
supported_archs     noarch

checksums           rmd160  426252d694b1d5b0cfdae3323ba72d442aa19ef1 \
                    sha256  287016ac531f7bc06016d616e1b359a7f3861655d6e5bee6c1348284723d74df \
                    size    46356

if {${perl5.major} != ""} {
    depends_build-append \
                    port:p${perl5.major}-test-differences \
                    port:p${perl5.major}-test-requiresinternet
    
    depends_lib-append \
                    port:p${perl5.major}-appconfig-std

    # This variant avoids a conflict with the dict port, if one wishes to
    # install p5-net-dict together with the dict port. The end user can
    # later add symbolic links in /usr/local or in his home directory to
    # choose which dict program (and man page) he wishes to use. For this
    # reason, the dict documentation is not modified to reflect this new
    # program name.
    # Even though there is no filename conflict for the man page, it is
    # better to rename it too for consistency when running "man dict".
    # Even "man 1 dict" would select the dict.1pm version.
    variant dict_altname description {Avoid a conflict with the dict port} {
        post-destroot {
            set d ${destroot}${prefix}
            set m ${d}/share/man/man1
            file rename ${d}/bin/dict ${d}/bin/dict.perl
            file rename ${m}/dict.1pm ${m}/dict.perl.1pm
        }
    }
}
