APKBUILD 1.7 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1 2
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py-dbus
3 4
_pkgname=dbus-python
pkgver=1.2.8
5
pkgrel=3
Natanael Copa's avatar
Natanael Copa committed
6 7
pkgdesc="Python bindings for DBUS"
url="http://www.freedesktop.org/wiki/Software/DBusBindings"
8
arch="all"
Roberto Oliveira's avatar
Roberto Oliveira committed
9
license="MIT X11"
10
depends=""
11
depends_dev="py-dbus"
12 13 14
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"
15
source="https://dbus.freedesktop.org/releases/dbus-python/$_pkgname-$pkgver.tar.gz"
16
options="!check" # Test suite fails due to permission errors in fakeroot environment
Natanael Copa's avatar
Natanael Copa committed
17

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

20 21 22 23 24 25 26
prepare() {
	cd "$builddir"
	mkdir ../build-python2
	mkdir ../build-python3
	default_prepare
}

Natanael Copa's avatar
Natanael Copa committed
27
build() {
28
	cd "$builddir"
29 30
	cd ../build-python2
	"$builddir/configure" \
31 32 33
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
34 35
		--enable-documentation
	make
36 37 38 39 40 41 42
	cd ../build-python3
	"$builddir/configure" \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		PYTHON_VERSION=3
	make
43 44 45 46
}

check() {
	cd "$builddir"
47 48 49 50
	cd "../build-python2"
	make check
	cd "../build-python3"
	make check
Natanael Copa's avatar
Natanael Copa committed
51 52 53
}

package() {
54
	cd "$builddir"
55
	cd "../build-python2"
56
	make DESTDIR="$pkgdir" install
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
	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/
Natanael Copa's avatar
Natanael Copa committed
77 78
}

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