aboutsummaryrefslogtreecommitdiffstats
path: root/community/nvme-cli/APKBUILD
blob: 8daf1d9ab3b90e32a48db9f415f22d0987eecaef (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
# Contributor: Florian Heigl <florian.heigl@gmail.com>
# Maintainer: Florian Heigl <florian.heigl@gmail.com>
pkgname=nvme-cli
pkgver=1.9
pkgrel=0
pkgdesc="NVM-Express user space tooling for Linux"
options="!check" # Requires nose2
arch="all"
url="https://github.com/linux-nvme/nvme-cli"
license="GPL-2.0-only"
makedepends="linux-headers coreutils util-linux-dev util-linux"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion:bashcomp:noarch
	$pkgname-zsh-completion:zshcomp:noarch
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/linux-nvme/nvme-cli/archive/v$pkgver.tar.gz
	"

build() {
	make PREFIX=/usr
}

package() {
	make PREFIX=/usr 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/bash-completion/completions/nvme \
		 "$subpkgdir"/usr/share/bash-completion/completions/$pkgname
	rmdir "$pkgdir"/usr/share/bash-completion/completions
}

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

	install -Dm644 "$builddir"/completions/_nvme \
			"$subpkgdir"/usr/share/zsh/site-functions/_nvme
}

sha512sums="3565b33bc39bde4480bbde5d46d75ea6907c0921884e8f39029b746f8383d3630942e405c61bcc3654bac5646bc86479b4b790e1b823ec83650649621bab6dac  nvme-cli-1.9.tar.gz"