summaryrefslogtreecommitdiff
path: root/main/the_silver_searcher/APKBUILD
blob: 356c3d01978530e327329b21f5dc1d043a83eec9 (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
54
55
56
57
58
59
60
61
62
63
64
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=the_silver_searcher
pkgver=2.1.0
pkgrel=2
pkgdesc="A code searching tool similar to ack, with a focus on speed."
url="https://geoff.greer.fm/ag/"
arch="all"
license="Apache-2.0"
depends=""
makedepends="pcre-dev xz-dev zlib-dev"
subpackages="$pkgname-doc
	$pkgname-zsh-completion:zshcomp:noarch
	$pkgname-bash-completion:bashcomp:noarch"
source="https://geoff.greer.fm/ag/releases/$pkgname-$pkgver.tar.gz"

builddir="$srcdir/$pkgname-$pkgver"
build () {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	cd "$builddir"
	./ag --help > /dev/null
}

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

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/the_silver_searcher/completions/ag.bashcomp.sh \
		"$subpkgdir"/usr/share/bash-completion/completions/ag

	rmdir -p "$pkgdir"/usr/share/the_silver_searcher/completions/ 2>&1 || true
}

zshcomp() {
	depends=""
	pkgdesc="Zsh completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	mkdir -p "$subpkgdir"/usr/share/zsh/site-functions/
	mv "$pkgdir"/usr/share/zsh/site-functions/_the_silver_searcher \
		"$subpkgdir"/usr/share/zsh/site-functions/

	rmdir -p "$pkgdir"/usr/share/zsh/site-functions/ 2>&1 || true
}

sha512sums="27cf5c0990551261833aed0232438da6ec079d619a8dcd15fcf866a3997237435c2ba8dec88bb8b6abb8ef2f3498145903c3b0f39274b2660680c22fed65dd62  the_silver_searcher-2.1.0.tar.gz"