opendbx-1.5.0-r1.ebuild 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit flag-o-matic multilib
  5. MY_PN="lib${PN}"
  6. MY_P="${MY_PN}-${PV}"
  7. DESCRIPTION="OpenDBX - A database abstraction layer"
  8. HOMEPAGE="http://www.linuxnetworks.de/doc/index.php/OpenDBX"
  9. SRC_URI="http://www.linuxnetworks.de/opendbx/download/${MY_P}.tar.gz"
  10. LICENSE="LGPL-2.1"
  11. SLOT="0"
  12. KEYWORDS="~x64-solaris"
  13. IUSE="firebird +mysql oracle postgres sqlite"
  14. RESTRICT="firebird? ( bindist )"
  15. DEPEND="mysql? ( virtual/mysql )
  16. postgres? ( dev-db/postgresql:* )
  17. sqlite? ( dev-db/sqlite:3 )
  18. oracle? ( dev-db/oracle-instantclient-basic )
  19. firebird? ( dev-db/firebird )"
  20. RDEPEND="${DEPEND}"
  21. S="${WORKDIR}"/${MY_P}
  22. pkg_setup() {
  23. if ! ( use firebird || use mysql || use oracle || use postgres || use sqlite )
  24. then
  25. ewarn "You should enable at least one of the following USE flags:"
  26. ewarn "firebird, mysql, oracle, postgres or sqlite"
  27. fi
  28. if use oracle && [[ ! -d ${ORACLE_HOME} ]]
  29. then
  30. die "Oracle support requested, but ORACLE_HOME not set to a valid directory!"
  31. fi
  32. use mysql && append-cppflags -I/usr/include/mysql
  33. use firebird && append-cppflags -I/opt/firebird/include
  34. use oracle && append-ldflags -L"${ORACLE_HOME}"/lib
  35. }
  36. src_configure() {
  37. local backends=""
  38. use firebird && backends="${backends} firebird"
  39. use mysql && backends="${backends} mysql"
  40. use oracle && backends="${backends} oracle"
  41. use postgres && backends="${backends} pgsql"
  42. use sqlite && backends="${backends} sqlite3"
  43. econf --with-backends="${backends}" || die "econf failed"
  44. }
  45. src_compile() {
  46. # bug #322221
  47. emake -j1 || die "emake failed"
  48. }
  49. src_install() {
  50. emake -j1 install DESTDIR="${D}" || die "make install failed"
  51. dodoc AUTHORS ChangeLog README
  52. rm -f "${D}"/usr/$(get_libdir)/opendbx/*.{a,la}
  53. }