aboutsummaryrefslogtreecommitdiffstats
path: root/community/i2c-tools/APKBUILD
blob: f9109cc84b2bd5e1c942b023c350767affd49731 (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
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=i2c-tools
pkgver=4.1
pkgrel=3
pkgdesc="Tools for monitoring I2C devices"
url="https://i2c.wiki.kernel.org/index.php/I2C_Tools"
arch="all"
license="GPL-2.0-or-later AND LGPL-2.1-or-later"
options="!check" #no test/check provided by upstream
makedepends="linux-headers python3-dev"
subpackages="$pkgname-dev $pkgname-doc py3-smbus:py"
source="https://fossies.org/linux/misc/i2c-tools-$pkgver.tar.gz"


prepare() {
	default_prepare
	sed -i "s|^DESTDIR.*|DESTDIR = \"$pkgdir\"|" Makefile
	sed -i "s|^prefix.*|prefix = /usr|" Makefile
	sed -i "s|^PREFIX.*|PREFIX = /usr|" Makefile
}

build() {
	make

	cd "$builddir"/py-smbus
	CFLAGS="$CFLAGS -I$builddir/include" python3 setup.py build
}

py() {
	pkgdesc="$pkgname python bindings"
	provides="py-smbus=$pkgver-r$pkgrel"
	replaces="py-smbus"
	install -d "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/python3* "$subpkgdir"/usr/lib
}

package() {
	make install

	cd "$builddir"/py-smbus
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="e0dc3e8d9372658ee132332d695b9ad8537cddb63362e1b860b66d07516f33f50d3b67fbaf9769ba4affc1e20513522bfbd92f327c5c060b62be99c527609df6  i2c-tools-4.1.tar.gz"