# $Id: Portfile 65009 2010-03-19 14:05:49Z ryandesign@macports.org $

PortSystem			1.0
name				transfig
version				3.2.5c

description			Tools to convert Xfig's .fig files
long_description	TransFig is a set of tools for creating TeX documents \
					with graphics which are portable, in the sense that they \
					can be printed in a wide variety of environments. \
					Drivers currently exist for the following graphics \
					languages: (E)EPIC macros, LaTeX picture environment, PIC, \
					PiCTeX, PostScript, and TeXtyl.
platforms			darwin
categories			print graphics
maintainers			nomaintainer
homepage			http://xfig.org/
master_sites		sourceforge:mcj
distname			${name}.${version}
checksums			md5     0cc55ed6b4ae67a3e610e501acd694f9 \
					sha1    20013b350e81400943cd91744173445d7bd4d98e \
					rmd160  f757857945341093b03f3dce4745c1c131c933fb
depends_lib			port:libpng \
					port:xpm
depends_run			port:netpbm
use_xmkmf			yes
patchfiles			patch-fig2dev-dev-Imakefile \
					patch-fig2dev-Imakefile \
					patch-transfig-Imakefile
post-patch {
	reinplace "s|__PREFIX|${prefix}|g" ${worksrcpath}/fig2dev/Imakefile
	reinplace "s|__DESTROOT|${destroot}|g" ${worksrcpath}/fig2dev/Imakefile
	reinplace "s|__PREFIX|${prefix}|g" ${worksrcpath}/fig2dev/dev/Imakefile
	reinplace "s|__DESTROOT|${destroot}|g" ${worksrcpath}/fig2dev/dev/Imakefile
	reinplace "s|__PREFIX|${prefix}|g" ${worksrcpath}/transfig/Imakefile
	reinplace "s|__DESTROOT|${destroot}|g" ${worksrcpath}/transfig/Imakefile
}
destroot.target		install install.man
post-destroot {
	set docdir ${destroot}${prefix}/share/doc/${name}
	xinstall -d ${docdir}
	xinstall -m 644 -W ${worksrcpath} \
		CHANGES \
		NOTES \
		README \
		${docdir}
}

livecheck.type	regex
livecheck.regex	{>Xfig/Transfig (.*) Download</a>}
