diff options
author | Fabian Affolter <fabian@affolter-engineering.ch> | 2016-11-08 08:21:28 +0000 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-11-19 18:35:34 +0100 |
commit | a5c80e737b753ebd2d5d75e5fe0efc1fb8407b55 (patch) | |
tree | 6dae14a5111d1b4450d82fdaa2100678572a0943 /main/py-unidecode | |
parent | 322d6515967a1c70a59f537e6003ed3aaaeeaf7f (diff) | |
download | aports-a5c80e737b753ebd2d5d75e5fe0efc1fb8407b55.tar.bz2 aports-a5c80e737b753ebd2d5d75e5fe0efc1fb8407b55.tar.xz |
main/py-unidecode: add py2/py3 subpackages
Diffstat (limited to 'main/py-unidecode')
-rw-r--r-- | main/py-unidecode/APKBUILD | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/main/py-unidecode/APKBUILD b/main/py-unidecode/APKBUILD index b968696008..cc6111648b 100644 --- a/main/py-unidecode/APKBUILD +++ b/main/py-unidecode/APKBUILD @@ -8,32 +8,39 @@ pkgdesc="A Python ASCII transliterations of Unicode text" url="https://pypi.python.org/pypi/Unidecode" arch="noarch" license="GPL2+" -depends="python2" -depends_dev="" -makedepends="python2-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" + cd "$builddir" python2 setup.py build || return 1 + python3 setup.py build || return 1 } package() { - cd "$_builddir" - python2 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="9b3ab9bfe5a58124609840f0c2accfe4 Unidecode-0.04.19.tar.gz" |