oracle-instantclient-odbc-11.2.0.3.ebuild 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # Copyright 1999-2012 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit eutils multilib
  5. MY_PLAT_x86="Linux x86"
  6. MY_A_x86="${PN/oracle-/}-linux-${PV}.0.zip"
  7. MY_PLAT_amd64="Linux x86-64"
  8. MY_A_amd64="${PN/oracle-/}-linux.x64-${PV}.0.zip"
  9. DESCRIPTION="Oracle 11g Instant Client: ODBC supplement"
  10. HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
  11. SRC_URI="
  12. x86? ( ${MY_A_x86} )
  13. amd64? ( ${MY_A_amd64} multilib? ( ${MY_A_x86} ) )
  14. "
  15. LICENSE="OTN"
  16. SLOT="0"
  17. KEYWORDS="amd64 x86"
  18. RESTRICT="fetch"
  19. IUSE="multilib"
  20. DEPEND="app-arch/unzip"
  21. RDEPEND="~dev-db/oracle-instantclient-basic-${PV}"
  22. S="${WORKDIR}"
  23. QA_PREBUILT="usr/lib*/oracle/${PV}/client/lib*/lib*"
  24. default_abi() {
  25. [[ ${DEFAULT_ABI} == 'default' ]] && echo ${ARCH} || echo ${DEFAULT_ABI}
  26. }
  27. abi_list() {
  28. if use multilib; then
  29. echo ${MULTILIB_ABIS}
  30. else
  31. default_abi
  32. fi
  33. return 0
  34. }
  35. set_abivars() {
  36. local abi=$1
  37. # platform name
  38. MY_PLAT=MY_PLAT_${abi}
  39. MY_PLAT=${!MY_PLAT}
  40. # runtime distfile
  41. MY_A=MY_A_${abi}
  42. MY_A=${!MY_A}
  43. # abi sourcedir
  44. MY_S="${S}/${abi}/instantclient_11_2"
  45. # ABI might not need to be set at all
  46. [[ -n ${ABI} ]] && MY_ABI=${abi} || MY_ABI=
  47. # abi libdir
  48. MY_LIBDIR=$(ABI=${MY_ABI} get_libdir)
  49. }
  50. pkg_nofetch() {
  51. eerror "Please go to"
  52. eerror " ${HOMEPAGE%/*}/index-097480.html"
  53. eerror " and download"
  54. local abi
  55. for abi in $(abi_list)
  56. do
  57. set_abivars ${abi}
  58. eerror "Instant Client for ${MY_PLAT}"
  59. eerror " ODBC: ${MY_A}"
  60. done
  61. eerror "After downloading, put them in:"
  62. eerror " ${DISTDIR}/"
  63. }
  64. src_unpack() {
  65. local abi
  66. for abi in $(abi_list)
  67. do
  68. set_abivars ${abi}
  69. mkdir -p "${MY_S%/*}" || die
  70. cd "${MY_S%/*}" || die
  71. unpack ${MY_A}
  72. done
  73. }
  74. src_install() {
  75. # all binaries go here
  76. local oracle_home=/usr/$(get_libdir)/oracle/${PV}/client
  77. into "${oracle_home}"
  78. local abi
  79. for abi in $(abi_list)
  80. do
  81. set_abivars ${abi}
  82. einfo "Installing runtime for ${MY_PLAT} ..."
  83. cd "${MY_S}" || die
  84. ABI=${MY_ABI} dolib.so libsqora*$(get_libname)*
  85. # ensure to be linkable
  86. [[ -e libsqora$(get_libname) ]] ||
  87. dosym libsqora$(get_libname 11.1) \
  88. "${oracle_home}"/${MY_LIBDIR}/libsqora$(get_libname)
  89. eend $?
  90. done
  91. set_abivars $(default_abi)
  92. cd "${MY_S}" || die
  93. dobin odbc_update_ini.sh
  94. dodoc *htm*
  95. }