# $Id: Portfile 66895 2010-04-24 21:49:11Z ram@macports.org $

PortSystem        1.0

name              pbzip2
version           1.1.1
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     b354422759da7113da366aad1876ed5d \
                  sha1    605e2cc1596b540358d650bf3ab647ad9152f233 \
                  rmd160  ad1755174cdaa7b172f1e0da674f93256d5acaf6

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.type    regex
livecheck.url     ${homepage}
livecheck.regex   {pbzip2-(\d+(?:\.\d+)*).tar.gz}
