# $Id: Portfile 66943 2010-04-26 15:39:08Z dluke@macports.org $

PortSystem	1.0

name		apr
version		1.4.2
categories	devel
maintainers	geeklair.net:dluke
platforms	darwin
description	The apache group's portability library

long_description	The Apache Portable Runtime is a library of C data \
			structures and routines, forming a system portability \
			layer that covers as many operating systems as \
			possible, including Unices, Win32, BeOS, and OS/2.

homepage	http://apr.apache.org/
master_sites	apache:apr

use_bzip2	yes
checksums	md5	4b00e8f70c067893d075577962656b35 \
		sha1	b3ed66c2e7f67c50ae33b5cd85e9f46a93c6e4f8 \
		rmd160	20d4ae082d490432710aad1c4f689e6032a6c921

patchfiles	patch-configure.diff

use_parallel_build	yes
configure.ccache	no
configure.env   ac_cv_prog_AWK=awk lt_cv_path_SED=sed
configure.args	--with-installbuilddir=${prefix}/share/apr-1/build \
		--enable-nonportable-atomics \
		ac_cv_func_setpgrp_void=no

test.run	yes
test.target	check
test.env	DYLD_LIBRARY_PATH=${worksrcpath}/.libs
pre-test	{
	use_parallel_build	no
}

if {[variant_isset universal]} {
	patchfiles-append	patch-universal.diff

	post-destroot {
		reinplace -E {s|-arch [a-z0-9_]+||g} \
			${destroot}${prefix}/share/apr-1/build/apr_rules.mk \
			${destroot}${prefix}/share/apr-1/build/libtool
	}
}

livecheck.type  regex
livecheck.url   http://apache.org/dist/apr/
livecheck.regex {APR (\d+(?:\.\d+)*) is the latest available version}
