# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 80293 2011-07-08 18:36:41Z jmr@macports.org $

PortSystem      1.0

name            pcre
version         8.12
categories      devel
license         BSD
platforms       darwin freebsd
maintainers     nomaintainer
description     Perl Compatible Regular Expressions Library

long_description \
    The PCRE library is a set of functions that implement regular \
    expression pattern matching using the same syntax and semantics as \
    Perl 5. PCRE has its own native API, as well as a set of wrapper \
    functions that correspond to the POSIX regular expression API.

homepage        http://www.pcre.org/
use_bzip2       yes

master_sites    ftp://ftp.fu-berlin.de/unix/misc/${name}/ \
                ftp://ftp.tin.org/pub/libs/${name}/ \
                ftp://ftp.csx.cam.ac.uk/pub/software/programming/${name}/ \
                sourceforge

checksums           md5     f14a9fef3c92f3fc6c5ac92d7a2c7eb3 \
                    sha1    2219b372bff53ee29a7e44ecf5977ad15df01cea \
                    rmd160  ec7978604cdf92d8dbd98e0d0c360fe35eb62021

depends_lib     port:readline \
                port:zlib \
                port:bzip2

configure.args  --docdir=${prefix}/share/doc/${name}-${version} \
                --enable-unicode-properties \
                --enable-pcretest-libreadline \
                --enable-pcregrep-libz \
                --enable-pcregrep-libbz2

platform darwin 8 {
    # ticket #18448
    if {[variant_isset universal]} {
        configure.ldflags-append -lncurses
    }
}

post-patch {
    if {![variant_isset doc]} {
        reinplace -E "/^install-data-am:/s/install-dist_htmlDATA//" ${worksrcpath}/Makefile.in
        reinplace -E "/install-man/s/install-htmlDATA//" ${worksrcpath}/Makefile.in
    }
}

use_parallel_build  yes

test.run        yes

variant doc description {Install extra documentation} {}
