# Contributor: Matt Smith # Maintainer: Matt Smith pkgname=py-jinja2 _pkgname=Jinja2 pkgver=2.9.4 pkgrel=0 pkgdesc="A small but fast and easy to use stand-alone python template engine" url="http://jinja.pocoo.org/" arch="noarch" license="BSD" makedepends="python2-dev python3-dev py-setuptools" subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3 $pkgname-doc $pkgname-vim" source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz" builddir="$srcdir/$_pkgname-$pkgver" build() { cd "$builddir" python2 setup.py build || return 1 python3 setup.py build || return 1 } package() { mkdir -p "$pkgdir" } _py2() { depends="py2-markupsafe" replaces="$pkgname" _py python2 } _py3() { depends="py3-markupsafe" _py python3 } _py() { local python="$1" pkgdesc="$pkgdesc (for $python)" depends="$depends $python" install_if="$pkgname=$pkgver-r$pkgrel $python" cd "$builddir" $python setup.py install --prefix=/usr --root="$subpkgdir" } doc() { default_doc || return 1 local docdir="$subpkgdir/usr/share/doc/$pkgname" cd "$builddir" # Note: The documentation in the docs directory needs to be generated # by py-sphinx, however, this package (py-jinja2) is a dependency of # Sphinx itself! mkdir -p "$docdir" cp -R docs examples "$docdir"/ || return 1 install -m 644 -D LICENSE "$subpkgdir"/usr/share/licenses/$pkgname/LICENSE } vim() { pkgdesc="Vim syntax for Jinja2" depends="vim" install_if="$pkgname=$pkgver-r$pkgrel vim" install -m 644 -D "$builddir"/ext/Vim/jinja.vim \ "$subpkgdir"/usr/share/vim/vimfiles/syntax/jinja.vim } md5sums="b151bfab6fb728fb7a06da4299161c74 Jinja2-2.9.4.tar.gz" sha256sums="aab8d8ca9f45624f1e77f2844bf3c144d180e97da8824c2a6d7552ad039b5442 Jinja2-2.9.4.tar.gz" sha512sums="a44ea6876837238e5c744988b94f551fa20f3d4565c1f97afec89bb89da3da5507cdbc554a95ac49b80613cf4086a2465b90aa7c64578e1f952321a27c962c8b Jinja2-2.9.4.tar.gz"