# Template file for 'python-Jinja2'
pkgname=python-Jinja2
version=2.9.6
revision=1
noarch=yes
wrksrc="Jinja2-${version}"
build_style=python-module
pycompile_module="jinja2"
hostmakedepends="python-setuptools python3-setuptools"
depends="python-MarkupSafe"
short_desc="Full featured template engine (Python2)"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="http://jinja.pocoo.org/"
license="3-clause-BSD"
distfiles="${PYPI_SITE}/J/Jinja2/Jinja2-${version}.tar.gz"
checksum=ddaa01a212cd6d641401cb01b605f4a4d9f37bfc93043d7f760ec70fb99ff9ff

post_install() {
	# these files are valid only on Python 3.6+
	for py_sitelib in $py2_sitelib $py3_sitelib; do
		rm -f ${DESTDIR}/${py_sitelib}/jinja2/asyncsupport.py
		rm -f ${DESTDIR}/${py_sitelib}/jinja2/asyncfilters.py
	done
	vlicense LICENSE
}

python3-Jinja2_package() {
	noarch=yes
	depends="python3-MarkupSafe"
	replaces="python3.4-Jinja2>=0"
	pycompile_module="jinja2"
	short_desc="${short_desc/Python2/Python3}"
	pkg_install() {
		vmove usr/lib/python3*
		vlicense LICENSE
	}
}
python3.4-Jinja2_package() {
	noarch=yes
	build_style=meta
	short_desc="${short_desc/Python2/Python3.4} (transitional dummy package)"
	depends="python3-Jinja2>=${version}_${revision}"
}
