# # Software packages for Chakra, part of www.chakra-project.org # # Maintainer: H W Tovetjärn (totte) # Contributors: R Biegelmeyer (RenanBS) # Sébastien Luttringer # Angel Velasquez # Fabio Volpe pkgbase=python-sphinx pkgname=('python3-sphinx' 'python2-sphinx') pkgver=1.3.6 pkgrel=1 arch=('any') url='http://sphinx.pocoo.org/' license=('GPL') makedepends=( 'python3-setuptools' 'python3-docutils' 'python3-jinja' 'python3-pygments' 'python3-six' 'python2-setuptools' 'python2-docutils' 'python2-jinja' 'python2-pygments' 'python2-six' ) checkdepends=( 'python3-nose' 'python2-nose' 'texlive-latexextra' 'python3-snowballstemmer' 'python2-snowballstemmer' 'python3-babel' 'python2-babel' 'python3-sphinx-alabaster-theme' 'python2-sphinx-alabaster-theme' 'python3-sphinx_rtd_theme' 'python2-sphinx_rtd_theme' 'python2-mock' 'python3-pytz' 'python2-pytz' ) source=("http://pypi.python.org/packages/source/S/Sphinx/Sphinx-$pkgver.tar.gz") md5sums=('7df638f47749f9284889c93012ffa07f') prepare() { # souce duplication is required because makefile modify source code # setyp.py --build tricks don't works well cp -a Sphinx-$pkgver Sphinx-${pkgver}2 # change python3 interpreter find Sphinx-${pkgver} -type f -exec \ sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python3,' {} \; # change python2 interpreter find Sphinx-${pkgver}2 -type f -exec \ sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python2,' {} \; # change sphinx-binaries name in source code find Sphinx-${pkgver}2 -type f -name '*.py' -exec \ sed -ri 's,(sphinx-(:?build|apidoc|autogen|quickstart)),\12,' {} \; } build() { cd Sphinx-$pkgver msg2 'Python 3 version' cd "$srcdir"/Sphinx-$pkgver make PYTHON=python3 build msg2 'Python 2 version' cd "$srcdir"/Sphinx-${pkgver}2 make PYTHON=python2 build } #check() { # msg2 'Python 3 version' # cd "$srcdir"/Sphinx-$pkgver # make PYTHON=python3 test # rm -r tests # # msg2 'Python 2 version' # cd "$srcdir"/Sphinx-${pkgver}2 # make PYTHON=python2 test # rm -r tests #} package_python3-sphinx() { pkgdesc='Python 3 documentation generator' depends=( 'python3-jinja' 'python3-pygments' 'python3-docutils' 'python3-sphinx_rtd_theme' 'python3-sphinx-alabaster-theme' 'python3-babel' 'python3-snowballstemmer' 'python3-six' ) optdepends=('texlive-latexextra: for generation of PDF documentation') cd Sphinx-$pkgver python3 setup.py install --root="$pkgdir" --optimize=1 } package_python2-sphinx() { pkgdesc='Python 2 documentation generator' depends=( 'python2-jinja' 'python2-pygments' 'python2-docutils' 'python2-sphinx_rtd_theme' 'python2-sphinx-alabaster-theme' 'python2-babel' 'python2-snowballstemmer' 'python2-six' ) optdepends=('texlive-latexextra: for generation of PDF documentation') cd Sphinx-${pkgver}2 python2 setup.py install --root="$pkgdir" --optimize=1 }