# Template build file for 'libdom'.
pkgname=libdom
# Use date version to respect previous pkg... omg.
_datever=20160217
version=${_datever}.0.3.0
revision=1
wrksrc="${pkgname}-${version#${_datever}.}"
hostmakedepends="pkg-config perl netsurf-buildsystem"
makedepends="expat-devel libparserutils-devel libwapcaplet-devel libhubbub-devel"
short_desc="Implementation of the W3C DOM, written in C"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="MIT"
homepage="http://www.netsurf-browser.org"
distfiles="http://download.netsurf-browser.org/libs/releases/${pkgname}-${version#${_datever}.}-src.tar.gz"
checksum=8a6c3eb8fcd9beb2e0df660caeb043dfff86632a00b8997cbcbef4a7f0c266ce

post_extract() {
	sed -i 's/_BSD_SOURCE/_DEFAULT_SOURCE/g' Makefile
}

do_build() {
	make ${makejobs} COMPONENT_TYPE=lib-shared PREFIX=/usr
	make ${makejobs} COMPONENT_TYPE=lib-static PREFIX=/usr
}

do_install() {
	make COMPONENT_TYPE=lib-shared PREFIX=/usr DESTDIR=${DESTDIR} install
	make COMPONENT_TYPE=lib-static PREFIX=/usr DESTDIR=${DESTDIR} install

	vlicense COPYING
}

libdom-devel_package() {
	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.a"
		vmove "usr/lib/*.so"
	}
}