/[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.4 - (hide annotations) (download)
Fri May 15 08:49:56 2015 UTC (5 years, 3 months ago) by zlogene
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +2 -2 lines
x86 stable wrt bug #524924

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 0xC42EB5D6)

1 ago 1.3 # Copyright 1999-2015 Gentoo Foundation
2 haubi 1.1 # Distributed under the terms of the GNU General Public License v2
3 zlogene 1.4 # $Header: /var/cvsroot/gentoo-x86/dev-db/oracle-instantclient-basic/oracle-instantclient-basic-11.2.0.4.ebuild,v 1.3 2015/04/19 13:28:01 ago Exp $
4 haubi 1.1
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 zlogene 1.4 KEYWORDS="amd64 x86"
29 haubi 1.1 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 haubi 1.2 local ABI
92     for ABI in $(multilib_get_enabled_abis)
93     do : # need to patch for the final ABI only
94     done
95 haubi 1.1 set_my_abivars || die "${ABI} ABI not supported!"
96     cd "${S}" || die
97     epatch "${FILESDIR}"/11.2.0.3-makefile.patch
98     }
99    
100     # suppress configure&compile messages from multilib-minimal
101     src_configure() { :; }
102     src_compile() { :; }
103    
104     src_install() {
105     # all binaries go here
106     local oracle_home=/usr/$(get_libdir)/oracle/${PV}/client
107     into "${oracle_home}"
108    
109     local ldpath= ABI
110     for ABI in $(multilib_get_enabled_abis) # last iteration is final ABI
111     do
112     if ! set_my_abivars; then
113     elog "Skipping unsupported ABI ${ABI}."
114     continue
115     fi
116     einfo "Installing runtime for ${MY_PLAT} ..."
117    
118     cd "${S}" || die
119    
120     # shared libraries
121     dolib.so lib*$(get_libname)*
122    
123     # ensure to be linkable
124     [[ -e libocci$(get_libname) ]] ||
125     dosym libocci$(get_libname 11.1) \
126     "${oracle_home}"/$(get_libdir)/libocci$(get_libname)
127     [[ -e libclntsh$(get_libname) ]] ||
128     dosym libclntsh$(get_libname 11.1) \
129     "${oracle_home}"/$(get_libdir)/libclntsh$(get_libname)
130    
131     # java archives
132     insinto "${oracle_home}"/$(get_libdir)
133     doins *.jar
134    
135     # runtime library path
136     ldpath+=${ldpath:+:}${oracle_home}/$(get_libdir)
137    
138     eend $?
139     done
140    
141     # ensure ORACLE_HOME/lib exists
142     [[ -e ${ED}${oracle_home}/lib ]] ||
143     dosym $(get_libdir) "${oracle_home}"/lib
144    
145     einfo "Installing SDK ..."
146     cd "${S}"/sdk || die
147    
148     # SDK makefile, for #165834
149     # As we change the relative filesystem layout compared
150     # to vanilla instantclient.zip content, it feels easier
151     # to fake the layout found in Oracle eXpress Edition.
152     # Both layouts are known to DBD::Oracle (cpan).
153     insinto "${oracle_home}"/rdbms/demo
154     newins demo/demo.mk demo_xe.mk
155    
156     # Remove ldap.h, #299562
157     rm include/ldap.h || die
158     # DBD::Oracle needs rdbms/public as real directory
159     insinto "${oracle_home}"/rdbms/public
160     doins include/*.h
161     dosym rdbms/public "${oracle_home}"/include
162     # ruby-oci8 expects the headers here
163     dosym "${oracle_home}"/rdbms/public /usr/include/oracle/${PV}/client
164    
165     dodoc demo/*
166    
167     eend $?
168    
169     # create path for tnsnames.ora
170     insinto /etc/oracle
171     doins "${FILESDIR}"/tnsnames.ora.sample
172    
173     # Add OCI libs to library path
174     {
175     echo "ORACLE_HOME=${EPREFIX}${oracle_home}"
176     echo "LDPATH=${ldpath}"
177     # who does need this?
178     # echo "C_INCLUDE_PATH=${oracle_home}/include"
179     echo "TNS_ADMIN=/etc/oracle/"
180     } > "${T}"/50oracle-instantclient-basic
181     doenvd "${T}"/50oracle-instantclient-basic
182     }
183    
184     pkg_postinst() {
185     elog "${P} does not provide an sqlnet.ora"
186     elog "configuration file, redirecting oracle diagnostics for database-"
187     elog "and network-issues into ~USER/oradiag_USER/ instead."
188     elog "It should be safe to ignore this message in sqlnet.log there:"
189     elog " Directory does not exist for read/write [ORACLE_HOME/client/log] []"
190     elog "See https://bugs.gentoo.org/show_bug.cgi?id=465252 for reference."
191     elog "If you want to directly analyse low-level debug info or don't want"
192     elog "to see it at all, so you really need an sqlnet.ora file, please"
193     elog "consult http://search.oracle.com/search/search?q=sqlnet.ora"
194     elog ""
195     elog "TNS_ADMIN has been set to ${EROOT}etc/oracle by default,"
196     elog "put your tnsnames.ora there or configure TNS_ADMIN"
197     elog "to point to your user specific configuration."
198     ewarn "Please re-source your shell settings for ORACLE_HOME"
199     ewarn " changes, such as: source /etc/profile"
200     }

  ViewVC Help
Powered by ViewVC 1.1.20