# $Id: Portfile 59277 2009-10-13 00:30:12Z blb@macports.org $

PortSystem 1.0

name            txt2tags
version         2.5
categories      textproc
maintainers     milosh openmaintainer
description     A document generator: ONE source, MULTI targets
long_description \
    Txt2tags is a document generator. It reads a text file with minimal \
    markup as **bold** and //italic// and converts it to the following \
    formats: HTML, XHTML, SGML, LaTeX, Lout, Man page, MoinMoin, MagicPoint, \
    PageMaker...

homepage        http://txt2tags.sourceforge.net/
platforms       darwin
master_sites    sourceforge
extract.suffix  .tgz
checksums       md5 e4d4553651b5be0711263378ca133c43 \
                sha1 95f472b58b26b591670a931787a25a8ef2a33682
use_configure   no
depends_lib     port:python26

build {
    copy ${worksrcpath}/doc/manpage.man ${worksrcpath}/txt2tags.1
}

destroot {
    xinstall -d ${destroot}${prefix}/share/doc/txt2tags
    xinstall -m 0755 ${worksrcpath}/txt2tags ${destroot}${prefix}/bin/
    fs-traverse file ${worksrcpath}/doc/ {
        if {[file isfile ${file}]} {
            copy ${file} ${destroot}${prefix}/share/doc/txt2tags/
        }
    }
    xinstall -d ${destroot}${prefix}/share/txt2tags/
    copy ${worksrcpath}/extras ${destroot}${prefix}/share/txt2tags/
    copy ${worksrcpath}/samples ${destroot}${prefix}/share/txt2tags/
    xinstall -m 0644 ${worksrcpath}/txt2tags.1 ${destroot}${prefix}/share/man/man1/
    reinplace "s|#!/usr/bin/env python|#!${prefix}/bin/python2.6|" \
        ${destroot}${prefix}/bin/txt2tags \
        ${destroot}${prefix}/share/txt2tags/extras/gensite
}
