# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="4" inherit eutils toolchain-funcs DESCRIPTION="A thread safe high level multi-database connection pool library" HOMEPAGE="http://www.tildeslash.com/libzdb/" SRC_URI="http://www.tildeslash.com/libzdb/dist/${P}.tar.gz" LICENSE="GPL-3" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="debug doc mysql postgres +sqlite ssl static-libs" RDEPEND="mysql? ( virtual/mysql ) postgres? ( dev-db/postgresql-base ) sqlite? ( dev-db/sqlite[unlock-notify] ) ssl? ( dev-libs/openssl )" DEPEND="${RDEPEND} sys-devel/flex sys-devel/libtool dev-util/pkgconfig doc? ( app-doc/doxygen )" src_prepare() { sed -i -e "s|&& ./pool||g" test/Makefile.in || die } src_configure() { if ( use sqlite ); then myconf=" --with-sqlite=${EPREFIX}/usr/" if [[ $(gcc-version) < 4.1 ]];then local myconf="" myconf=" --disable-protected" else myconf=" --enable-protected" fi else myconf=" --without-sqlite" fi if use mysql; then myconf=" --with-mysql=${EPREFIX}/usr/bin/mysql_config" else myconf=" --without-mysql" fi if use postgres; then myconf=" --with-postgresql=${EPREFIX}/usr/bin/pg_config" else myconf=" --without-postgresql" fi econf \ $(use_enable debug profiling) \ $(use_with postgres postgresql) \ $(use_enable sqlite sqliteunlock) \ $(use_enable static-libs static) \ $(use_enable ssl openssl) \ --without-oci \ ${myconf} } src_compile() { default_src_compile if use doc; then emake doc fi } src_install() { emake DESTDIR="${D}" install # the --disable-static flag only skips .a use static-libs || rm -f "${D}"/usr/lib*/libzdb.la dodoc AUTHORS CHANGES README if use doc;then dohtml -r "${S}/doc/api-docs"/* fi } src_test() { emake verify }