# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0

name                pbzip2
version             1.1.13
set branch          [join [lrange [split ${version} .] 0 1] .]
categories          archivers
platforms           darwin
maintainers         {ryandesign @ryandesign} openmaintainer
license             Permissive
installs_libs       no

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        https://launchpad.net/pbzip2/${branch}/${version}/+download/

checksums           rmd160  cc73779cb262afd7150960ee3989d901bf10de8d \
                    sha256  8fd13eaaa266f7ee91f85c1ea97c86d9c9cc985969db9059cdebcb1e1b7bdbe6 \
                    size    48015

depends_lib         port:bzip2

patchfiles-append   patch-Makefile.diff \
                    space-between-literal-and-identifier.patch

use_configure       no

variant universal {}

pre-build {
    build.env-append \
                    CXX=${configure.cxx} \
                    "CXXFLAGS=${configure.cxxflags} [get_canonical_archflags cxx]" \
                    "LDFLAGS=${configure.ldflags} [get_canonical_archflags ld]"
}

destroot.args       PREFIX=${prefix}

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

variant debug description {Enable debugging code} {
    configure.cxxflags-append -DPBZIP_DEBUG
}

livecheck.type      regex
livecheck.url       https://launchpad.net/pbzip2
livecheck.regex     {pbzip2-(\d+(?:\.\d+)*).tar.gz}
