Mail archive
alpine-aports

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

From: Sören Tempel <soeren+git_at_soeren-tempel.net>
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
_at_@ -1,19 +1,23 @@
 # Contributor: Peter Bui <pnutzh4x0r_at_gmail.com>
+# Contributor: Sören Tempel <soeren+alpine_at_soeren-tempel.net>
 # Contributor: Łukasz Jendrysik <scadu_at_yandex.com>
 # Contributor: Timo Teräs <timo.teras_at_iki.fi>
 # Maintainer: Timo Teräs <timo.teras_at_iki.fi>
 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
_at_@ -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:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Fri Aug 14 2015 - 17:20:40 GMT