freetds-1.00.13.ebuild 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit autotools
  5. DESCRIPTION="Tabular Datastream Library"
  6. HOMEPAGE="http://www.freetds.org/"
  7. SRC_URI="ftp://ftp.freetds.org/pub/freetds/stable/${P}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~ppc-macos"
  11. IUSE="gnutls iconv kerberos libressl mssql iodbc odbc ssl"
  12. RESTRICT="test"
  13. DEPEND="
  14. gnutls? ( net-libs/gnutls )
  15. iconv? ( virtual/libiconv )
  16. iodbc? ( dev-db/libiodbc )
  17. kerberos? ( virtual/krb5 )
  18. odbc? ( dev-db/unixODBC )
  19. ssl? (
  20. !libressl? ( dev-libs/openssl:0 )
  21. libressl? ( dev-libs/libressl )
  22. )"
  23. # bind-tools is needed because the osql script calls "host".
  24. RDEPEND="${DEPEND}
  25. net-dns/bind-tools
  26. sys-apps/grep
  27. sys-apps/sed
  28. virtual/awk"
  29. src_prepare() {
  30. default
  31. # Fix the iodbc include path in the configure script. Otherwise, it
  32. # can't find isql.h.
  33. sed -ie 's:with_iodbc/include":with_iodbc/include/iodbc":' \
  34. configure.ac \
  35. || die "failed to fix the iodbc include path in configure.ac"
  36. eautoreconf
  37. }
  38. src_configure() {
  39. local myconf=( --with-tdsver=7.4 )
  40. # The configure script doesn't support --without-{i,unix}odbc and
  41. # it will still search for the associated headers if you try that
  42. # Instead, to disable {i,unix}odbc, you just have to omit the
  43. # --with-{i,unix}odbc line.
  44. if use iodbc ; then
  45. myconf+=( --enable-odbc --with-iodbc="${EPREFIX}/usr" )
  46. fi
  47. if use odbc ; then
  48. myconf+=( --enable-odbc --with-unixodbc="${EPREFIX}/usr" )
  49. fi
  50. myconf+=( $(use_enable iconv libiconv) )
  51. use iconv && myconf+=( --with-libiconv-prefix="${EPREFIX}/usr" )
  52. myconf+=( $(use_enable kerberos krb5) )
  53. myconf+=( $(use_enable mssql msdblib) )
  54. myconf+=( $(use_with gnutls) )
  55. myconf+=( $(use_with ssl openssl "${EPREFIX}/usr") )
  56. # The docdir doesn't contain ${PV} without this
  57. myconf+=( --docdir="/usr/share/doc/${PF}" )
  58. econf "${myconf[@]}"
  59. }