aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-purl/APKBUILD
diff options
context:
space:
mode:
authorFabian Affolter <fabian@affolter-engineering.ch>2016-11-08 08:55:53 +0000
committerJakub Jirutka <jakub@jirutka.cz>2016-11-08 23:17:53 +0100
commitb15bca17d970cee681ac9c5e76f374f81ab73b55 (patch)
treefd91833f8762b68a4574d37917a7551dfef1c5b6 /main/py-purl/APKBUILD
parent644acaf577ece2e6562e08f38f16b162da46cb80 (diff)
downloadaports-b15bca17d970cee681ac9c5e76f374f81ab73b55.tar.gz
aports-b15bca17d970cee681ac9c5e76f374f81ab73b55.tar.bz2
aports-b15bca17d970cee681ac9c5e76f374f81ab73b55.tar.xz
main/py-purl: add py2/py3 subpackages
Diffstat (limited to 'main/py-purl/APKBUILD')
-rw-r--r--main/py-purl/APKBUILD49
1 files changed, 29 insertions, 20 deletions
diff --git a/main/py-purl/APKBUILD b/main/py-purl/APKBUILD
index afc3c6e750..17e30b0178 100644
--- a/main/py-purl/APKBUILD
+++ b/main/py-purl/APKBUILD
@@ -3,37 +3,46 @@
pkgname=py-purl
_pkgname=purl
pkgver=1.3
-pkgrel=0
+pkgrel=1
pkgdesc="An immutable Python URL class for easy URL-building and manipulation"
url="https://github.com/codeinthehole/purl"
arch="noarch"
license="MIT"
-depends="python2 py-six"
-depends_dev=""
-makedepends="python2-dev py-setuptools"
-install=""
-subpackages=""
+depends="py-six"
+makedepends="python2-dev python3-dev py-setuptools"
+subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
-
-_builddir="$srcdir"/$_pkgname-$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/$_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 --prefix=/usr --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"
}
md5sums="4aad2cf530fc4f1b9e60818d98d9d19f purl-1.3.tar.gz"