# $Id: Portfile 94153 2012-06-10 17:40:06Z jmr@macports.org $

PortSystem 1.0

name			boxes
version			1.1
categories		textproc
license			GPL-2+
platforms		darwin
maintainers		nomaintainer

description		draws boxes around text
long_description	boxes is a text filter which can draw various \
			ASCII art boxes around its input text. \
			Variants: 'emacs' -- installs boxes.el, which \
			simplifies using boxes from emacs
homepage		http://boxes.thomasjensen.com
master_sites		http://boxes.thomasjensen.com/download/
extract.suffix		.src.tar.gz
checksums		md5 d2ef9fa28a87bf32b3fe0c47ab82fa97

patchfiles		config.h.patch boxes.c.patch parser.patch regerror.patch \
			regexp_Makefile.patch tools.c.patch

use_configure           no

variant emacs description {Install boxes.el for running inside emacs} {
	post-destroot {
		xinstall -m 755 -d ${destroot}${prefix}/share/emacs/site-lisp/${name}
		xinstall -m 644 ${worksrcpath}/doc/boxes.el ${destroot}${prefix}/share/emacs/site-lisp/${name}/
	}
}

post-patch		{ reinplace "s|GLOBALCONF = /usr/share/boxes|GLOBALCONF = ${prefix}/share/boxes|" "${worksrcpath}/Makefile" }
build.target
build.args 		CC=${configure.cc}

destroot {
			xinstall -m 755 ${worksrcpath}/src/boxes ${destroot}${prefix}/bin/${name}
			file copy ${worksrcpath}/boxes-config ${worksrcpath}/boxes
			xinstall -m 644 ${worksrcpath}/boxes ${destroot}${prefix}/share/${name}
			xinstall ${worksrcpath}/doc/boxes.1 ${destroot}${prefix}/share/man/man1/
			xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
			xinstall -m 644 -W ${worksrcpath} COPYING README README.Win32.txt boxes-config ${destroot}${prefix}/share/doc/${name}
}
