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

name                trurl
version             0.16.1
revision            0

homepage            https://curl.se/trurl
master_sites        ${homepage}/dl

description         command line tool for URL parsing and manipulation

long_description    {*}${description}

categories          net sysutils
installs_libs       no
license             MIT
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

checksums           rmd160  f1c5809609273f5b1d67833a562d2b0171bc4608 \
                    sha256  aac947d4fb421a58abc19a3771e87942cd4721b8f855c433478c94c11a8203ba \
                    size    64088

set python_branch   3.13
set python_version  [string map {. {}} ${python_branch}]

depends_build-append \
                    port:gmake
depends_lib-append  port:curl

depends_test-append port:python${python_version}

compiler.c_standard 2011

build.cmd           gmake
build.target        ${name}

test.run            yes
test.pre_args-append \
                    PYTHON3=${prefix}/bin/python${python_branch}

use_parallel_build  no

post-destroot {
    xinstall -d ${destroot}${prefix}/share/doc/${name}

    xinstall -m 0444 {*}[glob ${worksrcpath}/*.md] \
        ${destroot}${prefix}/share/doc/${name}/

    copy ${worksrcpath}/COPYING ${destroot}${prefix}/share/doc/${name}/LICENSE
}

livecheck.type      regexm
livecheck.url       ${homepage}
livecheck.regex     {href="dl/trurl-([0-9.]+).tar.gz" class="trurldl"}
