summaryrefslogtreecommitdiff
blob: 4b69a8830907a72f3bfe795fa0f89ddb7948982d (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.2 2012/10/11 15:41:09 mr_bones_ 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")"
}