# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=m17n-db
pkgver=1.8.7
pkgrel=0
# the i18n/charmaps are in the glibc source
_glibc=2.37
pkgdesc="gnu M-text multilingualization data"
url="https://www.nongnu.org/m17n/"
arch="noarch"
license="LGPL-2.1-or-later"
# FIXME: bb awk hangs
depends_dev="$pkgname=$pkgver-r$pkgrel"
makedepends="mawk gettext-dev"
subpackages="$pkgname-lang $pkgname-dev"
source="https://download.savannah.gnu.org/releases/m17n/m17n-db-$pkgver.tar.gz
	glibc-$_glibc.tar.xz::https://ftp.gnu.org/gnu/glibc/glibc-$_glibc.tar.xz
	"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-charmaps="$srcdir"/glibc-$_glibc/localedata/charmaps/ \
		AWK=mawk
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install

	mkdir -vp "$pkgdir"/usr/lib
	mv -v "$pkgdir"/usr/share/pkgconfig "$pkgdir"/usr/lib/
}

sha512sums="
e343454d9157a9fdb9c140c62217c0658ce511067e4a48d4ebd566b622fd48319f080b11fbc269ca32f7570b84f8d732e4220fdd4be7434d92291d888d03b5cf  m17n-db-1.8.7.tar.gz
4fc5932f206bb1b8b54828a28af1a681616b838bbab60c81c82155f3629cbfe1301d271af65511ed917f4c6949a025429221fe6035753282f15346919f15b90c  glibc-2.37.tar.xz
"
