APKBUILD 1.32 KB
Newer Older
Scrumpy Jack's avatar
Scrumpy Jack committed
1 2 3 4
# Contributor: ScrumpyJack <scrumpyjack@st.ilet.to>
# Maintainer: ScrumpyJack <scrumpyjack@st.ilet.to>
pkgname=py-rpigpio
_pkgname=RPi.GPIO
5 6
pkgver=0.6.3
pkgrel=0
Scrumpy Jack's avatar
Scrumpy Jack committed
7 8 9 10
pkgdesc="This package provides a class to control the GPIO on a Raspberry Pi."
url="https://pypi.python.org/pypi/RPi.GPIO"
arch="armhf"
license="MIT"
11 12
makedepends="python2-dev python3-dev py-setuptools"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
13 14
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
Scrumpy Jack's avatar
Scrumpy Jack committed
15 16

build() {
17
	cd "$builddir"
18 19 20 21 22 23 24 25
	python2 setup.py build
	python3 setup.py build
}

check() {
	cd "$builddir"
	python2 setup.py check
	python3 setup.py check
Scrumpy Jack's avatar
Scrumpy Jack committed
26 27 28
}

package() {
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
	mkdir -p "$pkgdir"
}

_py2() {
	replaces="$pkgname"             
	depends="${depends//py-/py2-}" 
	_py python2
}

_py3() {
	depends="${depends//py-/py3-}" 
	_py python3
}

_py() {
	local python="$1"
	pkgdesc="$pkgdesc (for $python)"
	depends="$depends $python"  ## remove if arch isn't noarch
	install_if="$pkgname=$pkgver-r$pkgrel $python"

49
	cd "$builddir"
50
	$python setup.py install --prefix=/usr --root="$subpkgdir"
Scrumpy Jack's avatar
Scrumpy Jack committed
51 52
}

53
sha512sums="b2fd08d9db1a2d58bdfed9d27c279d1f8c5cb6923ebd61253dae257b7271a7c5dec2271d6a426c9d1c67fc0444e18057e2e12ed8c3aa0f3d847291ba64beccf4  py-rpigpio-0.6.3.tar.gz"