diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2016-10-01 19:49:08 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2016-10-01 20:09:48 +0200 |
commit | a6026d61a45eaa9a75e20633d5eeab8bec4cbded (patch) | |
tree | c39ec6ef6c0ca380050d8a937c7a2709968cc642 /main/py-chardet | |
parent | cfddf930cb8cfe4cb4923d6dbf8b97a5906c64ae (diff) | |
download | aports-a6026d61a45eaa9a75e20633d5eeab8bec4cbded.tar.bz2 aports-a6026d61a45eaa9a75e20633d5eeab8bec4cbded.tar.xz |
main/py-chardet: improve abuild
Diffstat (limited to 'main/py-chardet')
-rw-r--r-- | main/py-chardet/APKBUILD | 51 |
1 files changed, 23 insertions, 28 deletions
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: <xmingske@gmail.com> # Maintainer: Natanael Copa <ncopa@alpinelinux.org> _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" |