diff options
-rw-r--r-- | community/py-pathtools/APKBUILD | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/community/py-pathtools/APKBUILD b/community/py-pathtools/APKBUILD index a5c6ed4026..42a756e7a9 100644 --- a/community/py-pathtools/APKBUILD +++ b/community/py-pathtools/APKBUILD @@ -3,24 +3,44 @@ pkgname=py-pathtools _pkgname=pathtools pkgver=0.1.2 -pkgrel=1 +pkgrel=2 pkgdesc="Path utilities for Python" url="https://github.com/gorakhargosh/pathtools" arch="noarch" license="MIT" depends="" -makedepends="py-setuptools python2-dev" +makedepends="py-setuptools python2-dev python3-dev" +subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" source="$pkgname-$pkgver.tar.gz::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() { + replaces="$pkgname" + _py python2 +} + +_py3() { + _py python3 +} + +_py() { + local python="$1" + pkgdesc="$pkgdesc (for $python)" + depends="$depends $python" + install_if="$pkgname=$pkgver-r$pkgrel $python" + cd "$builddir" - python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1 + $python setup.py install --prefix=/usr --root="$subpkgdir" } md5sums="9a1af5c605768ea5804b03b734ff0f82 py-pathtools-0.1.2.tar.gz" |