# -*- 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 52496 2009-06-17 17:59:11Z nox@macports.org $

PortSystem      1.0
PortGroup       muniversal 1.0

name            pcre
version         7.9
categories      devel
platforms       darwin freebsd
maintainers     nox openmaintainer
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     b6a9669d1863423f01ea46cdf00f93dc \
                sha1    a4a34f71313ac042455355c01ad851791971a7fa \
                rmd160  e7ccae1fe3d2cf3ff3264c6e6ad3486c64fe1cec

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

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

foreach arch ${universal_archs} {
    lappend merger_configure_ldflags(${arch}) -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} {}
