aboutsummaryrefslogtreecommitdiffstats
path: root/community/youtube-dl/APKBUILD
blob: bac640c3400d5eee354d7978a5a75da1cb7dd029 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=youtube-dl
pkgver=2016.04.06
pkgrel=0
pkgdesc="A small command-line program to download videos from YouTube."
url="http://youtube-dl.org "
arch="noarch"
license="Public Domain"
depends="python>=2.5 py-setuptools ffmpeg"
subpackages="
	$pkgname-doc
	$pkgname-zsh-completion:zshcomp
	$pkgname-bash-completion:bashcomp
	$pkgname-fish-completion:fishcomp"
source="http://$pkgname.org/downloads/$pkgver/$pkgname-$pkgver.tar.gz"

_builddir="$srcdir"/$pkgname
prepare() {
	cd "$_builddir"
	sed -i 's|etc/bash_completion.d|share/bash-completion/completions|' setup.py || return 1
	sed -i 's|etc/fish/completions|share/fish/completions|' setup.py || return 1
}

package() {
	cd "$_builddir"
	python setup.py install --root="$pkgdir/" --optimize=1 || return 1
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" || return 1
}

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

	install -Dm644 "$_builddir"/$pkgname.zsh \
		"$subpkgdir"/usr/share/zsh/site-functions/_$pkgname || return 1
}

bashcomp() {
	depends=""
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
	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="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/completions/$pkgname.fish \
		"$subpkgdir"/usr/share/fish/completions/ || return 1
}

md5sums="6457b915a6df78deb6e730cc425f9695  youtube-dl-2016.04.06.tar.gz"
sha256sums="115a7443162198f12d97c2c1d83e69d462f78410a26d6dd5ae3c74603397b9cd  youtube-dl-2016.04.06.tar.gz"
sha512sums="cd22fa19f17a78b5f45e3a765441ca61050f926a160772d1812f4cfecd982c6b36c9897cdd83dcdf3586bc9182d41644b768f7c2379fe12ee4b7269bc1937df0  youtube-dl-2016.04.06.tar.gz"