# -*- 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.24.0 v
go.package          go.podman.io/skopeo
go.toolchain_min    1.25.7
revision            1

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  d4d98168098897c964ad611942d36d6dad2586c0 \
                    sha256  1eea9364e344c4d6cb398fac53bc387663d19690552003b43c75819e8bb55527 \
                    size    9837239

depends_build-append \
                    port:go-md2man

depends_lib-append  port:gpgme      \
                    port:gnupg2     \
                    port:libassuan  \
                    path:bin/pkg-config: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
