# Template file for 'youtube-dl'
pkgname=youtube-dl
version=2016.04.01
revision=2
noarch=yes
build_style=python-module
wrksrc="${pkgname}"
hostmakedepends="python python3.4"
depends="python python-youtube-dl"
python_versions="2.7 3.4"
pycompile_module="youtube_dl"
short_desc="Small CLI program to download videos from YouTube and other sites"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="http://rg3.github.com/youtube-dl/"
license="Public Domain"
distfiles="https://yt-dl.org/downloads/${version}/${pkgname}-${version}.tar.gz"
checksum=474a9d901252c05ec9d8131016dab4a2fb40d9c323e7ebdd5c5e30c9eee3e824

post_install() {
	rm -rf ${DESTDIR}/usr/etc
	vinstall ${pkgname}.bash-completion 644 usr/share/bash-completion/completions ${pkgname}
	vinstall ${pkgname}.zsh 644 usr/share/zsh/site-functions _${pkgname}
	vinstall ${pkgname}.fish 644 usr/share/fish/completions ${pkgname}
}

python-youtube-dl_package() {
	short_desc+=" - Python2 module"
	noarch=yes
	pycompile_version="2.7"
	pycompile_module="youtube_dl"
	pkg_install() {
		vmove usr/lib/python2.7
	}
}

python3.4-youtube-dl_package() {
	short_desc+=" - Python3.4 module"
	noarch=yes
	pycompile_version="3.4"
	pycompile_module="youtube_dl"
	pkg_install() {
		vmove usr/lib/python3.4
	}
}

