# $Id: Portfile,v 1.1 2006/03/20 00:39:09 blb Exp $

PortSystem			1.0
name				asciidoc
version				7.1.2
categories			textproc
maintainers			blb@opendarwin.org
description			Formatter/translator for text files to numerous formats
long_description \
	AsciiDoc is a text document format for writing short documents, \
	articles, books and UNIX man pages. AsciiDoc files can be translated to \
	HTML (with or without stylesheets), DocBook and LinuxDoc markup using \
	the asciidoc(1) command.  AsciiDoc is highly configurable: both the \
	AsciiDoc source file syntax and the backend output markups (which can be \
	almost any type of SGML/XML markup) can be customized and extended by \
	the user.

platforms			darwin

homepage			http://www.methods.co.nz/asciidoc/
master_sites		sourceforge

checksums			md5 554af81fb0e578a77ede4359ef79db69

use_configure		no

build				{}

destroot {
	cd ${worksrcpath}
	xinstall -m 755 -d ${destroot}${prefix}/share/${name} \
		${destroot}${prefix}/etc/${name}/images/

	xinstall -m 755 asciidoc.py ${destroot}${prefix}/bin/${name}
	xinstall -m 755 a2x ${destroot}${prefix}/bin/a2x

	eval file copy [glob *.conf] docbook-xsl filters javascripts stylesheets \
		${destroot}${prefix}/etc/${name}/
	file copy images/icons ${destroot}${prefix}/etc/${name}/images/

	# Note, doc and examples (per porthier(7)) should be in their own subdir
	# of ${prefix}/share, but asciidoc has quite a few symlinks in the
	# examples, so they go under ${prefix}/share/${name} to keep things working
	eval file copy doc examples images javascripts stylesheets BUGS BUGS.txt \
		CHANGELOG CHANGELOG.txt COPYING COPYRIGHT README README.txt \
		${destroot}${prefix}/share/${name}
	xinstall -m 644 doc/${name}.1 doc/a2x.1 \
		${destroot}${prefix}/share/man/man1

	reinplace "s|^#!/usr/bin/env python|#!${prefix}/bin/python|" \
		${destroot}${prefix}/bin/${name} \
		${destroot}${prefix}/etc/${name}/filters/code-filter.py
	reinplace "s|/etc/${name}|${prefix}/etc/${name}|" \
		${destroot}${prefix}/bin/${name} ${destroot}${prefix}/bin/a2x
}

