Mail archive
alpine-aports

[alpine-aports] [PATCH 3/4] testing/pass: split completion package

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

---
 testing/pass/APKBUILD | 66 ++++++++++++++++++++++++++++++++++++---------------
 1 file changed, 47 insertions(+), 19 deletions(-)
diff --git a/testing/pass/APKBUILD b/testing/pass/APKBUILD
index b1432fa..9db8b38 100644
--- a/testing/pass/APKBUILD
+++ b/testing/pass/APKBUILD
_at_@ -1,8 +1,9 @@
+# Contributor: Sören Tempel <soeren+alpine_at_soeren-tempel.net>
 # Contributor: Johannes Matheis <jomat+alpinebuild_at_jmt.gr>
 # Maintainer: Johannes Matheis <jomat+alpinebuild_at_jmt.gr>
 pkgname=pass
 pkgver=1.6.5
-pkgrel=0
+pkgrel=1
 pkgdesc="Stores, retrieves, generates, and synchronizes passwords securely"
 url="http://zx2c4.com/projects/password-store/"
 arch="noarch"
_at_@ -11,32 +12,59 @@ depends="bash"
 depends_dev=""
 makedepends="$depends_dev"
 install=""
-subpackages="$pkgname-doc $pkgname-completion $pkgname-contrib"
+subpackages="$pkgname-doc
+	$pkgname-contrib
+	$pkgname-zsh-completion:bashcomp
+	$pkgname-fish-completion:fishcomp
+	$pkgname-bash-completion:zshcomp"
 source="http://git.zx2c4.com/password-store/snapshot/password-store-${pkgver}.tar.xz"
 
 _builddir="$srcdir/password-store-$pkgver"
 package() {
-   cd "$_builddir"
-   make DESTDIR="$pkgdir" \
-       FORCE_BASHCOMP=0 \
-       FORCE_ZSHCOMP=0 \
-       FORCE_FISHCOMP=0 install
+	cd "$_builddir"
+	make DESTDIR="$pkgdir" \
+		FORCE_BASHCOMP=1 \
+		FORCE_ZSHCOMP=1 \
+		FORCE_FISHCOMP=1 install
 }
 
-completion() {
-   pkgdesc="bash/fish/zsh completion files for pass"
-   cd "$_builddir"
-   make DESTDIR="$subpkgdir" \
-       FORCE_BASHCOMP=1 \
-       FORCE_ZSHCOMP=1 \
-       FORCE_FISHCOMP=1 install-common
-   rm -rf "$subpkgdir"/usr/share/man/
+contrib() {
+	pkgdesc="contrib files for pass"
+	mkdir -p "$subpkgdir"/usr/share
+	cp -a "$_builddir"/contrib "$subpkgdir"/usr/share/$pkgname
 }
 
-contrib() {
-   pkgdesc="contrib files for pass"
-   mkdir -p "$subpkgdir"/usr/share
-   cp -a "$_builddir"/contrib "$subpkgdir"/usr/share/$pkgname
+bashcomp() {
+	depends=""
+	pkgdesc="Bash completions for $pkgname"
+	install_if="$pkgname=$pkgver-r$pkgrel bash"
+	arch="noarch"
+
+	mkdir -p "$subpkgdir"/usr/share/bash-completion/completions
+	mv "$pkgdir"/usr/share/bash-completion/completions/* \
+		"$subpkgdir"/usr/share/bash-completion/completions/ || return 1
+}
+
+fishcomp() {
+	depends=""
+	pkgdesc="Fish completions for $pkgname"
+	install_if="$pkgname=$pkgver-r$pkgrel fish"
+	arch="noarch"
+
+	mkdir -p "$subpkgdir"/usr/share/fish/completions/
+	mv "$pkgdir"/usr/share/fish/vendor_completions.d/* \
+		"$subpkgdir"/usr/share/fish/completions/ || return 1
+}
+
+zshcomp() {
+	depends=""
+	pkgdesc="Zsh completions for $pkgname"
+	install_if="$pkgname=$pkgver-r$pkgrel zsh"
+	arch="noarch"
+
+	mkdir -p "$subpkgdir/usr/share/zsh/site-functions"
+	mv "$pkgdir"/usr/share/zsh/site-functions/* \
+		"$subpkgdir"/usr/share/zsh/site-functions || return 1
 }
 
 md5sums="2c4468360c678184051e76f03c2f6b04  password-store-1.6.5.tar.xz"
-- 
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:55 GMT