# $Id: Portfile 67418 2010-05-09 03:48:49Z perry@macports.org $

PortSystem          1.0
PortGroup           python26 1.0

name                rdiff-backup
version             1.2.8
revision            2
categories-append   net sysutils
maintainers         perry openmaintainer
platforms           darwin

description         rdiff-backup backs up one directory to another, possibly \
                    over a network.
long_description    ${description}
license             GPLv2
homepage            http://rdiff-backup.nongnu.org/

livecheck.regex     {Version (.+?),.+new stable}
livecheck.type      regex
livecheck.url       ${homepage}

depends_lib-append  port:librsync port:py26-xattr

distname            rdiff-backup-${version}
master_sites        savannah

checksums           rmd160 f7fb7a894afe17b495611a3738c85263ae72b2b5

patchfiles          patch-rdiff-backup.1.diff patch-setup.py.diff

post-patch {
    reinplace "s|@PREFIX@|${prefix}|" ${worksrcpath}/rdiff-backup.1
}

build.args          --librsync-dir=${prefix}

set python.link_binaries_suffix {}

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

    file mkdir ${destroot}${prefix}/share/man/man1
    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
}
