From cb631983be24b13b624b0b14677c239f5a39d75e Mon Sep 17 00:00:00 2001 From: Leonardo Arena Date: Wed, 20 Dec 2017 11:27:49 +0000 Subject: main/py-django-tables2: add support for python3 --- main/py-django-tables2/APKBUILD | 47 ++++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 15 deletions(-) (limited to 'main/py-django-tables2/APKBUILD') diff --git a/main/py-django-tables2/APKBUILD b/main/py-django-tables2/APKBUILD index b9191e18e7..a7829804d0 100644 --- a/main/py-django-tables2/APKBUILD +++ b/main/py-django-tables2/APKBUILD @@ -2,34 +2,51 @@ # Maintainer: Kaarle Ritvanen pkgname=py-django-tables2 pkgver=1.17.1 -pkgrel=0 +pkgrel=1 pkgdesc="Table/data-grid framework for Django" url=https://github.com/bradleyayers/django-tables2/ arch=noarch license=BSD depends="py-django py-six" -makedepends=py-setuptools +makedepends="py-setuptools" +subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" +options="!check" #no testsuite source="https://files.pythonhosted.org/packages/source/d/django-tables2/django-tables2-$pkgver.tar.gz" - -_builddir=$srcdir/django-tables2-$pkgver -prepare() { - local i - cd "$_builddir" - for i in $source; do - case $i in - *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; - esac - done -} +builddir="$srcdir"/django-tables2-$pkgver build() { cd "$_builddir" - ./setup.py build + python2 setup.py --quiet build + python3 setup.py --quiet build } package() { cd "$_builddir" - ./setup.py install --root "$pkgdir" + mkdir -p "$pkgdir"/usr/bin } +_py2() { + depends="${depends//py-/py2-}" + replaces=$pkgname + provides="$pkgname-r$pkgver" + _py python2 +} + +_py3() { + depends="${depends//py-/py3-}" + _py python3 +} + +_py() { + local python="$1" + local pyver="${1:6:1}" + pkgdesc="$pkgdesc (for $python)" + depends="$depends $python" + install_if="$pkgname=$pkgver-r$pkgrel $python" + + cd "$builddir" + $python setup.py --quiet install --prefix=/usr --root="$subpkgdir" +} + + sha512sums="0c0fc60b68d129d8600f151ac954d10b2ad215055c6285fab8db8115dff41fea588fe5e1f52ab41fd6e0a3e8e52d76c37df81e894d7022d25c393e059bacfc80 django-tables2-1.17.1.tar.gz" -- cgit v1.2.3