aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-six/APKBUILD
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2016-07-18 14:34:59 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2016-07-18 14:36:01 +0000
commit09fb8bdb2a1e719c133521a506a7ad95617ac70d (patch)
tree7cd480961c5c04be6da83ff21a9234e2d99d1909 /main/py-six/APKBUILD
parent4cfaab7f3fc1b273d489ceb027bca0c3bcb40082 (diff)
downloadaports-09fb8bdb2a1e719c133521a506a7ad95617ac70d.tar.bz2
aports-09fb8bdb2a1e719c133521a506a7ad95617ac70d.tar.xz
main/py-six: added python3 support, added py2 and py3 subpackages
Diffstat (limited to 'main/py-six/APKBUILD')
-rw-r--r--main/py-six/APKBUILD49
1 files changed, 32 insertions, 17 deletions
diff --git a/main/py-six/APKBUILD b/main/py-six/APKBUILD
index 1383d741ad..ffaec325fc 100644
--- a/main/py-six/APKBUILD
+++ b/main/py-six/APKBUILD
@@ -3,39 +3,54 @@
pkgname=py-six
_pkgname=six
pkgver=1.10.0
-pkgrel=0
+pkgrel=1
pkgdesc="Python 2 and 3 compatibility library"
url="http://pypi.python.org/pypi/six"
arch="noarch"
license="MIT"
-depends="python"
+depends="python python3"
depends_dev=""
-makedepends="python-dev"
+makedepends="python-dev python3-dev"
install=""
-subpackages=""
+subpackages="py3-$_pkgname:_py3 py2-$_pkgname:_py2"
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"
python setup.py build || return 1
+ python3 setup.py build || return 1
}
package() {
- cd "$_builddir"
- python setup.py install --prefix=/usr --root="$pkgdir" || return 1
+ cd "$builddir"
+ python setup.py install --root=$pkgdir/ --optimize=1 || return 1
+ python3 setup.py install --root=$pkgdir/ --optimize=1 || return 1
+}
+
+
+_py() {
+ local python=$1
+ pkgdesc="$pkgdesc - $python"
+ install_if="$pkgname=$pkgver-r$pkgrel $python"
+ local dir=$($python -c 'import sysconfig; print(sysconfig.get_path("stdlib"))')
+
+ mkdir -p "$subpkgdir"${dir}
+ mv "$pkgdir"${dir}/* "$subpkgdir"${dir}
}
+_py2() {
+ _py python2
+ replaces="$pkgname"
+}
+
+_py3() {
+ _py python3
+}
+
+
+
md5sums="34eed507548117b2ab523ab14b2f8b55 six-1.10.0.tar.gz"
sha256sums="105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a six-1.10.0.tar.gz"
sha512sums="9a53b7bc8f7e8b358c930eaecf91cc5639176a699830153f586780c3e6d637f1bd31349a69c383574f99da19cb3a36524e7733a318f3572b27aefb69c6409c2e six-1.10.0.tar.gz"