# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gdbm
pkgver=1.24
pkgrel=0
pkgdesc="GNU dbm is a set of database routines that use extensible hashing"
url="https://www.gnu.org/software/gdbm/"
arch="all"
license="GPL-3.0-or-later"
depends_dev="$pkgname-tools=$pkgver-r$pkgrel"
subpackages="$pkgname-dev $pkgname-doc $pkgname-tools"
source="https://ftp.gnu.org/gnu/gdbm/gdbm-$pkgver.tar.gz"

build() {
	# we disable large-file due to it makes the db file non-compat
	# with gdbm-1.8.3
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-libgdbm-compat \
		--disable-largefile \
		--disable-dependency-tracking \
		--enable-fast-install
	make
}

check() {
	make check
}

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

tools() {
	pkgdesc="$pkgdesc (CLI tools)"
	depends="$pkgname=$pkgver-r$pkgrel"

	amove usr/bin/*
}

sha512sums="
401ff8c707079f21da1ac1d6f4714a87f224b6f41943078487dc891be49f51fd1ac7a32fd599aae0fad185f2c6ba7432616d328fd6aaab068eb54db9562ff7fa  gdbm-1.24.tar.gz
"
