APKBUILD 1.65 KB
Newer Older
1
# Contributor: Leo <thinkabit.ukim@gmail.com>
Natanael Copa's avatar
Natanael Copa committed
2 3
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=py-dbus
4
_pkgname=dbus-python
Leo's avatar
Leo committed
5 6
pkgver=1.2.10
pkgrel=0
Natanael Copa's avatar
Natanael Copa committed
7 8
pkgdesc="Python bindings for DBUS"
url="http://www.freedesktop.org/wiki/Software/DBusBindings"
9
arch="all"
10
license="MIT"
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"
Natanael Copa's avatar
Natanael Copa committed
16

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

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

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

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

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

Leo's avatar
Leo committed
78
sha512sums="7849f494ae31020dacbd47e07ad6ef596146700a6a60c71b1af3e60c0de140c2a67ab160f8b9d2a041ad60a931667bd96cca2479065549ac8301b5940829ab2c  dbus-python-1.2.10.tar.gz"