# Contributor: Peter Bui # Contributor: Sören Tempel # Contributor: Łukasz Jendrysik # Contributor: Timo Teräs # Maintainer: Timo Teräs pkgname=youtube-dl pkgver=2016.07.11 pkgrel=0 pkgdesc="A small command-line program to download videos from YouTube." url="http://youtube-dl.org " arch="noarch" license="Unlicense" 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() { pkgdesc="Zsh completions for $pkgname" arch="noarch" 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" arch="noarch" 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" arch="noarch" 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="2175d314e9a2715bf724b8c683ee536f youtube-dl-2016.07.11.tar.gz" sha256sums="f661957cf1f52bfa7b621cf1b02c0200862a7931e92e25cd984a9c302c3e4d87 youtube-dl-2016.07.11.tar.gz" sha512sums="7c112b238f65a7e4029204f06fa42c67c2fa5d370dc1d796c8fe83d0f585b355e2dfdebc8312bb082acbc72e98b0969b9894c0fba9297016eca2ac09d14b7c51 youtube-dl-2016.07.11.tar.gz"