SUMMARY="Highly configurable text format for writing documentation"
DESCRIPTION="
AsciiDoc is a text document format for writing notes, documentation, articles, \
books, ebooks, slideshows, web pages, man pages and blogs. AsciiDoc files can \
be translated to many formats including HTML, PDF, EPUB, man page.
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."
HOMEPAGE="https://asciidoc.org/"
COPYRIGHT="2002-2013 Stuart Rackham
	2013-2020 AsciiDoc Contributors"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/asciidoc/asciidoc-py3/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="9aae9d37d01066d6281aa8eebd9c2ae288c60827f07024d7552e6f2d840267c6"
SOURCE_DIR="asciidoc-py-$portVersion"
SOURCE_FILENAME="asciidoc-$portVersion.tar.gz"

ARCHITECTURES="any"

PROVIDES="
	asciidoc = $portVersion
	cmd:a2x = $portVersion compat >= 8
	cmd:asciidoc = $portVersion compat >= 8
	"
REQUIRES="
	haiku
	docbook_xsl_stylesheets
	cmd:xsltproc
	cmd:python3
	"

BUILD_REQUIRES="
	haiku_devel
	docbook_xml_dtd
	docbook_xsl_stylesheets
	setuptools_python3
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:automake
	cmd:gawk
	cmd:make
	cmd:python3
	cmd:sed
	cmd:xmllint
	cmd:xsltproc
	"
TEST_REQUIRES="
	pytest_python3
	pytest_mock_python3
	"

BUILD()
{
	# TODO: separate data and configuration files.
	autoreconf -fi
	runConfigure ./configure \
		--sysconfdir=$dataDir
	make build
}

INSTALL()
{
	python=python3.7
	installLocation=$prefix/lib/$python/vendor-packages/
	export PYTHONPATH=$installLocation:$PYTHONPATH
	$python setup.py build install \
                        --root=/ --prefix=$prefix
	make docs
}

TEST()
{
	make test
}
