# -*- 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/containers/skopeo 1.22.2 v
revision            0

description         Work with remote container image registries

long_description    \
    {*}${description}. ${name} works with API V2 container image registries \
    such as docker.io and quay.io registries, private registries, local \
    directories and local OCI-layout directories.

categories          sysutils
installs_libs       no
license             Apache-2
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

checksums           rmd160  201bfee5d9fd942d0a281687487b5c5fbddf571d \
                    sha256  b6e1f208c1048f7a80613e8154774e6a3fdc891aeb45325c8ed905be4dee48d8 \
                    size    10327855

depends_build-append \
                    port:go-md2man

depends_lib-append  port:gpgme      \
                    port:gnupg2     \
                    port:libassuan  \
                    port:pkgconfig

patch {
    # Do not rebuild the skopeo binary during the installation phase

    reinplace -E \
        {s|^install-binary: bin/skopeo|install-binary:|} \
        ${worksrcpath}/Makefile

    reinplace -E \
        {s|^completions: bin/skopeo|completions:|} \
        ${worksrcpath}/Makefile
}

build.cmd           make
build.target        all

destroot {
    system -W ${worksrcpath} \
        "make   DESTDIR=${destroot} \\
                CONTAINERSCONFDIR=${prefix}/etc/containers \\
                LOOKASIDEDIR=${prefix}/var/lib/containers/sigstore \\
                PREFIX=${prefix} \\
                install"
}

use_parallel_build  no
