summaryrefslogtreecommitdiff
blob: e0690f2d15d7126e4104aea43bad7d80bcc82952 (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-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit postgresql

KEYWORDS="~x86"

DESCRIPTION="The official PostgreSQL ODBC Driver."
HOMEPAGE="http://pgfoundry.org/projects/psqlodbc/"
SRC_URI="mirror://postgresql/odbc/versions/src/${P}.tar.gz"
LICENSE="LGPL-2"
SLOT="0"
IUSE="iodbc threads unicode"

DEPEND="virtual/postgresql-base
		iodbc? ( >=dev-db/libiodbc-3.52.4 )
		!iodbc? ( dev-db/unixODBC )"
RDEPEND="${DEPEND}"

src_unpack() {
	unpack ${A}
	cd "${S}"

	# Patching Makefile.am and running eautoreconf didn't work
	sed -i \
		-e 's/\(psqlodbc_la\)/lib\1/g' \
		-e 's/\(psqlodbc.la\)/lib\1/g' \
		Makefile.in || die "sed failed"

	if use iodbc ; then
		sed -i \
			-e "/^DEFAULT_INCLUDES/s:$: `iodbc-config --cflags`:" \
			Makefile.in || die "sed failed"
	fi

}

src_compile() {
	econf \
		$(use_with iodbc) \
		$(use_with !iodbc unixodbc) \
		$(use_enable threads pthreads) \
		$(use_enable unicode) \
		--enable-static \
		--enable-shared \
		PATH="$(postgresql_get_bindir):${PATH}" \
		|| die "econf failed"
	emake || die "emake failed"
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"
	dodoc readme.txt
	dohtml docs/*
}