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

name                rdiff-backup
version             2.2.6
revision            0
checksums           rmd160  ce17aee258a4a47bb56b1f606e5dbf4bd626cd3b \
                    sha256  d0778357266bc6513bb7f75a4570b29b24b2760348bbf607babfc3a6f09458cf \
                    size    944414

categories-append   net sysutils
maintainers         nomaintainer
platforms           darwin
license             GPL-2+

description         rdiff-backup backs up one directory to another, possibly \
                    over a network.
long_description    {*}${description}

homepage            https://rdiff-backup.net/

variant python38 conflicts python39 python310 python311 python312 description {Use Python 3.8} {}
variant python39 conflicts python38 python310 python311 python312 description {Use Python 3.9} {}
variant python310 conflicts python38 python39 python311 python312 description {Use Python 3.10} {}
variant python311 conflicts python38 python39 python310 python312 description {Use Python 3.11} {}
variant python312 conflicts  python39 python39 python310 python311 description {Use Python 3.12} {}

if {![variant_isset python38] && ![variant_isset python39]
        && ![variant_isset python310] && ![variant_isset python311]} {
    default_variants +python312
}

foreach pv {312 311 310 39 38} {
    if {[variant_isset python${pv}]} {
        python.default_version ${pv}
        break
    }
}

depends_build-append \
                    port:asciidoctor \
                    port:py${python.version}-setuptools_scm \
                    port:py${python.version}-wheel

depends_lib-append  port:librsync \
                    port:py${python.version}-xattr

build.env           "LIBRSYNC_DIR=${prefix}"

post-destroot {
    delete ${destroot}${prefix}/share/doc/rdiff-backup
    ln -s ${python.prefix}/share/doc/rdiff-backup ${destroot}${prefix}/share/doc/rdiff-backup

    ln -s ${python.prefix}/share/man/man1/rdiff-backup-statistics.1 ${destroot}${prefix}/share/man/man1/rdiff-backup-statistics.1
    ln -s ${python.prefix}/share/man/man1/rdiff-backup.1 ${destroot}${prefix}/share/man/man1/rdiff-backup.1
}
