# $Id: Portfile 51140 2009-05-19 06:36:11Z blb@macports.org $

PortSystem 1.0

name	   rtf2latex
version	   1.5
categories	tex
platforms	darwin
maintainers	jmpp openmaintainer

description	Filter to convert RTF text into LaTeX code
long_description	rtf2LaTeX is a filter built on Paul DuBois' RTF reader that converts \
			RTF (Microsoft's Rich Text Format) into LaTeX. rtf2LaTeX expends a \
			good deal of effort in an attempt to make the resulting LaTeX maintainable \
			and modifiable.

homepage	http://www.ctan.org/tex-archive/support/rtf2latex
master_sites	${homepage}
distname	rtf2LaTeX
distfiles	${distname}.${version}${extract.suffix}
checksums	md5 90964f786d149d314a57511ed9ceaaee

patchfiles	patch-Makefile.2LaTeX.diff patch-reader.c.diff

pre-configure	{ file rename ${worksrcpath}/Makefile.2LaTeX ${worksrcpath}/Makefile }
configure	{
		reinplace "s|-DSYSV||g" ${worksrcpath}/Makefile
		reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/Makefile
		reinplace "s|/man/man1|/share/man/man1|g" ${worksrcpath}/Makefile
}

build.target	{}

post-destroot	{
		xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
		foreach f [glob -directory ${worksrcpath} -type f interna.*] {
			xinstall -m 644 -v $f ${destroot}${prefix}/share/doc/${name}
		}
}
