Subject: [alpine-aports] [PATCH] main/youtube-dl: add subpackages

From: Sören Tempel <[email-masked]>
Date: Fri, 14 Aug 2015 17:20:40 +0200

The following subpackages where added:
- youtube-dl-bash-completion
- youtube-dl-fish-completion
- youtube-dl-doc
---
 main/youtube-dl/APKBUILD | 42 +++++++++++++++++++++++++++++++++---------
 1 file changed, 33 insertions(+), 9 deletions(-)

diff --git a/main/youtube-dl/APKBUILD b/main/youtube-dl/APKBUILD
index 52c9984..9db8273 100644
--- a/main/youtube-dl/APKBUILD
+++ b/main/youtube-dl/APKBUILD
@@ -1,19 +1,23 @@
 # Contributor: Peter Bui <[email-masked]>
+# Contributor: Sören Tempel <[email-masked]>
 # Contributor: Łukasz Jendrysik <[email-masked]>
 # Contributor: Timo Teräs <[email-masked]>
 # Maintainer: Timo Teräs <[email-masked]>
 pkgname=youtube-dl
 pkgver=2015.07.28
-pkgrel=0
+pkgrel=1
 pkgdesc="A small command-line program to download videos from YouTube."
-url="http://rg3.github.io/youtube-dl/"
+url="http://rg3.github.io/$pkgname/"
 arch="noarch"
 license="Public Domain"
 depends="python>=2.5 py-setuptools ffmpeg"
-subpackages=""
-source="http://youtube-dl.org/downloads/$pkgver/$pkgname-$pkgver.tar.gz"
+subpackages="
+	$pkgname-doc
+	$pkgname-bash-completion:bashcomp
+	$pkgname-fish-completion:fishcomp"
+source="http://$pkgname.org/downloads/$pkgver/$pkgname-$pkgver.tar.gz"
 
-_builddir="$srcdir"/youtube-dl
+_builddir="$srcdir"/$pkgname
 prepare() {
 	cd "$_builddir"
 	sed -i 's|etc/bash_completion.d|share/bash-completion/completions|' setup.py || return 1
@@ -22,10 +26,30 @@ prepare() {
 
 package() {
 	cd "$_builddir"
-	  python setup.py install --root="$pkgdir/" --optimize=1 || return 1
-	  mv "$pkgdir/usr/share/bash-completion/completions/youtube-dl.bash-completion" \
-	"$pkgdir/usr/share/bash-completion/completions/youtube-dl"
-install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" || return 1
+	python setup.py install --root="$pkgdir/" --optimize=1 || return 1
+	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" || return 1
+}
+
+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/$pkgname.bash-completion \
+		"$subpkgdir"/usr/share/bash-completion/completions/$pkgname || return 1
+}
+
+fishcomp() {
+	depends=""
+	pkgdesc="Bash completions for $pkgname"
+	install_if="$pkgname=$pkgver-r$pkgrel fish"
+	arch="noarch"
+
+	mkdir -p "$subpkgdir"/usr/share/fish/completions/
+	mv "$pkgdir"/usr/share/fish/completions/$pkgname.fish \
+		"$subpkgdir"/usr/share/fish/completions/ || return 1
 }
 
 md5sums="fbab5aafb7274e965ed0df24ab9970dc  youtube-dl-2015.07.28.tar.gz"
-- 
2.5.0

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---