# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=hstr
pkgver=3.1
pkgrel=0
pkgdesc="Bash and ZSH shell history suggest box"
url="https://github.com/dvorka/hstr"
arch="all"
license="Apache-2.0"
makedepends="autoconf automake bash libtool ncurses-dev readline-dev"
options="!check"  # no *automated* tests to run
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/dvorka/hstr/archive/$pkgver/hstr-$pkgver.tar.gz"

prepare() {
	default_prepare

	sed -i "s|<ncursesw/curses.h>|<curses.h>|" \
		src/include/hstr_curses.h src/include/hstr.h

	cd build/tarball
	./tarball-automake.sh
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man
	make
}

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

sha512sums="
7fea841a124db4228047b7b6dc00f02d0718268f4526f518fd922039b45006c94f766bbb06f2d594a5b4991184f2ba72f50c2cda89587f128e3001aafadfdf50  hstr-3.1.tar.gz
"
