aboutsummaryrefslogtreecommitdiffstats
path: root/community/pytest
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-11-19 18:59:21 +0100
committerJakub Jirutka <jakub@jirutka.cz>2016-11-19 18:59:59 +0100
commit43a00c0d702e8525751d9c35940591b30c8bc723 (patch)
tree0c028c56bc72475d4544f298cb0bba6f172fb3fb /community/pytest
parentefa1edf4e055b70bde46388d38edd799761e8d9c (diff)
community/pytest: fix conflicts in /usr/bin between py2 and py3
Diffstat (limited to 'community/pytest')
-rw-r--r--community/pytest/APKBUILD18
1 files changed, 14 insertions, 4 deletions
diff --git a/community/pytest/APKBUILD b/community/pytest/APKBUILD
index 6132bf24a5e..0d6df5cca2c 100644
--- a/community/pytest/APKBUILD
+++ b/community/pytest/APKBUILD
@@ -7,7 +7,7 @@ pkgdesc="A python test library"
url="http://pytest.org"
arch="noarch"
license="MIT"
-depends="py-py"
+depends="py3-$pkgname"
makedepends="python2-dev py-setuptools python3-dev"
subpackages="py3-$pkgname:_py3 py2-$pkgname:_py2"
source="https://files.pythonhosted.org/packages/source/${pkgname:0:1}/$pkgname/$pkgname-$pkgver.tar.gz"
@@ -20,28 +20,38 @@ build() {
}
package() {
- mkdir -p "$pkgdir"
+ mkdir -p "$pkgdir"/usr/bin
+
+ local name; for name in py.test pytest; do
+ ln -s $name-3 "$pkgdir"/usr/bin/$name || return 1
+ done
}
_py2() {
replaces="$pkgname"
- depends="${depends//py-/py2-}"
+ depends="py2-py"
_py python2
}
_py3() {
- depends="${depends//py-/py3-}"
+ depends="py3-py"
_py python3
}
_py() {
local python="$1"
+ local pyver="${1:6: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"
+
+ # Add version suffix to executable files.
+ local path; for path in "$subpkgdir"/usr/bin/*; do
+ mv "$path" "$path-$pyver" || return 1
+ done
}
md5sums="b33b3b1f847d3745a78423762f6b7f6d pytest-3.0.3.tar.gz"