# -*- 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

name                py-fdsnwsscripts
version             2023.191
revision            1
categories-append   science
platforms           {darwin any}
supported_archs     noarch
license             GPL-3
maintainers         {petr @petrrr} openmaintainer

description         Scripts for working with (EIDA) FDSN web services
long_description    {*}${description}

homepage            https://geofon.gfz-potsdam.de/software/fdsnws_scripts

checksums           rmd160  1b4a1fa5657009365edae5aa95ef0293459e7233 \
                    sha256  087bb84256b593d175564543fbe91c2c33a9a292eeb989dbe9c73329f7b670f8 \
                    size    66751

python.versions     39 310 311 312 313

if {${name} ne ${subport}} {
    depends_lib-append      port:py${python.version}-dateutil \
                            port:py${python.version}-requests \
                            port:py${python.version}-sphinx_rtd_theme

    depends_run-append  port:${python.rootname}_select

    patchfiles      py311-fix.patch

    select.group    ${python.rootname}
    select.file     ${filespath}/${python.rootname}-${python.version}

    notes-append "
To make this Python ${python.branch} version of this port the default \
(i.e, use its script by their default names, e.g. fdsnws_fetch, etc.),
run:

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