Portfile

# $Id: Portfile 22339 2007-02-26 22:54:42Z dluke@macports.org $

PortSystem 1.0
name apr-util
version 1.2.8
revision 2
categories devel
maintainers dluke@geeklair.net
description utilities built with the apache group's portability library

long_description apr-util is a library of useful utilities built with \
and intended to be used with the Apache Portable Runtime.

homepage http://apr.apache.org/
master_sites apache:apr
use_bzip2 yes
checksums md5 b122f35ee6883a216cd2e7d44504521e

depends_lib lib:libapr-1:apr port:expat \
port:libiconv port:db44 \
port:sqlite3

configure.env CPPFLAGS=-I${prefix}/include LDFLAGS=-L${prefix}/lib
configure.args --with-apr=${prefix}/bin/apr-1-config --with-expat=${prefix} \
--with-iconv=${prefix} --with-berkeley-db=${prefix}/include:${prefix}/lib/db44 \
--without-mysql --without-pgsql --with-sqlite3=${prefix}

test.run yes
test.target check
test.env DYLD_LIBRARY_PATH=${worksrcpath}/.libs

variant no_bdb {
depends_lib-delete port:db44
configure.args-delete --with-berkeley-db=${prefix}/include:${prefix}/lib/db44
configure.args-append --without-berkeley-db
}

variant no_sqlite {
depends_lib-delete port:sqlite3
configure.args-delete --with-sqlite3=${prefix}
configure.args-append --without-sqlite2 \
--without-sqlite3
}

variant openldap {
depends_lib-append port:openldap
configure.args-append --with-ldap \
--with-ldap-include=${prefix}/include \
--with-ldap-lib=${prefix}/lib
}

pre-configure {
reinplace "s|^Libs: |Libs: -L${prefix}/lib/db44 |" $worksrcpath/apr-util.pc.in
}