# Contributor: Peter Bui # Contributor: Sören Tempel # Contributor: Timo Teräs # Maintainer: Timo Teräs pkgname=youtube-dl pkgver=2020.01.01 pkgrel=0 pkgdesc="Command-line program to download videos from YouTube" url="https://youtube-dl.org/" arch="noarch" license="Unlicense" depends="python3 py3-setuptools" checkdepends="py3-flake8 py3-nose" 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/youtube-dl-$pkgver.tar.gz 0001-devscripts-create-github-release-do-not-import-base6.patch" 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 } build() { python3 setup.py build } check() { PYTHON=/usr/bin/python3 make offlinetest } package() { python3 setup.py install --prefix=/usr --root="$pkgdir" } zshcomp() { pkgdesc="Zsh completions for $pkgname" 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" 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" 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="035d44aa4989067587d3c5a8d1bb4214bb7bfa16b91562c730fcf93de1578de75ddf12c8a0900643578546a4230da776b8b83f69378525c1480e9e0061f492cf youtube-dl-2020.01.01.tar.gz ccdf23dd5284f760120aae257e5f534ed785091e6db4eb2c8e0e95f50bfa9da0a2440e92e47ab5625cc59032557bdcaa009e6a6c129057a3a665b7f9521d125a 0001-devscripts-create-github-release-do-not-import-base6.patch"