aboutsummaryrefslogtreecommitdiffstats
path: root/testing/i2c-tools/APKBUILD
blob: 626adc317b0e65508c79046dd0b7a36619d42478 (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
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=i2c-tools
pkgver=4.0
pkgrel=0
pkgdesc="Tools for monitoring I2C devices"
url="http://www.lm-sensors.org/wiki/I2CTools"
arch="all"
license="GPL-2.0"
depends=
depends_dev=""
makedepends="$depends_dev linux-headers py-setuptools python2-dev"
install=
subpackages="$pkgname-dev $pkgname-doc py-smbus:py"
source="https://fossies.org/linux/misc/$pkgname-$pkgver.tar.gz"

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

prepare() {
	cd "$builddir"
	sed -i "s|^DESTDIR.*|DESTDIR = \"$pkgdir\"|" Makefile || return 1
	sed -i "s|^prefix.*|prefix = /usr|" Makefile || return 1
}

build() {
	cd "$builddir"
	make || return 1

	cd "$builddir"/py-smbus
	CFLAGS="$CFLAGS -I${builddir}/include" python2 setup.py build || return 1
}

py() {
	pkgdesc="$pkgname python bindings"
	mkdir -p "$subpkgdir/usr/lib/python2.7/site-packages"
	mv "$pkgdir"/usr/lib/python2.7/* $subpkgdir/usr/lib/python2.7
}

package() {
	cd "$builddir"
	make install

	cd "$builddir"/py-smbus
	python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
}

sha512sums="818725e7a03b33547244559ccf330adbd3292c075a5e2411ead816bb8289c6a402645e22603e2b14753f9acca79b138ccb6ec89f17e01a7190488b7b0fd51222  i2c-tools-4.0.tar.gz"