# $Id: Portfile,v 1.7 2005/02/18 07:08:14 mij Exp $

PortSystem 1.0
name		htmldoc
version		1.8.24
categories	textproc
maintainers	mij@opendarwin.org
description	Converts HTML files to PDF or PostScript
homepage	http://www.easysw.com/htmldoc/
platforms	darwin

long_description htmldoc can convert HTML files to PDF or PostScript, \
		 generate a table-of-contents for books, and generate \
		 indexed HTML files.  It also generates files on-the-fly \
		 for web applications or for batch jobs.

master_sites	http://ftp.easysw.com/pub/htmldoc/${version}/ \
		ftp://ftp.easysw.com/pub/htmldoc/${version}/

checksums	md5 d781c605f2a370246db1f5d70a41bbe4

distname	${portname}-${portversion}-source
worksrcdir	${portname}-${portversion}
use_bzip2	yes

depends_lib	lib:libjpeg.62:jpeg lib:libpng.3:libpng lib:libz.1:zlib

configure.env	CFLAGS="-I${prefix}/include" \
		CXXFLAGS="-I${prefix}/include" \
		CPPFLAGS="-I${prefix}/include" \
		LDFLAGS="-L${prefix}/lib"

configure.args	--without-gui --disable-localjpeg --disable-localpng \
		--disable-localzlib --disable-ssl

destroot.destdir prefix=${destroot}${prefix} exec_prefix=${destroot}${prefix} \
		 bindir=${destroot}${prefix}/bin

variant ssl {
	if {[variant_isset gnutls] || [variant_isset cdsassl]} {
		ui_error "Only one of +ssl, +gnutls, or +cdsassl can be specified!"
		exit(1)
	}
	depends_lib-append	lib:libssl.0.9:openssl
	configure.args-delete	--disable-ssl
	configure.args-append	--enable-openssl --disable-gnutls --disable-cdsassl
}

variant gnutls {
	if {[variant_isset ssl] || [variant_isset cdsassl]} {
		ui_error "Only one of +ssl, +gnutls, or +cdsassl can be specified!"
		exit 1
	}
	depends_lib-append	lib:libgnutls:gnutls
	configure.args-delete	--disable-ssl
	configure.args-append	--disable-openssl --enable-gnutls --disable-cdsassl
}

variant cdsassl {
	if {[variant_isset ssl] || [variant_isset gnutls]} {
		ui_error "Only one of +ssl, +gnutls, or +cdsassl can be specified!"
		exit 1
	}
	configure.args-delete	--disable-ssl
	configure.args-append	--disable-openssl --disable-gnutls --enable-cdsassl
}
