# Contributor: Peter Bui # Contributor: Sören Tempel # Contributor: Łukasz Jendrysik # Contributor: Timo Teräs # Maintainer: Timo Teräs pkgname=youtube-dl pkgver=2016.11.22 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="2ea9c4c822ec5cc285a226bc5f93b62d youtube-dl-2016.11.22.tar.gz" sha256sums="e8d599c512ce56a6ea46955e2bb8f4471ae8a6f757183212cc49b6dd48d9a282 youtube-dl-2016.11.22.tar.gz" sha512sums="8133add5429e4edc7a9d560e22fb4ea6b63d3577b72761fb49882dacc1d32069895f48ba9dab27c1bb72f5cb162d244ec6cbbb8aa3ceef821844f6c534ab579e youtube-dl-2016.11.22.tar.gz"