# Contributor: rubicon <rubicon@mailo.com>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=fnc
pkgver=0.18
pkgrel=0
pkgdesc="Interactive ncurses browser for Fossil repositories"
url="https://fnc.bsdbox.org/"
arch="all"
license="ISC"
makedepends="bsd-compat-headers ncurses-dev zlib-dev"
checkdepends="expect"
subpackages="$pkgname-doc"
source="https://fnc.bsdbox.org/uv/dl/fnc-$pkgver.tar.gz"

build() {
	make
}

check() {
	# workaround stdin not being a tty on the CI
	expect -f - <<-'END'
		spawn ./src/fnc -v
		expect eof
		exit [lindex [wait] 3]
	END
}

package() {
	make PREFIX="$pkgdir"/usr install

	install -Dvm644 README.md CHANGES.md LICENSE \
		-t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
7a20cb2045a53f275d59454b67afe0759eafd42bf56f2e049710a3e82dcbf8e08ab80e3ab8c5d5cd8c11259c801e8a15fad3dcd275d567021ef27948c0a4a3bf  fnc-0.18.tar.gz
"
