summaryrefslogtreecommitdiff
blob: 6de112831ac818e32e5ba7b332c7ed846240a2c0 (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/psycopg/psycopg-1.1.21.ebuild,v 1.21 2012/02/23 10:16:40 patrick Exp $

EAPI="3"
PYTHON_DEPEND="2"
SUPPORT_PYTHON_ABIS="1"
RESTRICT_PYTHON_ABIS="3.* 2.7-pypy-* *-jython"

inherit python

DESCRIPTION="PostgreSQL database adapter for Python"
HOMEPAGE="http://www.initd.org/software/psycopg"
SRC_URI="http://initd.org/pub/software/${PN}/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha ~amd64 ~arm ia64 ppc ppc64 sparc x86"
IUSE=""

DEPEND=">=dev-python/egenix-mx-base-2.0.3
	dev-db/postgresql-base"
RDEPEND="${DEPEND}"

src_prepare() {
	# fix for bug #134873
	sed -e '1245s/static //' -i cursor.c

	sed -e 's:$(PY_MOD_DIR):$(D)&/$$mod:' -i Makefile.pre.in

	python_copy_sources
}

src_configure() {
	configuration() {
		econf \
			--with-mxdatetime-includes="$(python_get_includedir)/mx" \
			--with-postgres-includes="/usr/include/postgresql/server" || return 1
		sed -e 's:$(BLDSHARED):& $(LDFLAGS):' -i Makefile
	}
	python_execute_function -s configuration
}

src_compile() {
	python_src_compile OPT="${CFLAGS}" LDFLAGS="${LDFLAGS}"
}

src_install () {
	python_src_install

	dodoc AUTHORS ChangeLog CREDITS README NEWS RELEASE-1.0 SUCCESS TODO
	docinto doc
	dodoc doc/python-taylor.txt doc/README
	insinto /usr/share/doc/${PF}/examples
	doins doc/examples/*
}