aports/main/py-bluez/APKBUILD

59 lines
1.5 KiB
Plaintext

# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py-bluez
_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 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"
prepare() {
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() {
local python; for python in python2 python3; do
cd "$builddir"-$python
$python setup.py build || return 1
done
}
package() {
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="06f71ca6d4216ace671d5e588ec85887 py-bluez-0.22.tar.gz"
sha256sums="53db881a2668791062985e1ff7afbe6527cdd9af3676a3160420a235bee3c768 py-bluez-0.22.tar.gz"
sha512sums="5b35b9e0eae1c6ebabb29892fcff583479ac0627ad7d6549f3d2de90f89a1ba465b7452fa263045298ccfcf063ba070bfd346a6433b5567f8e3e646886017165 py-bluez-0.22.tar.gz"