# $Id: Portfile 86365 2011-10-24 17:03:31Z mww@macports.org $

PortSystem 1.0

name                rsnapshot
version             1.3.1
revision            1
categories          sysutils net
platforms           darwin
maintainers         mww
license             GPL-2
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           sha1 a3aa3560dc389e1b00155a5869558522c4a29e05 \
                    rmd160  948ee5669c5da0728f607007da4d5fbbcfcdd8c7 \
                    sha256  94b6c77e40628935f42a191bdc28ad93b1f132fde456ee76ee87763f1eddc75e

depends_lib         port:rsync port:perl5 bin:ssh:openssh

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

test.run            yes

post-destroot    {
    xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}/examples
    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING ChangeLog INSTALL \
        NEWS README TODO ${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
    }
}
