aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-dbus/APKBUILD
blob: 7beacc6ac9ea40e29e324f48df598e4b785e617a (plain) (blame)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py-dbus
_pkgname=dbus-python
pkgver=1.2.8
pkgrel=4
pkgdesc="Python bindings for DBUS"
url="http://www.freedesktop.org/wiki/Software/DBusBindings"
arch="all"
license="MIT"
depends_dev="py-dbus"
makedepends="dbus-glib-dev python2-dev python3-dev py2-sphinx"
checkdepends="bash dbus py-gobject3 py-tappy"
subpackages="$pkgname-dev $pkgname-doc py2-dbus:_py2 py3-dbus:_py3"
source="https://dbus.freedesktop.org/releases/dbus-python/$_pkgname-$pkgver.tar.gz"

builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
	cd "$builddir"
	mkdir ../build-python2
	mkdir ../build-python3
	default_prepare
}

build() {
	cd "$builddir"
	cd ../build-python2
	"$builddir/configure" \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-documentation
	make
	cd ../build-python3
	"$builddir/configure" \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		PYTHON_VERSION=3
	make
}

check() {
	cd "$builddir"
	cd "../build-python2"
	make check
	cd "../build-python3"
	make check
}

package() {
	cd "$builddir"
	cd "../build-python2"
	make DESTDIR="$pkgdir" install
	cd "../build-python3"
	make DESTDIR="$pkgdir" install
}

_py2() {
	replaces="py-dbus"
	_py python2
}

_py3() {
	_py python3
}

_py() {
	local python="$1"
	pkgdesc="$pkgdesc (for $python)"
	depends="$depends $python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/$python* "$subpkgdir"/usr/lib/
}

sha512sums="6e486fd560944fc1461a27e6798e2c348c7fdf351602c082a0614c0a6822ff147875212bdcb1f818c0ab12470cffc613c0ffbd292cd9d445d3429bee65765905  dbus-python-1.2.8.tar.gz"