# Contributor: Peter Bui # Contributor: Sören Tempel # Contributor: Timo Teräs # Maintainer: Timo Teräs pkgname=youtube-dl pkgver=2017.11.26 pkgrel=1 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 sed -i 's|etc/fish/completions|share/fish/completions|' setup.py } check() { cd "$builddir" ./youtube-dl --help > /dev/null } 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="ecf1eb88b37e271505a50709a468afcc6048f00bc6531e8df1eb064dcea62ad6fa2a5a9016d1d106e56b9d3b9904325e133491ca124e06ec64e6f4a5902a2368 youtube-dl-2017.11.26.tar.gz"