# Contributor: Fabian Affolter # Maintainer: Fabian Affolter pkgname=py-unidecode _pkgname=Unidecode pkgver=1.0.23 pkgrel=1 pkgdesc="A Python ASCII transliterations of Unicode text" url="https://pypi.python.org/pypi/Unidecode" arch="noarch" license="GPL-2.0-or-later" depends="py3-${pkgname#py-}" 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 python3 setup.py build } package() { mkdir -p "$pkgdir" mkdir -p "$pkgdir"/usr/bin ln -s unidecode-3 "$pkgdir"/usr/bin/unidecode } _py2() { replaces="$pkgname" _py python2 } _py3() { _py python3 } _py() { local python="$1" local pyver="${1:6: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" # Add version suffix to executable files. local path; for path in "$subpkgdir"/usr/bin/*; do mv "$path" "$path-$pyver" || return 1 done } sha512sums="f3f48a1c06942caf06a9be29250af6f2ddb022cbee6236e2f9ab897af0b11517be3300b4a391dd89befd531b138eb1c163f9bfac178496c01ff2870b6a522f3e Unidecode-1.0.23.tar.gz"