# -*- 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           python 1.0
PortGroup           select 1.0
PortGroup           github 1.0

github.setup        eliben pss 1.43 v
github.tarball_from archive
revision            0
name                py-pss

categories-append   devel
license             public-domain
supported_archs     noarch
platforms           {darwin any}
maintainers         nomaintainer

description         pss is a tool for grepping through source code
long_description    {*}${description}

checksums           rmd160  54b3ecd5a239ec59d298b4ee9b2903ceb0bb8c8b \
                    sha256  5c258ae8e0f730098d81b7ecc660151eb3f2528a8042982a30db8d1a180c0369 \
                    size    42886

python.versions     37 38

if {${name} ne ${subport}} {
    depends_build-append \
                    port:py${python.version}-setuptools

    if {${python.version} < 38} {
        depends_run-append \
                    port:py${python.version}-importlib-metadata
    }

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

    depends_run     port:py-pss_select
    select.group    py-pss
    select.file     ${filespath}/py${python.version}-pss

    notes "
To make the Python ${python.branch} version of py-pss the one that is run\
when you execute the commands without a version suffix, e.g. 'pss', run:

port select --set ${select.group} [file tail ${select.file}]
"
}
