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

go.setup                github.com/git-lfs/git-lfs 3.7.1 v
revision                0
maintainers             {judaew @judaew} \
                        openmaintainer
categories              devel

description             Git Large File Storage
long_description        {*}${description} is an extension for versioning large files
homepage                https://git-lfs.github.com/
license                 MIT

checksums               rmd160  a18f52b1cd7e51477db7958350e5e7eb2d35436d \
                        sha256  0e83566a9e2477e03627e7fd6bf81f01fadbf93dcaf6abd2686fca90f6bac7dd \
                        size    713950

depends_build-append    port:asciidoctor \
                        port:rb33-ronn-ng
depends_run             port:git

if {${os.platform} eq "darwin" && ${os.major} < 16} {
    # requires clonefile(3), see https://trac.macports.org/ticket/60121
    known_fail      yes
    pre-fetch {
        ui_error "${name} requires macOS 10.12 or later."
        return -code error "incompatible OS version"
    }
}

use_configure no

build.cmd               make
build.target            bin/git-lfs man
build.args              RONN=${prefix}/bin/ronn-3.1
go.offline_build no

destroot {
    set bindir ${destroot}${prefix}/bin
    xinstall -m 755 ${worksrcpath}/bin/git-lfs ${bindir}

    set mandir ${destroot}${prefix}/share/man/man1
    set manfiles [glob ${worksrcpath}/man/man1/*.1]
    xinstall -m 644 {*}${manfiles} ${mandir}
    set mandir ${destroot}${prefix}/share/man/man5
    set manfiles [glob ${worksrcpath}/man/man5/*.5]
    xinstall -m 644 {*}${manfiles} ${mandir}

    set docdir ${destroot}${prefix}/share/doc/${subport}
    xinstall -d ${docdir}
    set docfiles [glob ${worksrcpath}/man/html/*.html]
    xinstall -m 644 {*}${docfiles} ${docdir}
}
