PortSystem      1.0

name            zoo
version         2.10pl1
revision        1
categories      archivers
platforms       darwin
maintainers     nomaintainer
description     Manipulate archives of files in compressed form

long_description \
    Zoo is used to create and maintain collections of files in \
    compressed form. It uses a Lempel-Ziv compression algorithm that \
    gives space savings in the range of 20% to 80% depending on the \
    type of file data. Zoo can store and selectively extract multiple \
    generations of the same file. Data can be recovered from damaged \
    archives by skipping the damaged portion and locating undamaged \
    data with the help of fiz(1).

homepage        http://en.wikipedia.org/wiki/Zoo_(file_format)
master_sites    ftp://ftp.kiarchive.ru/pub/unix/arcers/

checksums       md5 70a0a785ecc8f7f747be1421e495d837 \
                sha1 c02d96148ee57df01596d0c8d07a3e327b821600 \
                rmd160 971d388b8cb29def1e4e31011463563e91c3d700

extract.mkdir   yes

patchfiles      makefile.patch

configure {
    reinplace -E "/BSD4_3/s|(CFLAGS=\")|LDFLAGS=\"[join ${configure.ldflags} " "]\" \
        \\1[join ${configure.cflags} " "] |" \
        ${worksrcpath}/makefile
}

build.target        bsd
build.args          CC="${configure.cc} [get_canonical_archflags]"

destroot.target     inst_prod
destroot.destdir    DESTDIR=${destroot}${prefix}/bin

post-destroot {
    xinstall ${worksrcpath}/fiz ${destroot}${prefix}/bin

    xinstall -m 0444 {*}[glob ${worksrcpath}/*.1] ${destroot}${prefix}/share/man/man1

    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 ${worksrcpath}/Copyright ${destroot}${docdir}
}
