oracle-instantclient

Oracle-instantclient provides the following libraries, required by perl-DBD-Oracle: Please note that oracle-instantclient is not part of the SUSE Linux distribution, but can be downloaded free of charge from http://www.oracle.com/technology/tech/oci/instantclient/index.html

For inhouse tests, we drafted the following oracle-instantclient.spec :




#
# spec file for package oracle-instantclient (Version 10.2.0.2)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

Name:           oracle-instantclient
%define		fix_rpath 1
%if %fix_rpath
BuildRequires:  chrpath unzip
%else
BuildRequires:  unzip
%endif
Summary:        Client-libraries for Oracle Databases
Version:        10.2.0.2
Release:        3
License:        Other License(s), see package
Group:          Productivity/Databases/Clients
%ifarch %ix86
%define bin_vers linux32-%{version}-20060331
%endif
%ifarch x86_64
%define bin_vers linux-x86-64-%{version}-20060228
%endif
Source0:        instantclient-basiclite-%{bin_vers}.zip
Source1:        instantclient-sdk-%{bin_vers}.zip
Source2:        Export.txt
Source3:        OTN-License.txt
NoSource:       0
NoSource:       1
NoSource:       2
NoSource:       3
URL:            http://www.oracle.com/technology/tech/oci/instantclient/index.html
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       compat-libstdc++
ExclusiveArch:	%ix86 x86_64

%description
Instant Client allows you to run your applications without installing
the standard Oracle client or having an ORACLE_HOME. OCI, OCCI, Pro*C,
ODBC, and JDBC applications work without modification, while using
significantly less disk space than before. Even SQL*Plus can be used
with Instant Client. No recompile, no hassle.

ISVs and Partners benefit greatly from packaging Instant Client along
with their applications, saving customers the extra step of installing
and configuring an Oracle client. Free. The same fully-featured,
high-performance applications that Oracle ISVs and partners have always
delivered will continue to work, untouched.



Authors:
--------
    oracle.com

%define prefix /opt/oracle
%prep
# empty

%build
cp %{S:2} %{S:3} .

%install
mkdir -p           $RPM_BUILD_ROOT/%{prefix}
unzip -q %{S:0} -d $RPM_BUILD_ROOT/%{prefix}
unzip -q %{S:1} -d $RPM_BUILD_ROOT/%{prefix}
# /bin/mv            $RPM_BUILD_ROOT/%{prefix}/instantclient* $RPM_BUILD_ROOT/%{prefix}/%{name}
%if %fix_rpath
test -x /usr/bin/chrpath || exit 1;
# use a subshell to suppress errors from bad exit codes.
( find $RPM_BUILD_ROOT -type f -name \*.so\* | xargs -n 1 chrpath --replace '%{prefix}/lib' )
%endif
find $RPM_BUILD_ROOT -type f | xargs chmod 644
find $RPM_BUILD_ROOT -type f -name \*.so\* | xargs chmod 755
# perl-DBD-Oracle tries to create these symlink and fails.  Argh. 
# better do it now, where it belongs.
(cd  $RPM_BUILD_ROOT/%{prefix}/instantclient* 
  ln -s libclntsh.so.10.1 libclntsh.so
  ln -s libocci.so.10.1 libocci.so
)
( cd $RPM_BUILD_ROOT/%{prefix}; mkdir lib; cd lib; ln -s ../instantclient*/*.so . )

%clean
rm -rf %buildroot

%files
%defattr(-,root,root,755)
%doc    Export.txt OTN-License.txt
%dir	%{prefix}
%{prefix}/*

%changelog -n oracle-instantclient
* Tue Jun 13 2006 - jw@suse.de
- added missing Requires: compat-libstdc++
* Fri Jun 02 2006 - jw@suse.de
- added missing *.so symlinks
  lib subdir must not be a symlink to keep brp-rpath happy.
* Fri Jun 02 2006 - jw@suse.de
- initial build. x86_64 and i386 only.
  Required by perl-DBD-Oracle