SUMMARY="A suite of tools for compiling roff and man pages"
DESCRIPTION="mdocml is a suite of tools compiling mdoc, the roff macro package \
of choice for BSD manual pages, and man, the predominant historical package \
for UNIX manuals. The mission of mdocml is to deprecate groff, the GNU troff \
implementation, for displaying mdoc pages whilst providing token support for \
man."
HOMEPAGE="http://mdocml.bsd.lv/"
COPYRIGHT="2008-2013 Ingo Schwarze, Kristaps Dzonsons"
LICENSE="ISC"
REVISION="1"
SOURCE_URI="http://mdocml.bsd.lv/snapshots/mdocml-1.12.2.tar.gz"
CHECKSUM_SHA256="c4f37afbf823636f63e3cd0673ae6c2ffc6017558e86bdcc02dc825c62daa9d7"
PATCHES="mdocml-1.12.2.patch"

ARCHITECTURES="x86 x86_gcc2"

PROVIDES="
	mdocml = $portVersion
	cmd:demandoc = $portVersion
	cmd:mandoc = $portVersion
	cmd:preconv = $portVersion
	"
REQUIRES="
	haiku
	"

PROVIDES_devel="
	mdocml_devel = $portVersion compat >= 1.12
	devel:libmandoc
	"
REQUIRES_devel="
	mdocml == $portVersion
	"

BUILD_REQUIRES="
	haiku_devel
	"
BUILD_PREREQUIRES="
	cmd:gcc
	cmd:ld
	cmd:make
	"

BUILD()
{
	make PREFIX=$prefix \
	BINDIR=$binDir \
	INCLUDEDIR=$includeDir/mandoc \
	LIBDIR=$libDir \
	MANDIR=$manDir \
	DBBIN=""
}

INSTALL()
{
	make PREFIX=$prefix \
	BINDIR=$binDir \
	INCLUDEDIR=$includeDir/mandoc \
	LIBDIR=$libDir \
	MANDIR=$manDir \
	DBBIN="" \
	install

	prepareInstalledDevelLib libmandoc
	packageEntries devel $developDir
}
