summaryrefslogtreecommitdiff
blob: 4f7c4446661eec79d540c0e641f0c8b7f665debb (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/redis-py/redis-py-2.7.1.ebuild,v 1.4 2012/12/31 22:45:41 ago Exp $

EAPI="4"

SUPPORT_PYTHON_ABIS="1"
DISTUTILS_SRC_TEST="setup.py"

inherit distutils

MY_PN="redis"
MY_P="${MY_PN}-${PV}"

DESCRIPTION="Python client for Redis key-value store"
HOMEPAGE="http://github.com/andymccurdy/redis-py http://pypi.python.org/pypi/redis"
SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz -> ${P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="test"

DEPEND="dev-python/setuptools
	test? ( dev-db/redis )"
RDEPEND=""

S="${WORKDIR}/${MY_P}"

DOCS="README.md CHANGES"
PYTHON_MODNAME="redis"

src_test() {
	local sock="${T}/redis.sock"
	find tests/ -name "*.py" -not -name "encoding.py" -exec sed -i -e "s:port=6379:unix_socket_path=\"${sock}\":" {} \;

	"${EPREFIX}"/usr/sbin/redis-server - \
	<<< "daemonize yes
		pidfile ${T}/redis.pid
		unixsocket ${sock}"
	distutils_src_test
	kill "$(<"${T}/redis.pid")"
}