# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=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         Thrift 0.20.0
platforms           {darwin any}
maintainers         nomaintainer
license             BSD
supported_archs     noarch

description         Perl implementation of Thrift serialization library

long_description    Thrift is a software framework for scalable cross-language \
                    services development. It combines a software stack with a code \
                    generation engine to build services that work efficiently and \
                    seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, \
                    Haskell, C#, Cocoa, Smalltalk, and OCaml.

homepage            https://thrift.apache.org/
master_sites        apache:thrift/${version}
dist_subdir         thrift
distname            thrift-${version}

# NOTE: This port must be kept at the same version as port:thrift and port:py-thrift
checksums           rmd160  169129427960bb83cd4763cfe371923609d66e0d \
                    sha256  b5d8311a779470e1502c027f428a1db542f5c051c8e1280ccd2163fa935ff2d6 \
                    size    4397667
revision            0

if {${perl5.major} != ""} {
    configure.dir   ${worksrcpath}/lib/perl
    build.dir       ${configure.dir}
    test.dir        ${configure.dir}
    destroot.dir    ${configure.dir}

    depends_build-append \
                    port:p${perl5.major}-test-exception

    depends_lib-append \
                    port:thrift \
                    port:p${perl5.major}-bit-vector \
                    port:p${perl5.major}-class-accessor

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 644 -W ${worksrcpath} \
            CHANGES.md \
            LICENSE \
            NOTICE \
            README.md \
            ${destroot}${docdir}
    }
}

livecheck.type      regex
livecheck.url       https://downloads.apache.org/thrift/
livecheck.regex     {(\d+(?:\.\d+)*)/}
