aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-jinja2/APKBUILD
blob: 20d11ef6b379de8670e2b949a565cb1838b62462 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Contributor: Matt Smith <mcs@darkregion.net>
# Maintainer: Matt Smith <mcs@darkregion.net>
pkgname=py-jinja2
_pkgname=Jinja2
pkgver=2.8
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"
depends="python py-markupsafe"
makedepends="python-dev py-setuptools"
install=""
subpackages="$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"
	python setup.py build || return 1
}

package() {
	cd "$builddir"
	python setup.py install --root "$pkgdir" || return 1
}

doc() {
	local docdir="$subpkgdir/usr/share/doc/$pkgname"

	default_doc || return 1
	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="edb51693fe22c53cee5403775c71a99e  Jinja2-2.8.tar.gz"
sha256sums="bc1ff2ff88dbfacefde4ddde471d1417d3b304e8df103a7a9437d47269201bf4  Jinja2-2.8.tar.gz"
sha512sums="2e80d6d9ad10dafcce1e6dd24493f5dffc43a17f71a30a650415638e12d3a3891738ebacc569701129214026d062d91a2b10e4f7a2c7b85d801dde26ded1bebb  Jinja2-2.8.tar.gz"