PortSystem      1.0

name            gzrecover
set my_name     gzrt
version         0.8
categories      archivers
platforms       darwin
maintainers     nomaintainer
license         GPL-2+
description     attempts to extract bad gzip archives

long_description \
    Gzrecover attempts to skip over bad data in a gzip \
    archive. It will try to to skip over bad data and extract whatever \
    files might be there.

homepage        http://www.urbanophile.com/arenn/hacking/gzrt/
master_sites    ${homepage}
distname        ${my_name}-${version}

checksums       rmd160  3d35163f9351f1f496f69a143b0353448de50b22 \
                sha256  b0b7dc53dadd8309ad9f43d6d6be7ac502c68ef854f1f9a15bd7f543e4571fee

depends_lib     port:zlib

patchfiles      patch-Makefile.diff

use_configure   no

build.args      CC="${configure.cc} [get_canonical_archflags cc]" \
                CFLAGS=${configure.cflags} \
                LDFLAGS=${configure.ldflags}

destroot {
    xinstall ${worksrcpath}/gzrecover ${destroot}${prefix}/bin
    xinstall -m 0444 ${worksrcpath}/gzrecover.1 ${destroot}${prefix}/share/man/man1

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

livecheck.type  regex
livecheck.url   ${homepage}
livecheck.regex ${my_name}-(\\d+(?:\\.\\d+)*)
