diff options
-rw-r--r-- | main/py-bluez/APKBUILD | 63 |
1 files changed, 41 insertions, 22 deletions
diff --git a/main/py-bluez/APKBUILD b/main/py-bluez/APKBUILD index 016d80d12d..79b54484a1 100644 --- a/main/py-bluez/APKBUILD +++ b/main/py-bluez/APKBUILD @@ -1,39 +1,58 @@ # Contributor: Natanael Copa <ncopa@alpinelinux.org> # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=py-bluez -pkgver=0.18 -pkgrel=1 -pkgdesc="Python API for the BlueZ bluetooth stack " -url="http://code.google.com/p/pybluez/" +_pkgname=pybluez +pkgver=0.22 +pkgrel=0 +pkgdesc="Python API for the BlueZ bluetooth stack" +url="http://karulis.github.io/pybluez/" arch="all" license="GPL2" depends="" -makedepends="python2-dev bluez-dev" -install="" -subpackages="" -source="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pybluez/PyBluez-$pkgver.tar.gz" +makedepends="python2-dev python3-dev py-setuptools bluez-dev" +subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3" +source="$pkgname-$pkgver.tar.gz::https://github.com/karulis/$_pkgname/archive/$pkgver.tar.gz" +builddir="$srcdir/$_pkgname-$pkgver" -_builddir="$srcdir"/PyBluez-$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 + default_prepare || return 1 + + # Soure files are modified during build with 2to3 tool, so we cannot + # build it for both Python versions in the same location. + local python; for python in python2 python3; do + cp -r "$builddir" "$builddir-$python" || return 1 done } build() { - cd "$_builddir" - python2 setup.py build || return 1 + local python; for python in python2 python3; do + cd "$builddir"-$python + $python setup.py build || return 1 + done } 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)" + install_if="$pkgname=$pkgver-r$pkgrel $python" + + cd "$builddir"-$python + $python setup.py install --prefix=/usr --root="$subpkgdir" } -md5sums="be8c8ce615c3189fda1aaf3d568314b2 PyBluez-0.18.tar.gz" -sha256sums="66b2184e0eaad5e1ecc89eb4c81cba0696b3028b85d1301186b45b0bbd761065 PyBluez-0.18.tar.gz" -sha512sums="ddd185ad90f7c6235e25182afccfb586efa0d361f38140f33718dc2d29ca62f3aa68867d075820afffd5ee2fbd306b907b565fbdfdf32f906657f6a3a8c779da PyBluez-0.18.tar.gz" +md5sums="06f71ca6d4216ace671d5e588ec85887 py-bluez-0.22.tar.gz" +sha256sums="53db881a2668791062985e1ff7afbe6527cdd9af3676a3160420a235bee3c768 py-bluez-0.22.tar.gz" +sha512sums="5b35b9e0eae1c6ebabb29892fcff583479ac0627ad7d6549f3d2de90f89a1ba465b7452fa263045298ccfcf063ba070bfd346a6433b5567f8e3e646886017165 py-bluez-0.22.tar.gz" |