aboutsummaryrefslogtreecommitdiffstats
path: root/community/youtube-dl/APKBUILD
blob: e5fb40d091b1e6b5d34bdb8a3c639606790c6e18 (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
# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Timo Teräs <timo.teras@iki.fi>
pkgname=youtube-dl
pkgver=2017.01.29
pkgrel=0
pkgdesc="A small command-line program to download videos from YouTube."
url="http://youtube-dl.org "
arch="noarch"
license="Unlicense"
depends="python2 py-setuptools ffmpeg"
subpackages="
	$pkgname-doc
	$pkgname-zsh-completion:zshcomp
	$pkgname-bash-completion:bashcomp
	$pkgname-fish-completion:fishcomp"
source="https://github.com/rg3/$pkgname/releases/download/$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"
	python2 setup.py install --root="$pkgdir/" --optimize=1 || return 1
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" || return 1
}

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

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

bashcomp() {
	pkgdesc="Bash completions for $pkgname"
	depends=""
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	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() {
	pkgdesc="Fish completions for $pkgname"
	depends=""
	install_if="$pkgname=$pkgver-r$pkgrel fish"

	mkdir -p "$subpkgdir"/usr/share/fish/completions/
	mv "$pkgdir"/usr/share/fish/completions/$pkgname.fish \
		"$subpkgdir"/usr/share/fish/completions/ || return 1
}

md5sums="11dc372f3b2057f76d515712454c861a  youtube-dl-2017.01.29.tar.gz"
sha256sums="3475380e277f3517322c355815a1d7e023a023a565b3c724247c9a9509eb3a6e  youtube-dl-2017.01.29.tar.gz"
sha512sums="8e2b335fcde0e9cae185e189dc3c30770c7c59af60fc66fd53f0172f5d0d41675e2c9dc40f2efa9ef60ea782134157cd5af2cf5257b76a4519a22e4b6ea51de3  youtube-dl-2017.01.29.tar.gz"