# Contributor: Peter Bui # Contributor: Sören Tempel # Contributor: Timo Teräs # Maintainer: Timo Teräs pkgname=youtube-dl pkgver=2017.11.06 pkgrel=0 pkgdesc="A small command-line program to download videos from YouTube" url="http://youtube-dl.org" arch="noarch" license="Unlicense" options="!check" 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 sed -i 's|etc/fish/completions|share/fish/completions|' setup.py } package() { cd "$builddir" python2 setup.py install --root="$pkgdir/" --optimize=1 install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" } 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 } 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 } 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/ } sha512sums="0f7707084f84e7375ae61ffa88979990ba27cf2afb44992d75172415190f5959fe317313b127cbdde33500ed6b0525e9ff03872116dfa7ca188a97e74d562574 youtube-dl-2017.11.06.tar.gz"