diff options
author | Leonardo Arena <rnalrd@alpinelinux.org> | 2017-12-23 15:25:02 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2017-12-23 15:25:02 +0000 |
commit | fc73d91dfa41384251226e633d1b2b48b088bb5d (patch) | |
tree | 078eeb2df622d729f647ea74decf85ee14785804 /main/py-pep8/APKBUILD | |
parent | 734869763991d8059cc220d1166ad23f9a8167fd (diff) | |
download | aports-fc73d91dfa41384251226e633d1b2b48b088bb5d.tar.bz2 aports-fc73d91dfa41384251226e633d1b2b48b088bb5d.tar.xz |
main/py-pep8: add support for python3, modernize
Diffstat (limited to 'main/py-pep8/APKBUILD')
-rw-r--r-- | main/py-pep8/APKBUILD | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/main/py-pep8/APKBUILD b/main/py-pep8/APKBUILD index aaeb9e7f95..c97bd0f038 100644 --- a/main/py-pep8/APKBUILD +++ b/main/py-pep8/APKBUILD @@ -3,39 +3,55 @@ pkgname=py-pep8 _pkgname=pep8 pkgver=1.7.0 -pkgrel=0 +pkgrel=1 pkgdesc="A Python style guide checker" url="https://pypi.python.org/pypi/pep8/" arch="noarch" license="MIT" -depends="python2" -depends_dev="" -makedepends="python2-dev py-setuptools" +depends="" +makedepends="python2-dev python3-dev py-setuptools" install="" -subpackages="" +subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" +options="!check" #no testsuite 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" - python2 setup.py build || return 1 + python2 setup.py build + python3 setup.py build } package() { cd "$_builddir" - python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1 + mkdir -p "$pkgdir"/usr/bin } +_py2() { + replaces=$pkgname + provides="$pkgname=$pkgver-r$pkgrel" + _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 --quiet install --prefix=/usr --root="$subpkgdir" + local path; for bin in "$subpkgdir"/usr/bin/*; do + mv -f "$bin" "${bin}-$pyver" + done +} + + md5sums="2b03109b0618afe3b04b3e63b334ac9d pep8-1.7.0.tar.gz" sha256sums="a113d5f5ad7a7abacef9df5ec3f2af23a20a28005921577b15dd584d099d5900 pep8-1.7.0.tar.gz" sha512sums="0077dac97846fe3a5fc654cd3ce8578845cf3b93ee097a3ae6ff2db4ae0797ad5766c69f036d6a5add786eb929a9beb6d657ab693227b8df2ba46ec0f9284b0a pep8-1.7.0.tar.gz" |