# Maintainer: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@alpinelinux.org>

pkgname=tidyhtml
_pkgreal=tidy-html5
pkgver=5.4.0
pkgrel=0
pkgdesc="Tool to tidy down your HTML code to a clean style"
arch=all
url="http://www.html-tidy.org"
license="custom"
depends=
makedepends="cmake"
subpackages="$pkgname-dev $pkgname-libs"
source="$pkgname-$pkgver.tar.gz::https://github.com/htacg/tidy-html5/archive/$pkgver.tar.gz"

builddir="$srcdir"/$_pkgreal-$pkgver

build(){
	cd "$builddir"
	cmake CMakeLists.txt \
		-DCMAKE_VERBOSE_MAKEFILE=ON \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DSUPPORT_LOCALIZATIONS=OFF \
		-DTIDY_CONSOLE_SHARED=ON
	make
}

check() {
	"$builddir"/tidy --help > /dev/null
}

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

sha512sums="d92c89f2ef371499f9c3de6f9389783d2449433b4da1f5a29e2eb81b7a7db8dd9f68e220cdde092d446e9bd779bcbc30f84bda79013526540f29d00f438cb402  tidyhtml-5.4.0.tar.gz"
