From 56c95218ffa2c148187ea8df7f447b75d6e09b2f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 7 Nov 2016 20:41:31 +0000 Subject: main/py-docutils: add py2/py3 subpackages --- main/py-docutils/APKBUILD | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) (limited to 'main/py-docutils/APKBUILD') diff --git a/main/py-docutils/APKBUILD b/main/py-docutils/APKBUILD index 3f817a4977..d7dfe79a9d 100644 --- a/main/py-docutils/APKBUILD +++ b/main/py-docutils/APKBUILD @@ -1,33 +1,48 @@ # Contributor: Matt Smith -# Maintainer: Matt Smith +# Maintainer: Matt Smith pkgname=py-docutils _pkgname=docutils pkgver=0.12 -pkgrel=0 +pkgrel=1 pkgdesc="Documentation Utilities for Python" url="http://docutils.sourceforge.net/" arch="noarch" -license="PublicDomain" -depends="python2 py-pillow py-roman" -makedepends="python2-dev py-setuptools" -install= -subpackages="$pkgname-doc" +license="Public Domain" +depends="py-pillow py-roman" +makedepends="python2-dev python3-dev py-setuptools" +subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3 $pkgname-doc" source="http://downloads.sourceforge.net/$_pkgname/$_pkgname-$pkgver.tar.gz" - -_builddir="$srcdir"/$_pkgname-$pkgver -prepare() { - cd "$_builddir" - # apply patches here -} +builddir="$srcdir/$_pkgname-$pkgver" build() { - cd "$_builddir" + cd "$builddir" python2 setup.py build || return 1 + python3 setup.py build || return 1 } package() { - cd "$_builddir" - python2 setup.py install --root "$pkgdir" || return 1 + mkdir -p "$pkgdir" +} + +_py2() { + replaces="$pkgname" + depends="${depends//py-/py2-}" + _py python2 +} + +_py3() { + depends="${depends//py-/py3-}" + _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() { -- cgit v1.2.3