Gentoo Archives: gentoo-commits

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/oracle-instantclient-basic/files/, dev-db/oracle-instantclient-basic/
Date: Mon, 09 Jul 2018 19:52:54
Message-Id: 1531165906.68fcf11d4db5454e85386e9f666235aa4fbf6d74.haubi@gentoo
1 commit: 68fcf11d4db5454e85386e9f666235aa4fbf6d74
2 Author: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jul 9 19:48:34 2018 +0000
4 Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 9 19:51:46 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=68fcf11d
7
8 Revert "dev-db/oracle-instantclient-basic: cleanup old"
9
10 This reverts commit 5719cacb8b4d4f2b0d40e92e667a7c940de1b319.
11
12 There have been stable keywords around.
13
14 dev-db/oracle-instantclient-basic/Manifest | 8 +
15 .../files/11.2.0.3-makefile.patch | 57 ++++++
16 .../files/tnsnames.ora.sample | 93 ++++++++++
17 .../oracle-instantclient-basic-11.2.0.3.ebuild | 197 ++++++++++++++++++++
18 .../oracle-instantclient-basic-11.2.0.4.ebuild | 199 +++++++++++++++++++++
19 5 files changed, 554 insertions(+)
20
21 diff --git a/dev-db/oracle-instantclient-basic/Manifest b/dev-db/oracle-instantclient-basic/Manifest
22 new file mode 100644
23 index 00000000000..48135bfba5b
24 --- /dev/null
25 +++ b/dev-db/oracle-instantclient-basic/Manifest
26 @@ -0,0 +1,8 @@
27 +DIST instantclient-basic-linux-11.2.0.3.0.zip 58502865 BLAKE2B da0f428447a4300dc64b9845d6f55c3dbeff38af06b1cb38b083f661a575a5c1749737ab389b7222f7be2a05ccdf367830642b1656505b078c0c3ca523159ae8 SHA512 c790f593e67bcc7c114a6287e1f064c03f292472e0a1a5e617a9f19017f06442f31502f66af8e6cfdf2235a18546104dc9aac164a3aa641db5728b66685c9302
28 +DIST instantclient-basic-linux-11.2.0.4.0.zip 58793148 BLAKE2B e0f92f119a5e8890a4507160179cd49af15ed14bd7c48480d3f685a3e4918a96e6444e75c6ea11d34681a6c66ff0e8011f44840de5f080e2dc3c03079361e4a1 SHA512 b333c9334e960617ac7cc68ad1c7b45f990d5c24c7a5bc8e51b3bc8ff6476acfb6a032521f75ba39327c71ee9676d1163b252066d52e97c1dfe9c092a92a62a0
29 +DIST instantclient-basic-linux.x64-11.2.0.3.0.zip 60331694 BLAKE2B 8d3e4946c04edd515f0d2495e8ce25b152ded0d903d58244d0d2a2b8bbaf263b0de67829a932f637193c08e96f4a532c131f50b6594009ca4ee1dc228d6a06d1 SHA512 708940b5ca5bc4e0617da2c4da61d0a85834e3e0731ac328a201954558a624162f71d342d674b08ec2cf076e8f639c230f88a73f6d9bfe8908b0e76805e617b7
30 +DIST instantclient-basic-linux.x64-11.2.0.4.0.zip 60704657 BLAKE2B 77735e81a0acf88221fefff38447536a81a32a6f5cb09dcd4526d43315be1fabb6882bb9e7a5703a4188ac9e112fba611f3e2c064a128eb66512935a1af62b33 SHA512 01ed32f1771bfa2f8ef1b81314843fb2b7b81582f33c07d86670c959bbb08355dc7cc8da586852bb353a3a914658d1e7828d6b5df884215de8d76881c956a989
31 +DIST instantclient-sdk-linux-11.2.0.3.0.zip 639306 BLAKE2B 80d0cac2061156fd4cfe0792a7bebcaca77ce855335c651472d0ee74cf87350ae4925d92ecd12407b285605fb0d533dcf2a6dfc46d8a0eaa6172461e9c96dc2f SHA512 fa0f98d4b2002982fab4438f734904e0ebfab777d601321423b454f9188c3b863e853fc5486c9958771f7ff8c9a544ce73e80750d745c3142872927ed1777ee1
32 +DIST instantclient-sdk-linux-11.2.0.4.0.zip 643080 BLAKE2B 9ea15b227d260f7e24b572be1238074dc3a3033a2ab6313d95b750ae48468bda018c52ac604664caa128396024c0ff4bcbc0d401b7900ae27f5f3877a4b44123 SHA512 09e14a0ed88182b685a00b6370da4379710c4179fcf2d5ebdb43684b7099484122f7f5181a80352464f03ae9d0150f5c2ee5f20ede98faa9073294324b9faec8
33 +DIST instantclient-sdk-linux.x64-11.2.0.3.0.zip 641586 BLAKE2B b3a3fa4c362031aa9d9e926f852e2bccc41dd12c8dac0a18b707f22130a8bfc1b04e12c13b7f94a845439d922884d9f83c149ac0d59af498a73f4c74730be715 SHA512 08b3fdc68e09f262549e2505867943aff5c3927d158569ea7e0bca4f958af725a46143d325dcf80a6d48d09f9240f147470439ac55ea848a27df3eeedd28f732
34 +DIST instantclient-sdk-linux.x64-11.2.0.4.0.zip 643089 BLAKE2B 710f0a2a81dde6cabdfb2e1472f40cb715d1e060377bec1d05d8b1c794ec05b023f4feca30603202487b52527723ed9d60f73371443ce76ad2781da9c1ed5412 SHA512 7198ddc7d8804353900e45b36de79659d75dee0197c4dd58bd4d69408e7131c95025223bbd1f39ef208269bff379daa6e05f4371af83a82b83997cafadc1d642
35
36 diff --git a/dev-db/oracle-instantclient-basic/files/11.2.0.3-makefile.patch b/dev-db/oracle-instantclient-basic/files/11.2.0.3-makefile.patch
37 new file mode 100644
38 index 00000000000..efcc2c6fac7
39 --- /dev/null
40 +++ b/dev-db/oracle-instantclient-basic/files/11.2.0.3-makefile.patch
41 @@ -0,0 +1,57 @@
42 +Fake demo_xe.mk found in Oracle eXpress Edition,
43 +known by CPAN DBD::Oracle (bug#165834).
44 +This provides absolute paths for headers and libraries.
45 +
46 +Paranoia drops those REMOVE lines.
47 +--- sdk/demo/demo.mk.orig 2012-03-06 17:11:57.636990449 +0100
48 ++++ sdk/demo/demo.mk 2012-03-06 17:19:37.985324293 +0100
49 +@@ -28,8 +28,9 @@
50 + CC=/opt/SunProd/SUNWspro6.1/bin/CC
51 + cc=/opt/SunProd/SUNWspro6.1/bin/cc
52 +
53 +-ICINCHOME=../
54 +-ICLIBHOME=../../
55 ++LIBDIR=lib
56 ++ICINCHOME=$(ORACLE_HOME)/
57 ++ICLIBHOME=$(ORACLE_HOME)/$(LIBDIR)
58 + ICLIBPATH=-L$(ICLIBHOME)
59 + THREADLIBS=-lthread
60 + CCLIB=$(ICLIBPATH) -locci -lclntsh $(THREADLIBS)
61 +@@ -64,18 +64,18 @@
62 + all: clean buildoci $(OCCIDEMO) $(OCCIOBJDEMO)
63 +
64 + buildoci: $(CLNCACHE) $(LIBCLNT) $(CDEMOOBJS)
65 +- $(MKLINK) $(ICLIBHOME)libclntsh$(SO_EXT).11.1 $(ICLIBHOME)libclntsh$(SO_EXT)
66 +- $(MKLINK) $(ICLIBHOME)libocci$(SO_EXT).11.1 $(ICLIBHOME)libocci$(SO_EXT)
67 ++# $(MKLINK) $(ICLIBHOME)libclntsh$(SO_EXT).11.1 $(ICLIBHOME)libclntsh$(SO_EXT)
68 ++# $(MKLINK) $(ICLIBHOME)libocci$(SO_EXT).11.1 $(ICLIBHOME)libocci$(SO_EXT)
69 + $(CC) -o $(CDEMOEXE) $(LDFLAGS) $(CDEMOOBJS) $(CCLIB)
70 +- $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
71 +- $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
72 ++# $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
73 ++# $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
74 +
75 + buildocci: $(CLNCACHE) $(LIBCLNT) $(OBJS)
76 +- $(MKLINK) $(ICLIBHOME)libclntsh$(SO_EXT).11.1 $(ICLIBHOME)libclntsh$(SO_EXT)
77 +- $(MKLINK) $(ICLIBHOME)libocci$(SO_EXT).11.1 $(ICLIBHOME)libocci$(SO_EXT)
78 ++# $(MKLINK) $(ICLIBHOME)libclntsh$(SO_EXT).11.1 $(ICLIBHOME)libclntsh$(SO_EXT)
79 ++# $(MKLINK) $(ICLIBHOME)libocci$(SO_EXT).11.1 $(ICLIBHOME)libocci$(SO_EXT)
80 + $(CC) -o $(EXE) $(LDFLAGS) $(OBJS) $(CCLIB)
81 +- $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
82 +- $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
83 ++# $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
84 ++# $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
85 +
86 + $(OCCIDEMO):
87 + $(MAKE) -f $(MAKEFILE) buildocci OBJS=$@.o EXE=$@
88 +@@ -93,8 +93,8 @@
89 +
90 + cleancache:
91 + $(REMOVE) $(CACHEDIR)
92 +- $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
93 +- $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
94 ++# $(REMOVE) $(ICLIBHOME)libclntsh$(SO_EXT)
95 ++# $(REMOVE) $(ICLIBHOME)libocci$(SO_EXT)
96 +
97 + clean: $(CLNCACHE)
98 + $(REMOVE) cdemo81 cdemo81.o occidml occidml.o occiobj occiobj.o occiobjo* occiobjm* occiobj.h occiobjout.type
99
100 diff --git a/dev-db/oracle-instantclient-basic/files/tnsnames.ora.sample b/dev-db/oracle-instantclient-basic/files/tnsnames.ora.sample
101 new file mode 100644
102 index 00000000000..f0524f5993c
103 --- /dev/null
104 +++ b/dev-db/oracle-instantclient-basic/files/tnsnames.ora.sample
105 @@ -0,0 +1,93 @@
106 +# This file contains the syntax information for
107 +# the entries to be put in any tnsnames.ora file
108 +# The entries in this file are need based.
109 +# There are no defaults for entries in this file
110 +# that Sqlnet/Net3 use that need to be overridden
111 +#
112 +# Typically you could have two tnsnames.ora files
113 +# in the system, one that is set for the entire system
114 +# and is called the system tnsnames.ora file, and a
115 +# second file that is used by each user locally so that
116 +# he can override the definitions dictated by the system
117 +# tnsnames.ora file.
118 +
119 +# The entries in tnsnames.ora are an alternative to using
120 +# the names server with the onames adapter.
121 +# They are a collection of aliases for the addresses that
122 +# the listener(s) is(are) listening for a database or
123 +# several databases.
124 +
125 +# The following is the general syntax for any entry in
126 +# a tnsnames.ora file. There could be several such entries
127 +# tailored to the user's needs.
128 +
129 +<alias>= [ (DESCRIPTION_LIST = # Optional depending on whether u have
130 + # one or more descriptions
131 + # If there is just one description, unnecessary ]
132 + (DESCRIPTION=
133 + [ (SDU=2048) ] # Optional, defaults to 2048
134 + # Can take values between 512 and 32K
135 + [ (ADDRESS_LIST= # Optional depending on whether u have
136 + # one or more addresses
137 + # If there is just one address, unnecessary ]
138 + (ADDRESS=
139 + [ (COMMUNITY=<community_name>) ]
140 + (PROTOCOL=tcp)
141 + (HOST=<hostname>)
142 + (PORT=<portnumber (1521 is a standard port used)>)
143 + )
144 + [ (ADDRESS=
145 + (PROTOCOL=ipc)
146 + (KEY=<ipckey (PNPKEY is a standard key used)>)
147 + )
148 + ]
149 + [ (ADDRESS=
150 + [ (COMMUNITY=<community_name>) ]
151 + (PROTOCOL=decnet)
152 + (NODE=<nodename>)
153 + (OBJECT=<objectname>)
154 + )
155 + ]
156 + ... # More addresses
157 + [ ) ] # Optional depending on whether ADDRESS_LIST is used or not
158 + [ (CONNECT_DATA=
159 + (SID=<oracle_sid>)
160 + [ (GLOBAL_NAME=<global_database_name>) ]
161 + )
162 + ]
163 + [ (SOURCE_ROUTE=yes) ]
164 + )
165 + (DESCRIPTION=
166 + [ (SDU=2048) ] # Optional, defaults to 2048
167 + # Can take values between 512 and 32K
168 + [ (ADDRESS_LIST= ] # Optional depending on whether u have more
169 + # than one address or not
170 + # If there is just one address, unnecessary
171 + (ADDRESS
172 + [ (COMMUNITY=<community_name>) ]
173 + (PROTOCOL=tcp)
174 + (HOST=<hostname>)
175 + (PORT=<portnumber (1521 is a standard port used)>)
176 + )
177 + [ (ADDRESS=
178 + (PROTOCOL=ipc)
179 + (KEY=<ipckey (PNPKEY is a standard key used)>)
180 + )
181 + ]
182 + ... # More addresses
183 + [ ) ] # Optional depending on whether ADDRESS_LIST
184 + # is being used
185 + [ (CONNECT_DATA=
186 + (SID=<oracle_sid>)
187 + [ (GLOBAL_NAME=<global_database_name>) ]
188 + )
189 + ]
190 + [ (SOURCE_ROUTE=yes) ]
191 + )
192 + [ (CONNECT_DATA=
193 + (SID=<oracle_sid>)
194 + [ (GLOBAL_NAME=<global_database_name>) ]
195 + )
196 + ]
197 + ... # More descriptions
198 + [ ) ] # Optional depending on whether DESCRIPTION_LIST is used or not
199
200 diff --git a/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.3.ebuild b/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.3.ebuild
201 new file mode 100644
202 index 00000000000..a63d14bc52b
203 --- /dev/null
204 +++ b/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.3.ebuild
205 @@ -0,0 +1,197 @@
206 +# Copyright 1999-2013 Gentoo Foundation
207 +# Distributed under the terms of the GNU General Public License v2
208 +
209 +EAPI="4"
210 +
211 +inherit eutils multilib
212 +
213 +MY_PLAT_x86="Linux x86"
214 +MY_BITS_x86=32
215 +MY_A_x86="${PN/oracle-/}-linux-${PV}.0.zip"
216 +MY_ASDK_x86="${MY_A_x86/basic/sdk}"
217 +
218 +MY_PLAT_amd64="Linux x86-64"
219 +MY_BITS_amd64=64
220 +MY_A_amd64="${PN/oracle-}-linux.x64-${PV}.0.zip"
221 +MY_ASDK_amd64="${MY_A_amd64/basic/sdk}"
222 +
223 +DESCRIPTION="Oracle 11g Instant Client with SDK"
224 +HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
225 +SRC_URI="
226 + x86? ( ${MY_A_x86} ${MY_ASDK_x86} )
227 + amd64? ( ${MY_A_amd64} ${MY_ASDK_amd64} multilib? ( ${MY_A_x86} ) )
228 +"
229 +
230 +LICENSE="OTN"
231 +SLOT="0"
232 +KEYWORDS="amd64 x86"
233 +RESTRICT="fetch"
234 +IUSE="multilib"
235 +
236 +EMULTILIB_PKG="true"
237 +
238 +DEPEND="app-arch/unzip"
239 +RDEPEND="
240 + dev-libs/libaio
241 + multilib? ( >=dev-libs/libaio-0.3.109-r3 )
242 +"
243 +
244 +S="${WORKDIR}"
245 +
246 +QA_PREBUILT="usr/lib*/oracle/${PV}/client/lib*/lib*"
247 +
248 +set_my_abivars() {
249 + S="${WORKDIR}/${ABI}/instantclient_11_2"
250 +
251 + local abi=${ABI}
252 + [[ ${abi} == 'default' ]] && abi=${ARCH}
253 + MY_PLAT=MY_PLAT_${abi}; MY_PLAT=${!MY_PLAT} # platform name
254 + MY_BITS=MY_BITS_${abi}; MY_BITS=${!MY_BITS} # platform bitwidth
255 + MY_A=MY_A_${abi} ; MY_A=${!MY_A} # runtime distfile
256 + MY_ASDK=MY_ASDK_${abi}; MY_ASDK=${!MY_ASDK} # sdk distfile
257 +
258 + [[ -n ${MY_PLAT} ]]
259 +}
260 +
261 +oic_distfile_status() {
262 + if [[ -r ${DISTDIR}/${1} ]]; then
263 + echo "already here"
264 + else
265 + echo "still absent"
266 + fi
267 +}
268 +
269 +pkg_nofetch() {
270 + eerror "Please go to"
271 + eerror " ${HOMEPAGE%/*}/index-097480.html"
272 + eerror " and download"
273 + for ABI in $(get_install_abis)
274 + do
275 + set_my_abivars || continue
276 + eerror "Instant Client for ${MY_PLAT}"
277 + eerror " Basic: ($(oic_distfile_status ${MY_A})) ${MY_A}"
278 + if is_final_abi; then
279 + eerror " SDK: ($(oic_distfile_status ${MY_ASDK})) ${MY_ASDK}"
280 + fi
281 + done
282 + eerror "After downloading these files (for *all* shown architectures), put them in:"
283 + eerror " ${DISTDIR}/"
284 +}
285 +
286 +src_unpack() {
287 + for ABI in $(get_install_abis)
288 + do
289 + set_my_abivars || continue
290 + mkdir "${WORKDIR}"/${ABI} || die
291 + cd "${WORKDIR}"/${ABI} || die
292 + unpack ${MY_A}
293 + if is_final_abi; then
294 + unpack ${MY_ASDK}
295 + fi
296 + done
297 +}
298 +
299 +src_prepare() {
300 + # need to patch for the final ABI only
301 + set_my_abivars || die "${ABI} ABI not supported!"
302 + cd "${S}" || die
303 + epatch "${FILESDIR}"/11.2.0.3-makefile.patch
304 +}
305 +
306 +src_install() {
307 + # all binaries go here
308 + local oracle_home=/usr/$(get_libdir)/oracle/${PV}/client
309 + into "${oracle_home}"
310 +
311 + local ldpath=
312 + for ABI in $(get_install_abis) # last iteration is final ABI
313 + do
314 + if ! set_my_abivars; then
315 + elog "Skipping unsupported ABI ${ABI}."
316 + continue
317 + fi
318 + einfo "Installing runtime for ${MY_PLAT} ..."
319 +
320 + cd "${S}" || die
321 +
322 + # shared libraries
323 + dolib.so lib*$(get_libname)*
324 +
325 + # ensure to be linkable
326 + [[ -e libocci$(get_libname) ]] ||
327 + dosym libocci$(get_libname 11.1) \
328 + "${oracle_home}"/$(get_libdir)/libocci$(get_libname)
329 + [[ -e libclntsh$(get_libname) ]] ||
330 + dosym libclntsh$(get_libname 11.1) \
331 + "${oracle_home}"/$(get_libdir)/libclntsh$(get_libname)
332 +
333 + # java archives
334 + insinto "${oracle_home}"/$(get_libdir)
335 + doins *.jar
336 +
337 + # runtime library path
338 + ldpath+=${ldpath:+:}${oracle_home}/$(get_libdir)
339 +
340 + eend $?
341 + done
342 +
343 + # ensure ORACLE_HOME/lib exists
344 + [[ -e ${ED}${oracle_home}/lib ]] ||
345 + dosym $(get_libdir) "${oracle_home}"/lib
346 +
347 + einfo "Installing SDK ..."
348 + cd "${S}"/sdk || die
349 +
350 + # SDK makefile, for #165834
351 + # As we change the relative filesystem layout compared
352 + # to vanilla instantclient.zip content, it feels easier
353 + # to fake the layout found in Oracle eXpress Edition.
354 + # Both layouts are known to DBD::Oracle (cpan).
355 + insinto "${oracle_home}"/rdbms/demo
356 + newins demo/demo.mk demo_xe.mk
357 +
358 + # Remove ldap.h, #299562
359 + rm include/ldap.h || die
360 + # DBD::Oracle needs rdbms/public as real directory
361 + insinto "${oracle_home}"/rdbms/public
362 + doins include/*.h
363 + dosym rdbms/public "${oracle_home}"/include
364 + # ruby-oci8 expects the headers here
365 + dosym "${oracle_home}"/rdbms/public /usr/include/oracle/${PV}/client
366 +
367 + dodoc demo/*
368 +
369 + eend $?
370 +
371 + # create path for tnsnames.ora
372 + insinto /etc/oracle
373 + doins "${FILESDIR}"/tnsnames.ora.sample
374 +
375 + # Add OCI libs to library path
376 + {
377 + echo "ORACLE_HOME=${EPREFIX}${oracle_home}"
378 + echo "LDPATH=${ldpath}"
379 +# who does need this?
380 +# echo "C_INCLUDE_PATH=${oracle_home}/include"
381 + echo "TNS_ADMIN=/etc/oracle/"
382 + } > "${T}"/50oracle-instantclient-basic
383 + doenvd "${T}"/50oracle-instantclient-basic
384 +}
385 +
386 +pkg_postinst() {
387 + elog "${P} does not provide an sqlnet.ora"
388 + elog "configuration file, redirecting oracle diagnostics for database-"
389 + elog "and network-issues into ~USER/oradiag_USER/ instead."
390 + elog "It should be safe to ignore this message in sqlnet.log there:"
391 + elog " Directory does not exist for read/write [ORACLE_HOME/client/log] []"
392 + elog "See https://bugs.gentoo.org/show_bug.cgi?id=465252 for reference."
393 + elog "If you want to directly analyse low-level debug info or don't want"
394 + elog "to see it at all, so you really need an sqlnet.ora file, please"
395 + elog "consult http://search.oracle.com/search/search?q=sqlnet.ora"
396 + elog ""
397 + elog "TNS_ADMIN has been set to ${EROOT}etc/oracle by default,"
398 + elog "put your tnsnames.ora there or configure TNS_ADMIN"
399 + elog "to point to your user specific configuration."
400 + ewarn "Please re-source your shell settings for ORACLE_HOME"
401 + ewarn " changes, such as: source /etc/profile"
402 +}
403
404 diff --git a/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.4.ebuild b/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.4.ebuild
405 new file mode 100644
406 index 00000000000..0dfbc639543
407 --- /dev/null
408 +++ b/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.4.ebuild
409 @@ -0,0 +1,199 @@
410 +# Copyright 1999-2015 Gentoo Foundation
411 +# Distributed under the terms of the GNU General Public License v2
412 +
413 +EAPI="4"
414 +
415 +inherit eutils multilib-minimal
416 +
417 +MY_PLAT_x86="Linux x86"
418 +MY_BITS_x86=32
419 +MY_A_x86="${PN/oracle-/}-linux-${PV}.0.zip"
420 +MY_ASDK_x86="${MY_A_x86/basic/sdk}"
421 +
422 +MY_PLAT_amd64="Linux x86-64"
423 +MY_BITS_amd64=64
424 +MY_A_amd64="${PN/oracle-}-linux.x64-${PV}.0.zip"
425 +MY_ASDK_amd64="${MY_A_amd64/basic/sdk}"
426 +
427 +DESCRIPTION="Oracle 11g Instant Client with SDK"
428 +HOMEPAGE="http://www.oracle.com/technetwork/database/features/instant-client/index.html"
429 +SRC_URI="
430 + abi_x86_32? ( ${MY_A_x86} !abi_x86_64? ( ${MY_ASDK_x86} ) )
431 + abi_x86_64? ( ${MY_A_amd64} ${MY_ASDK_amd64} )
432 +"
433 +
434 +LICENSE="OTN"
435 +SLOT="0"
436 +KEYWORDS="amd64 x86"
437 +RESTRICT="fetch splitdebug"
438 +IUSE=""
439 +
440 +DEPEND="app-arch/unzip"
441 +RDEPEND=">=dev-libs/libaio-0.3.109-r5[${MULTILIB_USEDEP}]"
442 +
443 +S="${WORKDIR}"
444 +
445 +QA_PREBUILT="usr/lib*/oracle/${PV}/client/lib*/lib*"
446 +
447 +set_my_abivars() {
448 + S="${WORKDIR}/${ABI}/instantclient_11_2"
449 +
450 + local abi=${ABI}
451 + [[ ${abi} == 'default' ]] && abi=${ARCH}
452 + MY_PLAT=MY_PLAT_${abi}; MY_PLAT=${!MY_PLAT} # platform name
453 + MY_BITS=MY_BITS_${abi}; MY_BITS=${!MY_BITS} # platform bitwidth
454 + MY_A=MY_A_${abi} ; MY_A=${!MY_A} # runtime distfile
455 + MY_ASDK=MY_ASDK_${abi}; MY_ASDK=${!MY_ASDK} # sdk distfile
456 +
457 + [[ -n ${MY_PLAT} ]]
458 +}
459 +
460 +oic_distfile_status() {
461 + if [[ -r ${DISTDIR}/${1} ]]; then
462 + echo "already here"
463 + else
464 + echo "still absent"
465 + fi
466 +}
467 +
468 +pkg_nofetch() {
469 + eerror "Please go to"
470 + eerror " ${HOMEPAGE%/*}/index-097480.html"
471 + eerror " and download"
472 + local ABI
473 + for ABI in $(multilib_get_enabled_abis)
474 + do
475 + set_my_abivars || continue
476 + eerror "Instant Client for ${MY_PLAT}"
477 + eerror " Basic: ($(oic_distfile_status ${MY_A})) ${MY_A}"
478 + multilib_is_native_abi &&
479 + eerror " SDK: ($(oic_distfile_status ${MY_ASDK})) ${MY_ASDK}"
480 + done
481 + eerror "After downloading these files (for *all* shown architectures), put them in:"
482 + eerror " ${DISTDIR}/"
483 +}
484 +
485 +src_unpack() {
486 + local ABI
487 + for ABI in $(multilib_get_enabled_abis)
488 + do
489 + set_my_abivars || continue
490 + mkdir "${WORKDIR}"/${ABI} || die
491 + cd "${WORKDIR}"/${ABI} || die
492 + unpack ${MY_A}
493 + multilib_is_native_abi &&
494 + unpack ${MY_ASDK}
495 + done
496 +}
497 +
498 +src_prepare() {
499 + local ABI
500 + for ABI in $(multilib_get_enabled_abis)
501 + do : # need to patch for the final ABI only
502 + done
503 + set_my_abivars || die "${ABI} ABI not supported!"
504 + cd "${S}" || die
505 + epatch "${FILESDIR}"/11.2.0.3-makefile.patch
506 +}
507 +
508 +# suppress configure&compile messages from multilib-minimal
509 +src_configure() { :; }
510 +src_compile() { :; }
511 +
512 +src_install() {
513 + # all binaries go here
514 + local oracle_home=/usr/$(get_libdir)/oracle/${PV}/client
515 + into "${oracle_home}"
516 +
517 + local ldpath= ABI
518 + for ABI in $(multilib_get_enabled_abis) # last iteration is final ABI
519 + do
520 + if ! set_my_abivars; then
521 + elog "Skipping unsupported ABI ${ABI}."
522 + continue
523 + fi
524 + einfo "Installing runtime for ${MY_PLAT} ..."
525 +
526 + cd "${S}" || die
527 +
528 + # shared libraries
529 + dolib.so lib*$(get_libname)*
530 +
531 + # ensure to be linkable
532 + [[ -e libocci$(get_libname) ]] ||
533 + dosym libocci$(get_libname 11.1) \
534 + "${oracle_home}"/$(get_libdir)/libocci$(get_libname)
535 + [[ -e libclntsh$(get_libname) ]] ||
536 + dosym libclntsh$(get_libname 11.1) \
537 + "${oracle_home}"/$(get_libdir)/libclntsh$(get_libname)
538 +
539 + # java archives
540 + insinto "${oracle_home}"/$(get_libdir)
541 + doins *.jar
542 +
543 + # runtime library path
544 + ldpath+=${ldpath:+:}${oracle_home}/$(get_libdir)
545 +
546 + eend $?
547 + done
548 +
549 + # ensure ORACLE_HOME/lib exists
550 + [[ -e ${ED}${oracle_home}/lib ]] ||
551 + dosym $(get_libdir) "${oracle_home}"/lib
552 +
553 + einfo "Installing SDK ..."
554 + cd "${S}"/sdk || die
555 +
556 + # SDK makefile, for #165834
557 + # As we change the relative filesystem layout compared
558 + # to vanilla instantclient.zip content, it feels easier
559 + # to fake the layout found in Oracle eXpress Edition.
560 + # Both layouts are known to DBD::Oracle (cpan).
561 + insinto "${oracle_home}"/rdbms/demo
562 + newins demo/demo.mk demo_xe.mk
563 +
564 + # Remove ldap.h, #299562
565 + rm include/ldap.h || die
566 + # DBD::Oracle needs rdbms/public as real directory
567 + insinto "${oracle_home}"/rdbms/public
568 + doins include/*.h
569 + dosym rdbms/public "${oracle_home}"/include
570 + # ruby-oci8 expects the headers here
571 + dosym "${oracle_home}"/rdbms/public /usr/include/oracle/${PV}/client
572 +
573 + dodoc demo/*
574 +
575 + eend $?
576 +
577 + # create path for tnsnames.ora
578 + insinto /etc/oracle
579 + doins "${FILESDIR}"/tnsnames.ora.sample
580 +
581 + # Add OCI libs to library path
582 + {
583 + echo "ORACLE_HOME=${EPREFIX}${oracle_home}"
584 + echo "LDPATH=${ldpath}"
585 +# who does need this?
586 +# echo "C_INCLUDE_PATH=${oracle_home}/include"
587 + echo "TNS_ADMIN=/etc/oracle/"
588 + } > "${T}"/50oracle-instantclient-basic
589 + doenvd "${T}"/50oracle-instantclient-basic
590 +}
591 +
592 +pkg_postinst() {
593 + elog "${P} does not provide an sqlnet.ora"
594 + elog "configuration file, redirecting oracle diagnostics for database-"
595 + elog "and network-issues into ~USER/oradiag_USER/ instead."
596 + elog "It should be safe to ignore this message in sqlnet.log there:"
597 + elog " Directory does not exist for read/write [ORACLE_HOME/client/log] []"
598 + elog "See https://bugs.gentoo.org/show_bug.cgi?id=465252 for reference."
599 + elog "If you want to directly analyse low-level debug info or don't want"
600 + elog "to see it at all, so you really need an sqlnet.ora file, please"
601 + elog "consult http://search.oracle.com/search/search?q=sqlnet.ora"
602 + elog ""
603 + elog "TNS_ADMIN has been set to ${EROOT}etc/oracle by default,"
604 + elog "put your tnsnames.ora there or configure TNS_ADMIN"
605 + elog "to point to your user specific configuration."
606 + ewarn "Please re-source your shell settings for ORACLE_HOME"
607 + ewarn " changes, such as: source /etc/profile"
608 +}