# $Id: Portfile 45203 2009-01-10 18:57:37Z ram@macports.org $

PortSystem        1.0

name              pbzip2
version           1.0.5
categories        archivers
platforms         darwin
maintainers       ram openmaintainer

description       parallel bzip2
long_description  PBZIP2 is a parallel implementation of the bzip2 \
  block-sorting file compressor that uses pthreads and achieves \
  near-linear speedup on SMP machines.

homepage          http://compression.ca/pbzip2/
master_sites      ${homepage}

depends_lib       port:bzip2

checksums         md5 e2448d22ee29d1e6549ac58b98df11ab \
                  sha1 a4ebe13d9168af17789ef0b49072c64e381d6c71 \
                  rmd160 31b390b3023d8d5b64496b5bb43a11fc253a5b62

set CFLAGS        "${configure.ldflags} ${configure.cppflags}"

configure {
  reinplace "s|-pthread -lpthread|${CFLAGS}|" ${worksrcpath}/Makefile
  reinplace "s|man|share/man|" ${worksrcpath}/Makefile
}

destroot.destdir  PREFIX=${destroot}${prefix}

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

variant universal {
  set CFLAGS "${CFLAGS} ${configure.universal_cflags}"
}

livecheck.check   regex
livecheck.url     ${homepage}
livecheck.regex   {pbzip2-(\d+(?:\.\d+)*).tar.gz}
