--- dev-db/oracle-instantclient/oracle-instantclient-12.1.0.2.ebuild 2016-10-19 11:40:11.124153065 +0200 +++ dev-db/oracle-instantclient/oracle-instantclient-12.1.0.2.ebuild 2016-10-19 11:43:44.006160646 +0200 @@ -14,6 +14,7 @@ MY_A_x86_sdk="${MY_A_x86/basic/sdk}" MY_A_x86_odbc="${MY_A_x86/basic/odbc}" MY_A_x86_jdbc="${MY_A_x86/basic/jdbc}" +MY_A_X86_precomp="${MY_A_x86/basic/precomp}" MY_A_x86_sqlplus="${MY_A_x86/basic/sqlplus}" MY_A_x86_tools="${MY_A_x86/basic/tools}" @@ -23,6 +24,7 @@ MY_A_amd64_sdk="${MY_A_amd64/basic/sdk}" MY_A_amd64_odbc="${MY_A_amd64/basic/odbc}" MY_A_amd64_jdbc="${MY_A_amd64/basic/jdbc}" +MY_A_amd64_precomp="${MY_A_amd64/basic/precomp}" MY_A_amd64_sqlplus="${MY_A_amd64/basic/sqlplus}" MY_A_amd64_tools="${MY_A_amd64/basic/tools}" @@ -34,6 +36,7 @@ odbc? ( ${MY_A_x86_odbc} ) jdbc? ( ${MY_A_x86_jdbc} ) !abi_x86_64? ( + precomp? ( ${MY_A_X86_precomp} ) sdk? ( ${MY_A_x86_sdk} ) sqlplus? ( ${MY_A_x86_sqlplus} ) tools? ( ${MY_A_x86_tools} ) @@ -42,6 +45,7 @@ ${MY_A_amd64} odbc? ( ${MY_A_amd64_odbc} ) jdbc? ( ${MY_A_amd64_jdbc} ) + precomp? ( ${MY_A_amd64_precomp} ) sdk? ( ${MY_A_amd64_sdk} ) sqlplus? ( ${MY_A_amd64_sqlplus} ) tools? ( ${MY_A_amd64_tools} ) @@ -52,7 +56,9 @@ SLOT="0/${MY_PVM}" KEYWORDS="~amd64 ~x86" RESTRICT="fetch splitdebug" -IUSE="jdbc odbc +sdk +sqlplus tools" +IUSE="jdbc odbc precomp +sdk +sqlplus tools" + +REQUIRED_USE="precomp? ( sdk )" DEPEND="app-arch/unzip" RDEPEND=" @@ -80,6 +86,7 @@ MY_A_sdk=MY_A_${abi}_sdk ; MY_A_sdk=${!MY_A_sdk} # sdk distfile MY_A_odbc=MY_A_${abi}_odbc ; MY_A_odbc=${!MY_A_odbc} # odbc distfile MY_A_jdbc=MY_A_${abi}_jdbc ; MY_A_jdbc=${!MY_A_jdbc} # jdbc distfile + MY_A_precomp=MY_A_${abi}_precomp; MY_A_precomp=${!MY_A_precomp} # precomp distfile MY_A_sqlplus=MY_A_${abi}_sqlplus; MY_A_sqlplus=${!MY_A_sqlplus} # sqlplus distfile MY_A_tools=MY_A_${abi}_tools ; MY_A_tools=${!MY_A_tools} # tools distfile @@ -109,6 +116,8 @@ use jdbc && eerror " JDBC: ($(oic_distfile_status ${MY_A_jdbc})) ${MY_A_jdbc}" if multilib_is_native_abi; then + use precomp && + eerror " Precomp: ($(oic_distfile_status ${MY_A_precomp})) ${MY_A_precomp}" use sdk && eerror " SDK: ($(oic_distfile_status ${MY_A_sdk})) ${MY_A_sdk}" use sqlplus && @@ -132,6 +141,7 @@ use odbc && unpack ${MY_A_odbc} use jdbc && unpack ${MY_A_jdbc} if multilib_is_native_abi; then + use precomp && unpack ${MY_A_precomp} use sdk && unpack ${MY_A_sdk} use sqlplus && unpack ${MY_A_sqlplus} use tools && unpack ${MY_A_tools} @@ -141,6 +151,15 @@ src_prepare() { use sdk && PATCHES=( "${FILESDIR}"/12.1.0.2-makefile.patch ) + use precomp && PATCHES+=( "${FILESDIR}"/12.1.0.2-precomp-gentoo.patch ) + + if use precomp; then + # Sanitize sys_include in precomp/admin/pcscfg.cfg + local oracle_home=usr/$(get_libdir)/oracle/${MY_PVM}/client + local sys_includes=${EROOT}${oracle_home}/include,${EROOT}usr/include + sed -i -e 's%^sys_include=.*%sys_include=('${sys_includes}')%' precomp/admin/pcscfg.cfg || die + fi + default } @@ -205,6 +224,40 @@ cd "${S}" || die eend $? + if use precomp; then + # Install pcscfg.cfg into /etc/oracle, as the user probably + # wants to add the include path for the compiler headers + # here and we do not want this to be overwritten. + insinto /etc/oracle + cd "${S}"/precomp/admin || die + # Only install pcscfg.cfg, as the other file is for + # the unsupported COBOL precompiler. + doins pcscfg.cfg + dosym /etc/oracle/pcscfg.cfg "/${oracle_home}"/precomp/admin/pcscfg.cfg + + cd "${S}"/sdk || die + + insinto "/${oracle_home}"/sdk/demo + doins demo/demo_proc_ic.mk + doins demo/procdemo.pc + + # Install into rdbms/public, as this is the + # real directory, see SDK part. + insinto "/${oracle_home}"/rdbms/public + doins include/*.h + + # proc. procob and rtsora are skipped, as we do not support + # COBOL right now (FIXME!) + dobin proc + dosym "/${oracle_home}"/bin/proc /usr/bin/proc + + cd "${S}" || die + + # COBOL interface is not installed + #insinto "/${oracle_home}" + #doins cobsqlintf.o + fi + if use sqlplus; then insinto "/${oracle_home}"/sqlplus/admin doins glogin.sql @@ -301,4 +354,19 @@ elog "to point to your user specific configuration." ewarn "Please re-source your shell settings for ORACLE_HOME" ewarn " changes, such as: source /etc/profile" + if use precomp; then + ewarn "" + ewarn "The proc precompiler uses the system library headers, which in" + ewarn "turn include the headers of the used compiler." + ewarn "To make proc work, please add the compiler header path of your" + ewarn "preferred compiler to sys_include in:" + ewarn " ${EROOT}etc/oracle/pcscfg.cfg" + ewarn "Remember to update this setting when you switch or update the" + ewarn "compiler." + ewarn "For gcc, the headers are usually found in a path matching the" + ewarn "following pattern:" + ewarn " ${EROOT}usr/lib/gcc/*/*/include" + ewarn "The exact details depend on the architecture and the version of" + ewarn "the compiler to be used." + fi }