# $Id: Portfile,v 1.8 2006/03/21 08:39:18 mww Exp $

PortSystem 1.0

name			pdflib
version			6.0.3
categories		print
platforms		darwin
maintainers		mww@opendarwin.org
description		library of C routines to programmatically generate PDF files
long_description	PDFlib is a library of C routines which allow you to \
				programmatically generate files in Adobe's Portable Document \
				format PDF.

homepage		http://www.pdflib.com/products/pdflib/
master_sites	http://www.pdflib.com/products/pdflib/download/603src/ \
				freebsd
distname		PDFlib-Lite-${version}
checksums		sha1 93c5d78bdff142e873873967df8be49b70fe3c39
patchfiles		patch-config-mkcommon.inc.in patch-libs__pdcore__pc_util.h

configure.args	--without-java --without-perl --without-py --without-tcl

post-destroot {
	xinstall -m 755 -d ${destroot}${prefix}/share/doc/
	file copy ${worksrcpath}/doc/pdflib ${destroot}${prefix}/share/doc/${name}
}

variant java {
	configure.args-delete	--without-java
	configure.args-append	--with-java=yes
}

variant perl {
	depends_lib				path:${prefix}/bin/perl:perl5.8
	configure.args-delete	--without-perl
	configure.args-append	--with-perl=${prefix}/bin/perl
}

variant python {
	depends_lib				path:${prefix}/bin/python:python24
	configure.args-delete	--without-py
	configure.args-append	--with-py=${prefix}
}

variant tcl {
	depends_lib				path:${prefix}/bin/tclsh:tcl
	configure.args-delete	--without-tcl
	configure.args-append	--with-tcl=${prefix}/bin/tclsh
}

platform darwin 8 {
	configure.env	CC="/usr/bin/gcc-4.0 -DPDF_TARGET_API_MAC_CLASSIC" CPP="/usr/bin/cpp-4.0 -DPDF_TARGET_API_MAC_CLASSIC" CXX="/usr/bin/g++-4.0 -DPDF_TARGET_API_MAC_CLASSIC"
}

