# $Id: Portfile 50984 2009-05-14 21:08:43Z and.damore@macports.org $

PortSystem		1.0

name			afio
version			2.5
revision        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://freshmeat.net/projects/afio/
master_sites        http://members.brabant.chello.nl/~k.holtman \
                    http://www.ibiblio.org/pub/Linux/system/backup/
extract.suffix		.tgz

checksums           md5 8c6665e0f875dcd8e1bdb18644b59688 \
                    sha1 051765f209fded60f94944da8a76ae37c3423a23 \
                    rmd160 991bdb794ee8b4b7e6a737afa85009aae925699d

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-2.5 HISTORY README SCRIPTS \
        ${destroot}${docdir}
}

build.target		afio

