# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           perl5 1.0

perl5.require_variant   yes
perl5.conflict_variants yes
perl5.branches          5.28 5.30 5.32 5.34
perl5.default_branch    5.34
perl5.create_variants   ${perl5.branches}

name                rsnapshot
version             1.4.5
revision            0
categories          sysutils net
maintainers         nomaintainer
license             GPL-2+
platforms           any
supported_archs     noarch
description         filesystem snapshot utility based on rsync
long_description    rsnapshot is a filesystem snapshot utility based on \
                    rsync. It makes it easy to make periodic snapshots of \
                    local machines, and remote machines over SSH. The code \
                    makes extensive use of hard links whenever possible, \
                    to greatly reduce the disk space required.

homepage            http://www.rsnapshot.org/
master_sites        ${homepage}/downloads/

checksums           rmd160  c40adf406f1c5f309ddfa19bc40bb96194bb77d9 \
                    sha256  10b75e01ca25511e8266aacd495531975ad1a8ad556216b6a57c76d028b38242 \
                    size    287731

depends_lib         port:p${perl5.major}-lchown \
                    path:bin/rsync:rsync \
                    bin:ssh:openssh

configure.args      --mandir=${prefix}/share/man \
                    --with-rsync=${prefix}/bin/rsync \
                    --with-perl=${perl5.bin}

test.run            yes

post-destroot    {
    xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}/examples
    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING ChangeLog INSTALL.md \
        README.md ${destroot}${prefix}/share/doc/${name}
    system "cp -R ${worksrcpath}/utils/* \
        ${destroot}${prefix}/share/doc/${name}/examples"
}

post-activate {
    if {![file exists ${prefix}/etc/rsnapshot.conf]} {
        xinstall -m 644 ${prefix}/etc/rsnapshot.conf.default \
            ${prefix}/etc/rsnapshot.conf
    }
}
