aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-09-25 16:15:40 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-09-25 16:18:18 +0200
commitd75610a117c360917d1724f02052ff9074151ea0 (patch)
tree23f2f6a774c855e12b0604724330eee1f49f8e23 /main
parent5b8cc2022f15aa485264122a75938cbb812938fa (diff)
downloadaports-d75610a117c360917d1724f02052ff9074151ea0.tar.bz2
aports-d75610a117c360917d1724f02052ff9074151ea0.tar.xz
main/py-jinja2: add py2/py3 subpackages
Diffstat (limited to 'main')
-rw-r--r--main/py-jinja2/APKBUILD39
1 files changed, 30 insertions, 9 deletions
diff --git a/main/py-jinja2/APKBUILD b/main/py-jinja2/APKBUILD
index 20d11ef6b3..967f54dfb0 100644
--- a/main/py-jinja2/APKBUILD
+++ b/main/py-jinja2/APKBUILD
@@ -3,32 +3,53 @@
pkgname=py-jinja2
_pkgname=Jinja2
pkgver=2.8
-pkgrel=0
+pkgrel=1
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"
+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"
- python setup.py build || return 1
+
+ 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 --root "$pkgdir" || return 1
+ $python setup.py install --prefix=/usr --root="$subpkgdir"
}
doc() {
+ default_doc || return 1
local docdir="$subpkgdir/usr/share/doc/$pkgname"
- default_doc || return 1
cd "$builddir"
# Note: The documentation in the docs directory needs to be generated
@@ -46,7 +67,7 @@ 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
+ "$subpkgdir"/usr/share/vim/vimfiles/syntax/jinja.vim
}
md5sums="edb51693fe22c53cee5403775c71a99e Jinja2-2.8.tar.gz"