From a6026d61a45eaa9a75e20633d5eeab8bec4cbded Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Sat, 1 Oct 2016 19:49:08 +0200 Subject: main/py-chardet: improve abuild --- main/py-chardet/APKBUILD | 51 ++++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 28 deletions(-) (limited to 'main/py-chardet') diff --git a/main/py-chardet/APKBUILD b/main/py-chardet/APKBUILD index 01e6351ca8..9d22004363 100644 --- a/main/py-chardet/APKBUILD +++ b/main/py-chardet/APKBUILD @@ -1,53 +1,48 @@ # Contributor: # Maintainer: Natanael Copa _pkgname=chardet -pkgname=py-${_pkgname} +pkgname=py-$_pkgname pkgver=2.3.0 -pkgrel=1 +pkgrel=2 pkgdesc="The Universal Character Encoding Detector" url="https://github.com/chardet/chardet/" arch="noarch" -license="LGPL2.1" -makedepends="python-dev python3-dev py-setuptools" -subpackages="py3-$_pkgname:_py3 py2-$_pkgname:_py2" +license="LGPL-2.1" depends="" -source="$pkgname-$pkgver.tar.gz::https://github.com/chardet/$_pkgname/archive/${pkgver}.tar.gz" - -builddir="${srcdir}/${_pkgname}-${pkgver}" +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 - python3 setup.py build || return 1 + python2 setup.py build || return 1 + python3 setup.py build || return 1 } package() { - cd "$builddir" - python setup.py install --root=$pkgdir/ --optimize=1 || return 1 - python3 setup.py install --root=$pkgdir/ --optimize=1 || return 1 -} - - -_py() { - local python=$1 - pkgdesc="$pkgdesc - $python" - install_if="$pkgname=$pkgver-r$pkgrel $python" - local dir=$($python -c 'import sysconfig; print(sysconfig.get_path("stdlib"))') - - mkdir -p "$subpkgdir"${dir} - mv "$pkgdir"${dir}/* "$subpkgdir"${dir} + mkdir -p "$pkgdir" } _py2() { - _py python2 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" --optimize=1 +} -md5sums="1ce646cc083a7bb07398588db5b90043 py-chardet-2.3.0.tar.gz" -sha256sums="afb95679fb687fad167a714d929d033e3dd0d64b66d3646eecf117d350ae40cc py-chardet-2.3.0.tar.gz" -sha512sums="37f825e764754c9c697125b1faa604f92d49d578a44b5d1787c2c7cfcac73e161a371424bbaa3e692982bc7495b7a35b146e098d5069ae0e0edbd894ecacccd9 py-chardet-2.3.0.tar.gz" +md5sums="25274d664ccb5130adae08047416e1a8 chardet-2.3.0.tar.gz" +sha256sums="e53e38b3a4afe6d1132de62b7400a4ac363452dc5dfcf8d88e8e0cce663c68aa chardet-2.3.0.tar.gz" +sha512sums="d554c9b4564905a2b6c6971aaea2a812174d86b58137c6a2f9d54e2abd2395e6529968b2ce3ca2d97c717d2bd0bd80ab5b98cae9afac1a4add9ea305145030dd chardet-2.3.0.tar.gz" -- cgit v1.2.3