aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-tz
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-09-18 18:42:15 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-09-18 18:42:36 +0200
commiteb8e0230e85c2ad686ff50453888b867f121e739 (patch)
treedc32daff652bd31684e390f07f2f79d64243dd79 /main/py-tz
parent5c68640dd92b404467ee60f56c289ae2d1178d9e (diff)
downloadaports-eb8e0230e85c2ad686ff50453888b867f121e739.tar.bz2
aports-eb8e0230e85c2ad686ff50453888b867f121e739.tar.xz
main/py-tz: add py2/py3 subpackages
Diffstat (limited to 'main/py-tz')
-rw-r--r--main/py-tz/APKBUILD50
1 files changed, 29 insertions, 21 deletions
diff --git a/main/py-tz/APKBUILD b/main/py-tz/APKBUILD
index 509faf244a..822a34d4ef 100644
--- a/main/py-tz/APKBUILD
+++ b/main/py-tz/APKBUILD
@@ -3,37 +3,45 @@
pkgname=py-tz
_pkgname=pytz
pkgver=2016.6.1
-pkgrel=0
+pkgrel=1
pkgdesc="A Python definitions of world timezone"
url="http://pytz.sourceforge.net/"
arch="noarch"
license="MIT"
-depends="python"
-depends_dev=""
-makedepends="python-dev py-setuptools"
-install=""
-subpackages=""
+depends=""
+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"
- python setup.py build || return 1
+ cd "$builddir"
+
+ python2 setup.py build || return 1
+ python3 setup.py build
}
package() {
- cd "$_builddir"
- python setup.py install --prefix=/usr --root="$pkgdir" || return 1
+ mkdir -p "$pkgdir"
+}
+
+_py2() {
+ replaces="$pkgname"
+ _py python2
+}
+
+_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="b6c28a3b968bc1d8badfb61b93874e03 pytz-2016.6.1.tar.gz"