dev-cpp/pangomm: stable 2.42.1 for hppa, bug #717144
[gentoo.git] / dev-db / libzdb / libzdb-3.1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 inherit eutils toolchain-funcs
7
8 DESCRIPTION="A thread safe high level multi-database connection pool library"
9 HOMEPAGE="http://www.tildeslash.com/libzdb/"
10 SRC_URI="http://www.tildeslash.com/${PN}/dist/${P}.tar.gz"
11
12 LICENSE="GPL-3"
13 SLOT="0"
14 KEYWORDS="amd64 x86"
15 IUSE="debug doc mysql postgres +sqlite ssl static-libs"
16 REQUIRED_USE=" || ( postgres mysql sqlite )"
17
18 RESTRICT=test
19
20 RDEPEND="mysql? ( virtual/mysql )
21         postgres? ( dev-db/postgresql )
22         sqlite? ( >=dev-db/sqlite-3.7:3[unlock-notify(+)] )
23         ssl? ( dev-libs/openssl:0= )"
24 DEPEND="${RDEPEND}
25         virtual/pkgconfig
26         doc? ( app-doc/doxygen )"
27
28 src_prepare() {
29         sed -i -e "s|&& ./pool||g" test/Makefile.in || die
30 }
31
32 src_configure() {
33         ## TODO: check what --enable-optimized actually does
34         ## TODO: find someone with oracle db to add oci8 support
35         myconf=""
36         # enable default hidden visibility
37         myconf="${myconf} --enable-protected"
38
39         if use sqlite; then
40                 myconf="${myconf} --with-sqlite=${EPREFIX}/usr/ --enable-sqliteunlock"
41         else
42                 myconf="${myconf} --without-sqlite"
43         fi
44
45         if use mysql; then
46                 myconf="${myconf} --with-mysql=${EPREFIX}/usr/bin/mysql_config"
47         else
48                 myconf="${myconf} --without-mysql"
49         fi
50
51         if use postgres; then
52                 myconf="${myconf} --with-postgresql=${EPREFIX}/usr/bin/pg_config"
53         else
54                 myconf="${myconf} --without-postgresql"
55         fi
56
57         econf \
58                 $(use_enable debug profiling) \
59                 $(use_enable static-libs static) \
60                 $(use_enable ssl openssl) \
61                 --without-oci \
62                 ${myconf}
63 }
64
65 src_compile() {
66         default_src_compile
67         if use doc; then
68                 emake doc
69         fi
70 }
71
72 src_install() {
73         emake DESTDIR="${D}" install
74
75         # the --disable-static flag only skips .a
76         use static-libs || rm -f "${D}"/usr/lib*/libzdb.la
77
78         dodoc AUTHORS CHANGES README
79         if use doc;then
80                 dohtml -r "${S}/doc/api-docs"/*
81         fi
82 }
83
84 src_test() {
85         emake verify
86 }