diff options
author | Fabian Affolter <fabian@affolter-engineering.ch> | 2016-11-07 21:04:34 +0000 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-11-08 22:52:49 +0100 |
commit | fff532a788f8ac245ba882b70ff63e7327873216 (patch) | |
tree | 3b4cc8115792adaed170c4ddda63c6300f1608f8 /main | |
parent | 1a7aacc622db14b3f2f0d3a0e10b7593a5af59fa (diff) | |
download | aports-fff532a788f8ac245ba882b70ff63e7327873216.tar.bz2 aports-fff532a788f8ac245ba882b70ff63e7327873216.tar.xz |
main/py-babel: add py2/py3 subpackages
Diffstat (limited to 'main')
-rw-r--r-- | main/py-babel/APKBUILD | 57 |
1 files changed, 35 insertions, 22 deletions
diff --git a/main/py-babel/APKBUILD b/main/py-babel/APKBUILD index 8686db353c..156a3cd282 100644 --- a/main/py-babel/APKBUILD +++ b/main/py-babel/APKBUILD @@ -1,35 +1,48 @@ # Contributor: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> # Maintainer: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> pkgname=py-babel +_pkgname=Babel pkgver=2.3.4 -pkgrel=0 +pkgrel=1 pkgdesc="Python i18n tool" -url=http://babel.pocoo.org/ -arch=noarch -license=BSD -depends=py-tz -makedepends=py-setuptools -source="https://files.pythonhosted.org/packages/source/B/Babel/Babel-$pkgver.tar.gz" - -_builddir=$srcdir/Babel-$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 -} +url="http://babel.pocoo.org/" +arch="noarch" +license="BSD" +depends="py-tz" +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" - python2 setup.py build + cd "$builddir" + python2 setup.py build || return 1 + python3 setup.py build || return 1 } package() { - cd "$_builddir" - python2 setup.py install --root "$pkgdir" + 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="afa20bc55b0e991833030129ad498f35 Babel-2.3.4.tar.gz" |