aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-07-22 00:09:07 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-07-22 00:10:39 +0200
commit2b99f9d4263f00b6e3572d124549a5c684d57a66 (patch)
tree22cf49affd4a2f4e6cf44fe66b3be5b01736d42a /testing
parenta62369e7f67b1769f9689733c4a1de2091e14c6c (diff)
downloadaports-2b99f9d4263f00b6e3572d124549a5c684d57a66.tar.bz2
aports-2b99f9d4263f00b6e3572d124549a5c684d57a66.tar.xz
testing/py-pymysql: add py2/py3 subpackages
Diffstat (limited to 'testing')
-rw-r--r--testing/py-pymysql/APKBUILD28
1 files changed, 24 insertions, 4 deletions
diff --git a/testing/py-pymysql/APKBUILD b/testing/py-pymysql/APKBUILD
index a7aa04124b..c215cdbccc 100644
--- a/testing/py-pymysql/APKBUILD
+++ b/testing/py-pymysql/APKBUILD
@@ -8,19 +8,39 @@ pkgdesc="Pure Python MySQL Client"
url="https://pypi.python.org/pypi/PyMySQL"
arch="noarch"
license="MIT"
-depends="python2"
-makedepends="python2-dev py-setuptools"
+makedepends="python2-dev python3-dev py-setuptools"
+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
+ python2 setup.py build
+ python3 setup.py build
}
package() {
+ mkdir -p "$pkgdir"
+}
+
+_py2() {
+ replaces="$pkgname"
+ _py python2
+}
+
+_py3() {
+ _py python3
+}
+
+_py() {
+ local python="$1"
+ pkgdesc="$pkgdesc (for $python)"
+ 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"
+ rm -r "$subpkgdir"/usr/lib/python*/site-packages/pymysql/tests
}
md5sums="a87650294d868d6fc7dc81ac4248f873 py-pymysql-0.7.5.tar.gz"