aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorFabian Affolter <fabian@affolter-engineering.ch>2016-11-07 16:46:03 +0000
committerJakub Jirutka <jakub@jirutka.cz>2016-11-09 02:32:27 +0100
commit9561154b99f03a984247e5e3298fa0e6b6bb4342 (patch)
tree7ca9981f084f9288a6d8bd8dc2dc227c244af194 /main
parentb6bc543b5fe80c40f66ce1ab67720463bd904636 (diff)
downloadaports-9561154b99f03a984247e5e3298fa0e6b6bb4342.tar.bz2
aports-9561154b99f03a984247e5e3298fa0e6b6bb4342.tar.xz
main/py-mock: add py2/py3 subpackages
Diffstat (limited to 'main')
-rw-r--r--main/py-mock/APKBUILD49
1 files changed, 29 insertions, 20 deletions
diff --git a/main/py-mock/APKBUILD b/main/py-mock/APKBUILD
index 6a49697f40..d4ddbf5dbb 100644
--- a/main/py-mock/APKBUILD
+++ b/main/py-mock/APKBUILD
@@ -3,37 +3,46 @@
pkgname=py-mock
_pkgname=mock
pkgver=2.0.0
-pkgrel=1
+pkgrel=2
pkgdesc="A Python Mocking and Patching Library for Testing"
url="https://github.com/testing-cabal/mock"
arch="noarch"
license="BSD"
-depends="python2 py-pbr py-funcsigs py-six"
-depends_dev=""
-makedepends="python2-dev py-setuptools"
-install=""
-subpackages=""
+depends="py-pbr 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-} py2-funcsigs"
+ _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="0febfafd14330c9dcaa40de2d82d40ad mock-2.0.0.tar.gz"