1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 )
9 KEYWORDS="~alpha ~amd64 ~hppa ia64 ppc ppc64 ~sparc x86 ~x86-fbsd"
11 DESCRIPTION="Standard front-end for writing C++ programs that use PostgreSQL"
12 SRC_URI="https://github.com/jtv/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
13 HOMEPAGE="http://pqxx.org/development/libpqxx/"
16 IUSE="doc static-libs"
18 RDEPEND="dev-db/postgresql:="
27 DOCS=( AUTHORS NEWS README{.md,-UPGRADE} )
32 sed -e 's/python/python2/' \
33 -i tools/{splitconfig,template2mak.py} \
34 || die "Couldn't fix Python shebangs"
40 $(use_enable doc documentation) \
41 $(use_enable static-libs static)
45 einfo "The tests need a running PostgreSQL server and an existing database."
46 einfo "Test requires PGDATABASE and PGUSER to be set at a minimum. Optionally,"
47 einfo "set PGPORT and PGHOST. Define them at the command line or in:"
48 einfo " ${EROOT%/}/etc/libpqxx_test_env"
50 if [[ -z $PGDATABASE || -z $PGUSER ]] ; then
51 if [[ -f ${EROOT%/}/etc/libpqxx_test_env ]] ; then
52 source "${EROOT%/}/etc/libpqxx_test_env"
53 [[ -n $PGDATABASE ]] && export PGDATABASE
54 [[ -n $PGHOST ]] && export PGHOST
55 [[ -n $PGPORT ]] && export PGPORT
56 [[ -n $PGUSER ]] && export PGUSER
60 if [[ -n $PGDATABASE && -n $PGUSER ]] ; then
62 server_version=$(psql -Aqtc 'SELECT version();' 2> /dev/null)
63 if [[ $? = 0 ]] ; then
67 eerror "Is the server running?"
68 eerror "Verify role and database exist, and are permitted in pg_hba.conf for:"
69 eerror " Role: ${PGUSER}"
70 eerror " Database: ${PGDATABASE}"
71 die "Couldn't connect to server."
74 eerror "PGDATABASE and PGUSER must be set to perform tests."
75 eerror "Skipping tests."
80 use doc && HTML_DOCS=( doc/html/. )
83 if ! use static-libs; then
84 find "${D}" -name '*.la' -delete || die