# $Id: Portfile,v 1.31 2005/05/04 04:06:53 landonf Exp $

PortSystem 1.0
name			dict
version			1.9.7
categories		textproc spelling
maintainers		landonf@opendarwin.org
description		Dictionary Server Protocol (RFC2229) client
long_description	The Dictionary Server Protocol (DICT) is a TCP \
			transaction based query/response protocol that \
			allows a client to access dictionary definitions \
			from a set of natural language dictionary databases. \
			dict(1) is a client which can access DICT servers \
			from the command line.
homepage		http://www.dict.org/
platforms		darwin freebsd

master_sites		ftp://ftp.dict.org/pub/dict/
distname		${portname}d-${portversion}
checksums		md5 baa8f18dd0373e7053658be99d40d5db
depends_lib		lib:ltdl.3:libtool

patchfiles		patch-configure

configure.args		--without-local-zlib --with-etcdir=${prefix}/etc
configure.env		CPPFLAGS=-I${prefix}/include LDFLAGS=-L${prefix}/lib
build.type		gnu
build.target		dict
destroot.target		install.dict

variant darwin {
	patchfiles-append	patch-libmaa-config.guess patch-libmaa-config.sub patch-libmaa_parse.c patch-regex-ranlib
}

variant freebsd {
	patchfiles-append	freebsd-T_USER.diff
}

post-patch {
	reinplace s|/etc/|${prefix}/etc/|g "${workpath}/${distname}/dict.1"
}
