summaryrefslogblamecommitdiff
path: root/user/youtube-dl/APKBUILD
blob: 70c5800f946044388a0c4f2156856aa5b15b3fc1 (plain) (tree)
1
2
3
4
5
6




                                                              
                 






                                                                                   
              















                                                                                          



                                    































                                                                                     
                                                                                                                                                                           
# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Timo Teräs <timo.teras@iki.fi>
# Maintainer: Max Rees <maxcrees@me.com>
pkgname=youtube-dl
pkgver=2019.11.28
pkgrel=0
pkgdesc="Command-line program to download videos from YouTube and many other sites"
url="https://youtube-dl.org"
arch="noarch"
options="!check"  # Takes way too long, and uses network
license="Unlicense AND Public-Domain"
depends="ffmpeg python3"
makedepends=""
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() {
	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"
}

check() {
	python3 -m unittest discover
}

package() {
	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="fd3fc9658428ecf96d681dd699db49e02f94343e5c49e370cb68a5764e8ecebc14b3ce5bc44db0a829b0d3c4fbffc96a1f8288fb24cbd21add6e9c7852b0915d  youtube-dl-2019.11.28.tar.gz"