# Template file for 'mdbtools'
pkgname=mdbtools
version=1.0.1
revision=1
build_style=gnu-configure
configure_args="--disable-glibtest --enable-sql"
hostmakedepends="which gawk flex bison pkg-config autoconf automake gettext-devel-tools libtool"
makedepends="readline-devel libglib-devel"
short_desc="Library and utilities for reading Microsoft Access Databases"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="https://github.com/mdbtools/mdbtools"
distfiles="${homepage}/archive/v${version}.tar.gz"
checksum=750cbf793bf5b7e296fdc359124393a0aef89ee663b7741ba4b1ca2ce30b3b37

CFLAGS="-fcommon"

pre_configure() {
	autoreconf -fi
	case "${XBPS_TARGET_MACHINE}" in
		*-musl) sed -i -e "s/^host_os=.*/host_os=gnu/" configure
	esac
}

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

libmdb_package() {
	short_desc+=" - runtime library"
	pkg_install() {
		vmove "usr/lib/*.so.*"
	}
}
