# $Id$

PortSystem 1.0

name		libpdel
version		0.5.3
revision	3
categories	devel www
license		Permissive BSD
maintainers	nomaintainer
description	Packet Design multi-purpose C library for embedded applications.

long_description	The Packet Design Embedded Library (PDEL) is a kitchen \
		sink C library containing an assorted collection of code \
		useful for developing embedded applications: \
		-   C data structure run-time introspection library \
		-   Threaded HTTP client/server library with SSL and XML-RPC support \
		-   PPP library using netgraph(4) with PPTP and L2TP servers \
		-   Application configuration framework \
		-   Heap memory accounting and sanity checking \
		-   Generic template processing library \
		-   Routines to configure networking interfaces, ARP and routing tables \
		-   Logging library \
		-   Generic TCP server \
		-   Generic hash table implementation \
		-   Generic balanced tree implementation \
		-   Miscellaneous FILE * enhancements \
		-   Base-64 encoding/decoding \
		-   Events and actions with automated locking \
		-   Generalized per-thread variables \
		-   Message ports \
		-   Digital signature creation/verification \
		-   Filesystem mounting/unmounting \
		-   String quoting/parsing

homepage	http://www.dellroad.org/pdel/index
platforms	darwin

depends_lib	lib:libexpat:expat \
		lib:libssl.0.9:openssl

master_sites	ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/local-distfiles/archie/
checksums	md5 1f8bbb1360f8f8e9bbff470a8c1424dd

# Darwin doesn't support sendfile(), so we skip the optimization.
patchfiles	patch-GNUmakefile \
		patch-http_servlet_http_servlet_file.c

platform darwin {
	global shlibBuild shlibName
	set shlibBuild "cc -dynamiclib \$(objs) \$(LDFLAGS) -compatibility_version 0.1 -current_version ${version} -install_name ${prefix}/lib/libpdel.dylib -o libpdel.dylib -L${prefix}/lib -lssl -lcrypto -lexpat"
	set shlibName "libpdel.dylib"
}

post-patch {
	file copy -force ${filespath}/Darwin ${worksrcpath}/ports/
	reinplace s|@PREFIX@|${prefix}|g ${worksrcpath}/GNUmakefile

	reinplace s|@LIBNAME@|${shlibName}|g ${worksrcpath}/GNUmakefile
	reinplace s|@LIBRARY_BUILD@|${shlibBuild}|g ${worksrcpath}/GNUmakefile
}

build.type	gnu

use_configure	no