Mail archive
alpine-aports

[alpine-aports] [PATCH 2/4] testing/tpm: split completion package

From: Sören Tempel <soeren+git_at_soeren-tempel.net>
Date: Tue, 18 Aug 2015 19:39:54 +0200

---
 testing/tpm/APKBUILD | 41 +++++++++++++++++++++++++++++------------
 1 file changed, 29 insertions(+), 12 deletions(-)
diff --git a/testing/tpm/APKBUILD b/testing/tpm/APKBUILD
index c753146..0a04112 100644
--- a/testing/tpm/APKBUILD
+++ b/testing/tpm/APKBUILD
_at_@ -2,31 +2,48 @@
 # Maintainer: Sören Tempel <soeren+alpine_at_soeren-tempel.net>
 pkgname=tpm
 pkgver=1.2
-pkgrel=0
+pkgrel=1
 pkgdesc="A tiny password manager"
-url="http://github.com/nmeum/tpm"
+url="http://github.com/nmeum/$pkgname"
 arch="noarch"
 license="GPL3"
 depends="bash gnupg"
 makedepends="perl"
 install=""
-subpackages="$pkgname-doc $pkgname-completion"
-source="tpm-${pkgver}.tar.gz::https://github.com/nmeum/tpm/archive/${pkgver}.tar.gz"
+subpackages="
+	$pkgname-doc
+	$pkgname-zsh-completion:bashcomp
+	$pkgname-bash-completion:zshcomp"
+source="$pkgname-$pkgver.tar.gz::https://github.com/nmeum/$pkgname/archive/$pkgver.tar.gz"
+
+_builddir="$srcdir"/$pkgname-$pkgver
+build() {
+	make -C "$_builddir"
+}
 
-_builddir="$srcdir/tpm-$pkgver"
 package() {
 	make DESTDIR="$pkgdir" PREFIX="/usr" \
 		-C "$_builddir" install
 }
 
-completion() {
-	pkgdesc="bash/zsh completion files for tpm"
-	cd "$_builddir"
+bashcomp() {
+	depends=""
+	pkgdesc="Bash completions for $pkgname"
+	install_if="$pkgname=$pkgver-r$pkgrel bash"
+	arch="noarch"
+
+	install -Dm644 "$_builddir"/bash_completion \
+		"$subpkgdir"/usr/share/bash-completion/completions/${pkgname}
+}
+
+zshcomp() {
+	depends=""
+	pkgdesc="Zsh completions for $pkgname"
+	install_if="$pkgname=$pkgver-r$pkgrel zsh"
+	arch="noarch"
 
-	install -Dm644 zsh_completion \
-		"${subpkgdir}/usr/share/zsh/site-functions/_${pkgname}"
-	install -Dm644 bash_completion \
-		"${subpkgdir}/usr/share/bash-completion/completions/${pkgname}"
+	install -Dm644 "$_builddir"/zsh_completion \
+		"$subpkgdir"/usr/share/zsh/site-functions/_${pkgname}
 }
 
 md5sums="d522223a0776d337b75ec686dca3d50b  tpm-1.2.tar.gz"
-- 
2.5.0
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Tue Aug 18 2015 - 19:39:54 GMT