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

github.setup        tldr-pages tldr cb3985b985ab1660ed85841128f07b0e8ef70bed
github.tarball_from archive
version             20251209-[string range ${github.version} 0 6]

name                tldr-pages
categories          devel
license             MIT
platforms           any
maintainers         {gmail.com:davidgilman1 @dgilman} openmaintainer

description         The tldr-pages project is a collection of \
    community-maintained help pages for command-line tools
long_description    {*}${description}. This package installs an archive \
    of the latest help pages to your system.

depends_build-append \
    port:npm11

checksums           rmd160  1a1937af62f199350eb7611f3984eded4f40751c \
                    sha256  43a6632cf00a7c099af756be3bf50dc03d9589aebd6f6a7a32f6bd4b0e1427b1 \
                    size    5240581

use_configure no
build {
    system -W ${worksrcpath} "npm ci"
    system -W ${worksrcpath} "npm run build-index"
}
destroot {
    xinstall -m 0755 -d ${destroot}${prefix}/share/tldr
    xinstall -m 0644 ${worksrcpath}/LICENSE.md ${worksrcpath}/index.json ${destroot}${prefix}/share/tldr
    move {*}[glob ${worksrcpath}/pages*] ${destroot}${prefix}/share/tldr
}
