# Contributor: Peter Bui # Contributor: Sören Tempel # Contributor: Timo Teräs # Maintainer: Timo Teräs pkgname=youtube-dl pkgver=2018.01.18 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 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="8770b82b61b9038eccdbfe1391d85b7ac8edd8ff1258259a8955ca12b98559b889b0d98e8d39df1f27e7c7dd92cd7ee303af15de19eedfa74206d2a66155c12b youtube-dl-2018.01.18.tar.gz"