aboutsummaryrefslogtreecommitdiffstats
path: root/community/hstr/APKBUILD
blob: c5db4bdeb391977016fe9e49a8b3448c63c7ceb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=hstr
pkgver=2.0
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 libtool ncurses-dev readline-dev"
options="!check"  # no *automated* tests to run
subpackages="
	$pkgname-doc
	$pkgname-bash-completion:bashcomp:noarch
	"
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"
}

bashcomp() {
	depends=""
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	mkdir -p "$subpkgdir"/usr/share/bash-completion/completions
	mv "$pkgdir"/usr/share/bash-completion/completions/hstr \
		"$subpkgdir"/usr/share/bash-completion/completions
	rmdir -p "$pkgdir"/usr/share/bash-completion/completions || :
}

sha512sums="50d5e8e61aa853dab0093f4225d3329e98bc59609d8d59abf832cd4cb616d78a2fa091d1ad8d16f3543276c4ead95a419f33a13a96f423bf93dc648da32740b7  hstr-2.0.tar.gz"