# Contributor: Peter Bui # Contributor: Sören Tempel # Contributor: Timo Teräs # Maintainer: Timo Teräs pkgname=youtube-dl pkgver=2018.12.17 pkgrel=0 pkgdesc="Command-line program to download videos from YouTube" url="https://youtube-dl.org" arch="noarch" license="Unlicense" depends="ffmpeg python3 py3-setuptools" options="!check" # FIXME: run provided tests subpackages="$pkgname-doc $pkgname-zsh-completion:zshcomp $pkgname-bash-completion:bashcomp $pkgname-fish-completion:fishcomp" source="https://github.com/rg3/youtube-dl/releases/download/$pkgver/$pkgname-$pkgver.tar.gz" builddir="$srcdir/$pkgname" prepare() { default_prepare sed -i \ -e 's|etc/bash_completion.d|share/bash-completion/completions|' \ -e 's|etc/fish/completions|share/fish/completions|' \ "$builddir"/setup.py } package() { cd "$builddir" python3 setup.py install --root="$pkgdir/" --optimize=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 } 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="88d98391d110d6542503590c4735c765137cde43bc3a1f1b33b197d323a1226ed550d559f67bd4aadab3c82de8a471fa71bf4e1440e5641e1c51ba5cb7059904 youtube-dl-2018.12.17.tar.gz"