# $Id: Portfile 63543 2010-02-08 04:07:24Z toby@macports.org $

PortSystem 1.0

name            tth
version         3.87
categories      textproc print
maintainers     toby
description     a TeX to HTML transaltor
long_description \
    TTH translates TEX, the predominant mark-up language for 	\
    expressing mathematics, into HTML, the language of 		\
    world-wide-web browsers. It thereby enables mathematical 	\
    documents to be made available on the web. Document structure, 	\
    using either the Plain or LaTeX macro packages, is also 	\
    translated and incorporated in the form of hyperlinks.
platforms       darwin freebsd
homepage        http://hutchinson.belmont.ma.us/tth/

master_sites    ${homepage}tth-noncom/
distname        ${name}_C
extract.suffix  .tgz

dist_subdir     ${name}/${version}

# This port is prone to breakage because the author doesn't see fit to make old
# versions available, or even put a version number in the tarball's name. Sigh.
checksums       md5 73621db4c08f8ceee0d96f1616aa74e7 \
                sha1 f5e133e21e27e386aebb8c436dbc82984696ec3e \
                rmd160 22259f18d5a1fda0fa26ea0c23119bec17e8cc49

# sigh
configure {}
set mycflags ${configure.cflags}
if {[variant_isset universal]} {
    set mycflags "$mycflags ${configure.universal_cflags}"
} else {
    if {[info exists configure.cc_archflags]} { set mycflags "$mycflags ${configure.cc_archflags}" }
}

build.cmd       ${configure.cc}
build.pre_args
build.args      $mycflags ${name}.c -o ${name}

destroot {
    xinstall -m 755 ${worksrcpath}/tth ${destroot}${prefix}/bin
    xinstall -m 755 ${worksrcpath}/latex2gif ${destroot}${prefix}/bin
    xinstall -m 755 ${worksrcpath}/ps2gif ${destroot}${prefix}/bin
    xinstall -m 755 ${worksrcpath}/ps2png ${destroot}${prefix}/bin
    xinstall -m 644 ${worksrcpath}/tth.1 ${destroot}${prefix}/share/man/man1
}

livecheck.url   ${homepage}Version
livecheck.regex \"(.*)\"
