diff options
author | Carlo Landmeter <clandmeter@alpinelinux.org> | 2019-01-26 15:28:55 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@alpinelinux.org> | 2019-01-26 21:22:50 +0000 |
commit | 8fbbf24adefedfeb489d7b5053c8704ee8326e2e (patch) | |
tree | cb9ece8c3e0ca1872bccccd9116fea964f64bfaf /community/py-parsedatetime | |
parent | ab6a09a6a57a5d4df60fbe9c7fd5a4a3e7087359 (diff) | |
download | aports-8fbbf24adefedfeb489d7b5053c8704ee8326e2e.tar.bz2 aports-8fbbf24adefedfeb489d7b5053c8704ee8326e2e.tar.xz |
community/py-parsedatetime: add py3 support
Diffstat (limited to 'community/py-parsedatetime')
-rw-r--r-- | community/py-parsedatetime/APKBUILD | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/community/py-parsedatetime/APKBUILD b/community/py-parsedatetime/APKBUILD index 7f970c59ee..c2a2219da6 100644 --- a/community/py-parsedatetime/APKBUILD +++ b/community/py-parsedatetime/APKBUILD @@ -3,12 +3,14 @@ pkgname=py-parsedatetime _pkgname=parsedatetime pkgver=2.4 -pkgrel=2 +pkgrel=3 pkgdesc="Parse human-readable date/time strings" url="https://github.com/bear/parsedatetime" arch="noarch" license="Apache" -makedepends="py-setuptools" +depends="py-future" +makedepends="python2-dev python3-dev py-setuptools" +subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" source="$_pkgname-$pkgver.tar.gz::https://github.com/bear/$_pkgname/archive/v$pkgver.tar.gz" builddir="$srcdir/$_pkgname-$pkgver" @@ -16,16 +18,38 @@ builddir="$srcdir/$_pkgname-$pkgver" build() { cd "$builddir" python2 setup.py build + python3 setup.py build } check() { cd "$builddir" python2 setup.py test + python3 setup.py test } package() { + 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" - python2 setup.py install --prefix=/usr --root="$pkgdir" + $python setup.py install --prefix=/usr --root="$subpkgdir" } sha512sums="0fd8bfa3411476a20d8874b44036bc162735fb7865d39ca98b0a608daec39daac47100314279dbf66229ec333821492744f7505315d955f58216fdaa75cbf046 parsedatetime-2.4.tar.gz" |