/[gentoo-x86]/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.4.ebuild
Gentoo

Contents of /dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Fri Apr 4 08:19:10 2014 UTC (6 years, 4 months ago) by haubi
Branch: MAIN
+oracle-instantclient-basic-11.2.0.4: Revbump. Fix bugs #505522, #505536. Convert to USE abi_x86_*, #506228.

(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key A630CCB8)

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.3.ebuild,v 1.12 2013/11/11 09:35:34 haubi Exp $
4
5 EAPI="4"
6
7 inherit eutils multilib-minimal
8
9 MY_PLAT_x86="Linux x86"
10 MY_BITS_x86=32
11 MY_A_x86="${PN/oracle-/}-linux-${PV}.0.zip"
12 MY_ASDK_x86="${MY_A_x86/basic/sdk}"
13
14 MY_PLAT_amd64="Linux x86-64"
15 MY_BITS_amd64=64
16 MY_A_amd64="${PN/oracle-}-linux.x64-${PV}.0.zip"
17 MY_ASDK_amd64="${MY_A_amd64/basic/sdk}"
18
19 DESCRIPTION="Oracle 11g Instant Client with SDK"
20 HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
21 SRC_URI="
22 abi_x86_32? ( ${MY_A_x86} !abi_x86_64? ( ${MY_ASDK_x86} ) )
23 abi_x86_64? ( ${MY_A_amd64} ${MY_ASDK_amd64} )
24 "
25
26 LICENSE="OTN"
27 SLOT="0"
28 KEYWORDS="~amd64 ~x86"
29 RESTRICT="fetch splitdebug"
30 IUSE=""
31
32 DEPEND="app-arch/unzip"
33 RDEPEND=">=dev-libs/libaio-0.3.109-r5[${MULTILIB_USEDEP}]"
34
35 S="${WORKDIR}"
36
37 QA_PREBUILT="usr/lib*/oracle/${PV}/client/lib*/lib*"
38
39 set_my_abivars() {
40 S="${WORKDIR}/${ABI}/instantclient_11_2"
41
42 local abi=${ABI}
43 [[ ${abi} == 'default' ]] && abi=${ARCH}
44 MY_PLAT=MY_PLAT_${abi}; MY_PLAT=${!MY_PLAT} # platform name
45 MY_BITS=MY_BITS_${abi}; MY_BITS=${!MY_BITS} # platform bitwidth
46 MY_A=MY_A_${abi} ; MY_A=${!MY_A} # runtime distfile
47 MY_ASDK=MY_ASDK_${abi}; MY_ASDK=${!MY_ASDK} # sdk distfile
48
49 [[ -n ${MY_PLAT} ]]
50 }
51
52 oic_distfile_status() {
53 if [[ -r ${DISTDIR}/${1} ]]; then
54 echo "already here"
55 else
56 echo "still absent"
57 fi
58 }
59
60 pkg_nofetch() {
61 eerror "Please go to"
62 eerror " ${HOMEPAGE%/*}/index-097480.html"
63 eerror " and download"
64 local ABI
65 for ABI in $(multilib_get_enabled_abis)
66 do
67 set_my_abivars || continue
68 eerror "Instant Client for ${MY_PLAT}"
69 eerror " Basic: ($(oic_distfile_status ${MY_A})) ${MY_A}"
70 multilib_is_native_abi &&
71 eerror " SDK: ($(oic_distfile_status ${MY_ASDK})) ${MY_ASDK}"
72 done
73 eerror "After downloading these files (for *all* shown architectures), put them in:"
74 eerror " ${DISTDIR}/"
75 }
76
77 src_unpack() {
78 local ABI
79 for ABI in $(multilib_get_enabled_abis)
80 do
81 set_my_abivars || continue
82 mkdir "${WORKDIR}"/${ABI} || die
83 cd "${WORKDIR}"/${ABI} || die
84 unpack ${MY_A}
85 multilib_is_native_abi &&
86 unpack ${MY_ASDK}
87 done
88 }
89
90 src_prepare() {
91 # need to patch for the final ABI only
92 set_my_abivars || die "${ABI} ABI not supported!"
93 cd "${S}" || die
94 epatch "${FILESDIR}"/11.2.0.3-makefile.patch
95 }
96
97 # suppress configure&compile messages from multilib-minimal
98 src_configure() { :; }
99 src_compile() { :; }
100
101 src_install() {
102 # all binaries go here
103 local oracle_home=/usr/$(get_libdir)/oracle/${PV}/client
104 into "${oracle_home}"
105
106 local ldpath= ABI
107 for ABI in $(multilib_get_enabled_abis) # last iteration is final ABI
108 do
109 if ! set_my_abivars; then
110 elog "Skipping unsupported ABI ${ABI}."
111 continue
112 fi
113 einfo "Installing runtime for ${MY_PLAT} ..."
114
115 cd "${S}" || die
116
117 # shared libraries
118 dolib.so lib*$(get_libname)*
119
120 # ensure to be linkable
121 [[ -e libocci$(get_libname) ]] ||
122 dosym libocci$(get_libname 11.1) \
123 "${oracle_home}"/$(get_libdir)/libocci$(get_libname)
124 [[ -e libclntsh$(get_libname) ]] ||
125 dosym libclntsh$(get_libname 11.1) \
126 "${oracle_home}"/$(get_libdir)/libclntsh$(get_libname)
127
128 # java archives
129 insinto "${oracle_home}"/$(get_libdir)
130 doins *.jar
131
132 # runtime library path
133 ldpath+=${ldpath:+:}${oracle_home}/$(get_libdir)
134
135 eend $?
136 done
137
138 # ensure ORACLE_HOME/lib exists
139 [[ -e ${ED}${oracle_home}/lib ]] ||
140 dosym $(get_libdir) "${oracle_home}"/lib
141
142 einfo "Installing SDK ..."
143 cd "${S}"/sdk || die
144
145 # SDK makefile, for #165834
146 # As we change the relative filesystem layout compared
147 # to vanilla instantclient.zip content, it feels easier
148 # to fake the layout found in Oracle eXpress Edition.
149 # Both layouts are known to DBD::Oracle (cpan).
150 insinto "${oracle_home}"/rdbms/demo
151 newins demo/demo.mk demo_xe.mk
152
153 # Remove ldap.h, #299562
154 rm include/ldap.h || die
155 # DBD::Oracle needs rdbms/public as real directory
156 insinto "${oracle_home}"/rdbms/public
157 doins include/*.h
158 dosym rdbms/public "${oracle_home}"/include
159 # ruby-oci8 expects the headers here
160 dosym "${oracle_home}"/rdbms/public /usr/include/oracle/${PV}/client
161
162 dodoc demo/*
163
164 eend $?
165
166 # create path for tnsnames.ora
167 insinto /etc/oracle
168 doins "${FILESDIR}"/tnsnames.ora.sample
169
170 # Add OCI libs to library path
171 {
172 echo "ORACLE_HOME=${EPREFIX}${oracle_home}"
173 echo "LDPATH=${ldpath}"
174 # who does need this?
175 # echo "C_INCLUDE_PATH=${oracle_home}/include"
176 echo "TNS_ADMIN=/etc/oracle/"
177 } > "${T}"/50oracle-instantclient-basic
178 doenvd "${T}"/50oracle-instantclient-basic
179 }
180
181 pkg_postinst() {
182 elog "${P} does not provide an sqlnet.ora"
183 elog "configuration file, redirecting oracle diagnostics for database-"
184 elog "and network-issues into ~USER/oradiag_USER/ instead."
185 elog "It should be safe to ignore this message in sqlnet.log there:"
186 elog " Directory does not exist for read/write [ORACLE_HOME/client/log] []"
187 elog "See https://bugs.gentoo.org/show_bug.cgi?id=465252 for reference."
188 elog "If you want to directly analyse low-level debug info or don't want"
189 elog "to see it at all, so you really need an sqlnet.ora file, please"
190 elog "consult http://search.oracle.com/search/search?q=sqlnet.ora"
191 elog ""
192 elog "TNS_ADMIN has been set to ${EROOT}etc/oracle by default,"
193 elog "put your tnsnames.ora there or configure TNS_ADMIN"
194 elog "to point to your user specific configuration."
195 ewarn "Please re-source your shell settings for ORACLE_HOME"
196 ewarn " changes, such as: source /etc/profile"
197 }

  ViewVC Help
Powered by ViewVC 1.1.20