aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-bluez/APKBUILD
blob: f0d58770ce8cff00f9609d1e284ef5379398c3df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py-bluez
_pkgname=pybluez
pkgver=0.22
pkgrel=2
pkgdesc="Python API for the BlueZ bluetooth stack"
url="http://karulis.github.io/pybluez/"
arch="all"
license="GPL-2.0"
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"