# -*- 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           codeberg 1.0
PortGroup           makefile 1.0

codeberg.setup      jbruchon jdupes 1.31.1 v
revision            0
checksums           rmd160  27db62fd7f888ab45cfabf34c5e58f34cbbbf8ca \
                    sha256  c80d4c1deb03cc891a7e938f886952cfc480b8a0bc48baf21b312d350b62d8e3 \
                    size    178534

categories          sysutils
license             MIT
maintainers         nomaintainer
description         identify and take actions upon duplicate files
long_description    ${name} is a powerful duplicate file finder and an \
                    enhanced fork of 'fdupes'.

depends_lib-append \
                    port:libjodycode

patchfiles          filestat.patch

compiler.c_standard 2011

# Ensure installation is rooted in the macports domain, rather than '/usr/local'
# See: https://trac.macports.org/ticket/68168
destroot.args-append \
                    PREFIX=${prefix}

post-destroot {
    system "install_name_tool -change libjodycode.4.dylib ${prefix}/lib/libjodycode.4.dylib ${destroot}${prefix}/bin/jdupes"
}

platform darwin {
    if {${os.major} > 16} {
        # dedupe feature requires macOS 10.13 or higher
        build.args-append \
                    ENABLE_DEDUPE=1
    }
}

platform darwin 8 {
    # https://trac.macports.org/ticket/66274
    depends_build-append \
                    port:gmake

    build.cmd       ${prefix}/bin/gmake
}
