libzdb-2.11.2.ebuild 1.9 KB

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