# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=asciidoc
pkgver=8.6.10
pkgrel=0
pkgdesc="Text based documentation"
url="http://asciidoc.org/"
arch="noarch"
license="GPL-2.0"
depends="python2 libxml2-utils docbook-xsl"
makedepends="autoconf"
subpackages="$pkgname-doc $pkgname-vim::noarch"
source="$pkgname-$pkgver.tar.gz::https://github.com/asciidoc/asciidoc/archive/$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	default_prepare
	autoconf
}

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

vim() {
	pkgdesc="Vim syntax for $pkgname"
	depends=""
	install -Dm644 "$builddir"/vim/syntax/$pkgname.vim \
		"$subpkgdir"/usr/share/vim/vimfiles/syntax/$pkgname.vim
}

sha512sums="6ecc86977baaf1c756691e3f661e43ef2bb24e606898f6075bfa6f174d1fdc5e77d00853ffe014847e295364349d6ad34f3b8209cb97870e0233012fc38a281a  asciidoc-8.6.10.tar.gz"
