# -*- 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
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 python310 conflicts python311 python312 python313 description {Use Python 3.10} {}
variant python311 conflicts python310 python312 python313 description {Use Python 3.11} {}
variant python312 conflicts python310 python311 python313 description {Use Python 3.12} {}
variant python313 conflicts python310 python311 python312 description {Use Python 3.13} {}

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

foreach pv {313 312 311 310} {
    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
}
