aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-redis/APKBUILD
blob: 24959e9955213b81320e49537a8276e1baf5de78 (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
48
49
50
51
52
53
54
55
56
# Maintainer: Eivind Uggedal <eu@eju.no>
pkgname=py-redis
_pkgname=${pkgname#py-}
pkgver=3.2.1
pkgrel=0
pkgdesc="Python client for Redis key-value store"
url="https://github.com/andymccurdy/redis-py"
arch="noarch"
license="MIT"
makedepends="py-setuptools py3-setuptools"
checkdepends="pytest py-mock redis"
subpackages="py2-redis:py2 py3-redis:py3"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"

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

build() {
	cd "$builddir"
	python2 setup.py build
	python3 setup.py build
}

check() {
	cd "$builddir"
	redis-server --dir "$builddir"&
	local _redispid=$!

	python2 setup.py test || (kill $_redispid && false)
	python3 setup.py test || (kill $_redispid && false)
	kill $_redispid
}

_py() {
        local python="$1"
        pkgdesc="$pkgdesc ${python#python}"
        depends="$depends $python"
        install_if="$pkgname=$pkgver-r$pkgrel $python"

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

package() {
	mkdir -p "$pkgdir"
}

py2() {
	cd "$builddir"
	_py python2
}

py3() {
	cd "$builddir"
	_py python3
}

sha512sums="be51642a8895325c3c61993dd83c3299a9e2cefc1010e04f182833f720ff161bea43d3a57d28afba991949fcf6e967c4f778002967641bffe651d5db384f2e08  redis-3.2.1.tar.gz"