# Contributor: rubicon <rubicon@mailo.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=fnc
pkgver=0.16
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="
aeb951d44cb9d96606450484c744eda0371d057d14c696405a8dc6cc37564f4fc1379470250ec730aaa48e15da80023501b17bde8d072595b721e84cc60c9124  fnc-0.16.tar.gz
"
