# $Id: Portfile 32256 2007-12-23 09:18:47Z ryandesign@macports.org $

PortSystem			1.0
PortGroup			perl5 1.0
perl5.setup			Template-Toolkit 2.19
maintainers			nomaintainer
description			Template processing system modules
long_description \
	The Template Toolkit is a collection of modules which implement a fast, \
	flexible, powerful and extensible template processing system.  It was \
	originally designed and remains primarily useful for generating dynamic \
	web content, but it can be used equally well for processing any other \
	kind of text based documents: HTML, XML, POD, PostScript, LaTeX, and so on.

platforms			darwin

homepage			http://www.template-toolkit.org/

checksums			md5 5c886d392ca57a13ded91fa64834913c

depends_lib-append		port:p5-appconfig \
				port:p5-file-homedir \
				port:p5-mac-carbon

patchfiles			patch-Makefile.PL

configure.post_args	TT_PREFIX=${prefix}/share/tt2 TT_ACCEPT=y TT_QUIET=y

# During install (or destroot in DP's case), parts are expected to be
# installed already, earlier in the install; this step causes the install
# to use the destroot'd version, then we switch it back in post-destroot
post-configure {
	reinplace "s|${prefix}|${destroot}${prefix}|g" \
		${worksrcpath}/docs/ttree.cfg ${worksrcpath}/examples/ttree.cfg
}

destroot.target-append	    tt2_install tt2_splash tt2_html_docs tt2_examples

post-destroot {
	xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
	xinstall -m 644 -W ${worksrcpath} INSTALL README \
		${destroot}${prefix}/share/doc/${name}
	reinplace "s|${destroot}${prefix}|${prefix}|g" \
		${destroot}${prefix}/share/tt2/docs/ttree.cfg \
		${destroot}${prefix}/share/tt2/examples/ttree.cfg
}

variant DBI {
	depends_lib-append	port:p5-dbi
}

