# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=pspg
pkgver=5.8.9
pkgrel=0
pkgdesc="A unix pager optimized for psql"
url="https://github.com/okbob/pspg"
arch="all"
options="!check" # there is no tests
license="BSD-2-Clause"
makedepends="automake autoconf libpq-dev ncurses-dev readline-dev"
subpackages="$pkgname-doc"
source="https://github.com/okbob/pspg/archive/$pkgver/pspg-$pkgver.tar.gz"

prepare() {
	default_prepare
	./autogen.sh
}

build() {
	# getpass
	CFLAGS="$CFLAGS -D_BSD_SOURCE" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var
	make
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 pspg.1 -t "$pkgdir"/usr/share/man/man1/
}

sha512sums="
c9347078fcb400ddb64e603e9df0882cf35c3d7254272e5b97732018fd1fe911145d885034a788b7e9e13e8101af840a22052e98ca0b0bd79f486f5221e4dad1  pspg-5.8.9.tar.gz
"
