aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ddgr/APKBUILD
blob: fc38cd03aabcc993cace19fcbb37c299c32f768e (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
# Contributor: dai9ah <dai9ah@protonmail.com>
# Maintainer: dai9ah <dai9ah@protonmail.com>
pkgname=ddgr
pkgver=1.4
pkgrel=0
pkgdesc="DuckDuckGo from the terminal"
url="https://github.com/jarun/ddgr"
arch="noarch"
license="GPL-3.0-or-later"
depends="python3"
subpackages="$pkgname-doc
	$pkgname-bash-completion:bashcomp:noarch
	$pkgname-fish-completion:fishcomp:noarch
	$pkgname-zsh-completion:zshcomp:noarch
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/jarun/$pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

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

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

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

	mkdir -p "$subpkgdir"/usr/share/bash-completion/completions/
	install -Dm644 "$builddir"/auto-completion/bash/* \
		"$subpkgdir"/usr/share/bash-completion/completions/
}

fishcomp() {
	pkgdesc="Fish completion for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel fish"

	mkdir -p "$subpkgdir"/usr/share/fish/completions/
	install -Dm644 "$builddir"/auto-completion/fish/* \
		"$subpkgdir"/usr/share/fish/completions/
}

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

	mkdir -p "$subpkgdir"/usr/share/zsh/site-functions
	install -Dm644 "$builddir"/auto-completion/zsh/* \
		"$subpkgdir"/usr/share/zsh/site-functions/

}

sha512sums="ef51a1a8634cc2417cf036cea1748fcfe0572861e3e0ea9625f7ce4b47c3d0e966a670e26912ab5aee2946d29fa8d4ac5e5bd7249719845f9107dcf02de710ed  ddgr-1.4.tar.gz"