aboutsummaryrefslogtreecommitdiffstats
path: root/community
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-10-01 23:40:40 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-10-01 23:42:16 +0200
commit76d2855e5af26bbd3a43ded9702c7cad5a526c66 (patch)
tree5d7f1a5855ff15cabbb4ccfae6cc4d4367e6c169 /community
parentc7414f4310e8e34097d1ad43d352892cb3069998 (diff)
downloadaports-76d2855e5af26bbd3a43ded9702c7cad5a526c66.tar.bz2
aports-76d2855e5af26bbd3a43ded9702c7cad5a526c66.tar.xz
community/py-rfc3339: add py2/py3 subpackages
Diffstat (limited to 'community')
-rw-r--r--community/py-rfc3339/APKBUILD52
1 files changed, 31 insertions, 21 deletions
diff --git a/community/py-rfc3339/APKBUILD b/community/py-rfc3339/APKBUILD
index 39af7f2c28..1e5b609b08 100644
--- a/community/py-rfc3339/APKBUILD
+++ b/community/py-rfc3339/APKBUILD
@@ -1,6 +1,7 @@
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
pkgname=py-rfc3339
+_pkgname=pyRFC3339
pkgver=1.0
pkgrel=0
pkgdesc="Generate and parse RFC 3339 timestamps"
@@ -8,32 +9,41 @@ url="https://pypi.python.org/pypi/pyRFC3339"
arch="noarch"
license="MIT"
depends="py-tz"
-depends_dev=""
-makedepends="$depends_dev py-setuptools"
-install=""
-subpackages=""
-source="https://files.pythonhosted.org/packages/source/p/pyRFC3339/pyRFC3339-$pkgver.tar.gz"
-
-_builddir="$srcdir"/pyRFC3339-$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
-}
+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"
build() {
- cd "$_builddir"
- python setup.py build || return 1
+ cd "$builddir"
+
+ python2 setup.py build || return 1
+ python3 setup.py build || return 1
}
package() {
- cd "$_builddir"
- python setup.py install --prefix=/usr --root="$pkgdir" || return 1
+ mkdir -p "$pkgdir"
+}
+
+_py2() {
+ replaces="$pkgname"
+ depends="${depends//py-/py2-}"
+ _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="0f7edd7ffd756a582eeef9282fecb60d pyRFC3339-1.0.tar.gz"