# $Id: Portfile 105672 2013-04-30 23:20:54Z larryv@macports.org $

PortSystem          1.0

name                afio
version             2.5.1
categories          archivers
platforms           darwin
maintainers         puffin.lb.shuttle.de:michael.klein
description         Archiver & backup program with builtin compression

long_description    Afio makes cpio-format archives. It deals somewhat \
                    gracefully with input data corruption, supports \
                    multi-volume archives during interactive operation, and \
                    can make compressed archives that are much safer than \
                    compressed tar or cpio archives. Afio is best used as \
                    an `archive engine' in a backup script.

homepage            http://freecode.com/projects/afio/
master_sites        http://members.brabant.chello.nl/~k.holtman \
                    http://www.ibiblio.org/pub/Linux/system/backup/
extract.suffix      .tgz

checksums           sha256  363457a5d6ee422d9b704ef56d26369ca5ee671d7209cfe799cab6e30bf2b99a \
                    rmd160  923981a9e6766781705ceedecd3d86afa5b9abae

post-patch {
    reinplace -E "s|/usr(/local)?|\$(DESTDIR)${prefix}|" ${worksrcpath}/Makefile
}

configure {
    reinplace -E "/^CFLAGS/s|\$| [join ${configure.cflags} " "]|" ${worksrcpath}/Makefile
    reinplace -E "/^LDFLAGS/s|\$| [join ${configure.ldflags} " "]|" ${worksrcpath}/Makefile
}

post-destroot {
    set docdir ${prefix}/share/doc/${name}-${version}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} ANNOUNCE-${version} HISTORY README SCRIPTS ${destroot}${docdir}
}

build.target            afio

