# Template file for 'python-Sphinx'
pkgname=python-Sphinx
version=1.3.5
revision=1
noarch=yes
build_style=python-module
wrksrc="Sphinx-${version}"
python_versions="2.7 3.4"
hostmakedepends="
 python-setuptools python3.4-setuptools python-docutils python3.4-docutils
 python-Jinja2 python3.4-Jinja2 python-Pygments python3.4-Pygments
 python-six python3.4-six python-Babel python3.4-Babel python-alabaster
 python3.4-alabaster python-sphinx_rtd_theme python3.4-sphinx_rtd_theme
 python-snowballstemmer python3.4-snowballstemmer"
makedepends="${hostmakedepends}"
depends="
 python-setuptools python-docutils python-Jinja2 python-Pygments python-six
 python-Babel python-alabaster python-sphinx_rtd_theme python-snowballstemmer"
pycompile_module="sphinx"
short_desc="Python2 documentation generator"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="http://sphinx-doc.org/"
license="2-clause-BSD"
distfiles="${PYPI_SITE}/S/Sphinx/Sphinx-${version}.tar.gz"
checksum=b7d133bb4990d010a2ad934c319b52d8a2156cb0491484f5e2a558619bc9ae04

pre_build() {
	sed -i '/^#!/d' sphinx/pycode/pgen2/token.py
}
post_install() {
	for f in ${DESTDIR}/usr/bin/*; do
		cp -f ${f}{,3.4}
		replace_interpreter python ${f}
	done
	vlicense LICENSE
}

python3.4-Sphinx_package() {
	noarch=yes
	depends="
	 python3.4-setuptools python3.4-docutils python3.4-Jinja2 python3.4-Pygments
	 python3.4-six python3.4-Babel python3.4-alabaster python3.4-sphinx_rtd_theme
	 python3.4-snowballstemmer"
	pycompile_version="3.4"
	pycompile_module="sphinx"
	short_desc="${short_desc/Python2/Python3.4}"
	pkg_install() {
		vmove usr/bin/sphinx-*3.4
		vmove usr/lib/python3.4
		vlicense LICENSE
	}
}
