# -*- 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 92835 2012-05-09 00:37:01Z ryandesign@macports.org $

PortSystem      1.0

name            pcre
version         8.30
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:project/pcre/pcre/${version}

checksums       rmd160  bddee68c7e2b8b8224a835a2a9cdadc6b7cc9fd2 \
                sha256  c1113fd7db934e97ad8b3917d432e5b642e9eb9afd127eb797804937c965f4ac

depends_lib     port:libedit \
                port:zlib \
                port:bzip2

patchfiles      configure.patch pcretest.c.patch

configure.args  --docdir=${prefix}/share/doc/${name} \
                --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} {}
