# -*- 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.3 v
revision            0
checksums           rmd160  6fb1b5b89880c81b6ba93b3ebe218c07646c0e66 \
                    sha256  3f76188082330cc28d37788377f0ed06b0ba181fcd4d88827a59f26a0c396168 \
                    size    187137

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

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
}
