aboutsummaryrefslogtreecommitdiffstats
path: root/community/py-rencode/APKBUILD
blob: a2e422e679d42b1842407bb739c108935fd3d38b (plain)
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: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py-rencode
_pkgname=rencode
pkgver=1.0.6
pkgrel=2
pkgdesc="The rencode module is similar to bencode from the BitTorrent project."
url="https://pypi.python.org/pypi/rencode"
arch="all"
license="GPL-3.0-or-later"
makedepends="py-setuptools py3-setuptools python2-dev python3-dev cython2 cython3"
 subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
source="$pkgname-$pkgver.tar.gz::https://github.com/aresch/rencode/archive/v$pkgver.tar.gz"

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

build() {
	python2 setup.py build
	python3 setup.py build
}

package() {
	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"
	install_if="$pkgname=$pkgver-r$pkgrel $python"

	cd "$builddir"
	$python setup.py --quiet install --prefix=/usr --root="$subpkgdir"
}

sha512sums="f04de4d3a83aed916bdc4b7a8ca772655e9324d0531ee882cb7d2a1e92b397bdcec8497bf02939e0a806886ecc62ed2e7319dfee054dad1b69052157f0959e8f  py-rencode-1.0.6.tar.gz"