# -*- 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 e912fa0a7c285b4b78a96f888b80c37aa2099d7e
github.tarball_from archive
version             20260614-[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 \
    path:bin/npm:npm11

checksums           rmd160  02306d2e7c13b974bfd64dea81ea962997386f1a \
                    sha256  013bb42ee0c12ca00771419c796dce77c064506ec66eb5b96cac0e904dad8131 \
                    size    6401531

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
}
