1 |
|
### RPM external oracle 10.2.0.3 |
2 |
|
## INITENV SET ORACLE_HOME %i |
3 |
+ |
## BUILDIF case `uname`:`uname -p` in Linux:i*86 ) true ;; Linux:x86_64 ) true ;; Linux:ppc64 ) false ;; Darwin:* ) false ;; * ) false ;; esac |
4 |
|
|
5 |
< |
# TODO: actually there is an instantclient for OSX now... we could make it deployable |
6 |
< |
Provides: libgcc_s.so.1()(64bit) |
7 |
< |
Provides: libgcc_s.so.1(GCC_3.0)(64bit) |
7 |
< |
%if "%(echo %cmsplatf | cut -b 1,2,3 )" == "osx" |
8 |
< |
Source0: none |
9 |
< |
%else |
10 |
< |
Source0: http://cmsrep.cern.ch/cmssw/oracle-mirror/%cmsos/%realversion/basic-%cmsos.zip |
11 |
< |
Source1: http://cmsrep.cern.ch/cmssw/oracle-mirror/%cmsos/%realversion/sdk-%cmsos.zip |
12 |
< |
Source2: http://cmsrep.cern.ch/cmssw/oracle-mirror/%cmsos/%realversion/sqlplus-%cmsos.zip |
13 |
< |
Source3: none |
14 |
< |
Source4: none |
15 |
< |
Source5: none |
5 |
> |
Source0: http://cmsrep.cern.ch/cmssw/oracle-mirror/%cmsos/%realversion/basic.zip?arch=%cmsos&version=%realversion |
6 |
> |
Source1: http://cmsrep.cern.ch/cmssw/oracle-mirror/%cmsos/%realversion/sdk.zip?arch=%cmsos&version=%realversion |
7 |
> |
Source2: http://cmsrep.cern.ch/cmssw/oracle-mirror/%cmsos/%realversion/sqlplus.zip?arch=%cmsos&version=%realversion |
8 |
|
Source9: oracle-license |
9 |
|
Source10: http://www.oracle.com/technology/tech/oci/occi/downloads/occi_gcc343_102020.tar.gz |
18 |
– |
%if "%{cmsos}" == "slc4_ia32" |
19 |
– |
Source3: http://cmsrep.cern.ch/cmssw/oracle-mirror/slc4_amd64/%realversion/basic-slc4_amd64.zip |
20 |
– |
Source4: http://cmsrep.cern.ch/cmssw/oracle-mirror/slc4_amd64/%realversion/sdk-slc4_amd64.zip |
21 |
– |
Source5: http://cmsrep.cern.ch/cmssw/oracle-mirror/slc4_amd64/%realversion/sqlplus-slc4_amd64.zip |
22 |
– |
%endif |
23 |
– |
%endif |
10 |
|
|
11 |
|
## INITENV +PATH SQLPATH %i/bin |
12 |
|
%prep |
13 |
< |
case %cmsos in |
14 |
< |
osx* ) |
29 |
< |
;; |
30 |
< |
slc4_ia32 ) |
31 |
< |
rm -rf instantclient_* |
32 |
< |
rm -rf libocci.so.10.1 libocci10.a |
33 |
< |
unzip -o -u %_sourcedir/basic-%cmsos.zip |
34 |
< |
unzip -o -u %_sourcedir/sdk-%cmsos.zip |
35 |
< |
unzip -o -u %_sourcedir/sqlplus-%cmsos.zip |
36 |
< |
rm -rf oracle64; mkdir oracle64 |
37 |
< |
cd oracle64 |
38 |
< |
unzip -o -u %_sourcedir/basic-slc4_amd64.zip |
39 |
< |
unzip -o -u %_sourcedir/sdk-slc4_amd64.zip |
40 |
< |
unzip -o -u %_sourcedir/sqlplus-slc4_amd64.zip |
41 |
< |
cd .. |
42 |
< |
;; |
43 |
< |
* ) |
44 |
< |
rm -rf instantclient_* |
45 |
< |
rm -rf libocci.so.10.1 libocci10.a |
46 |
< |
unzip -o -u %_sourcedir/basic-%cmsos.zip |
47 |
< |
unzip -o -u %_sourcedir/sdk-%cmsos.zip |
48 |
< |
unzip -o -u %_sourcedir/sqlplus-%cmsos.zip |
49 |
< |
;; |
50 |
< |
esac |
13 |
> |
rm -rf instantclient_* |
14 |
> |
rm -rf libocci.so.10.1 libocci10.a |
15 |
|
|
16 |
+ |
unzip -o -u "%_sourcedir/basic.zip?arch=%cmsos&version=%realversion" |
17 |
+ |
unzip -o -u "%_sourcedir/sdk.zip?arch=%cmsos&version=%realversion" |
18 |
+ |
unzip -o -u "%_sourcedir/sqlplus.zip?arch=%cmsos&version=%realversion" |
19 |
|
%if "%{realversion}" == "10.2.0.3" |
20 |
|
case %cmsos in |
21 |
|
slc4_ia32 ) |
22 |
|
tar xzvf %_sourcedir/occi_gcc343_102020.tar.gz |
56 |
– |
cd oracle64 |
57 |
– |
tar xzvf %_sourcedir/occi_gcc343_102020.tar.gz |
23 |
|
;; |
24 |
|
esac |
25 |
|
%endif |
26 |
|
|
27 |
|
%build |
28 |
|
%install |
29 |
< |
mkdir -p %i/bin %i/etc/profile.d %i/lib %i/admin %i/java %i/demo %i/include |
29 |
> |
mkdir -p %i/bin %i/etc %i/lib %i/admin %i/java %i/demo %i/include |
30 |
|
cp %_sourcedir/oracle-license %{i}/oracle-license |
31 |
|
cp -p instantclient*/lib* %i/lib |
32 |
|
cp -p instantclient*/sqlplus %i/bin |
38 |
|
echo Copying libocci libraries for slc4_ia32_gcc345 |
39 |
|
[ -f libocci.so.10.1 ] && mv libocci.so.10.1 %i/lib |
40 |
|
[ -f libocci10.a ] && mv libocci10.a %i/lib |
76 |
– |
mkdir %i/oracle64 |
77 |
– |
mkdir -p %i/oracle64/bin %i/oracle64/lib %i/oracle64/admin %i/oracle64/java %i/oracle64/demo %i/oracle64/include |
78 |
– |
cp -p oracle64/instantclient*/lib* %i/oracle64/lib |
79 |
– |
cp -p oracle64/instantclient*/sqlplus %i/oracle64/bin |
80 |
– |
cp -p oracle64/instantclient*/glogin.sql %i/oracle64/bin |
81 |
– |
cp -p oracle64/instantclient*/*.jar %i/oracle64/java |
82 |
– |
cp -p oracle64/instantclient*/sdk/demo/* %i/oracle64/demo |
83 |
– |
cp -p oracle64/instantclient*/sdk/include/* %i/oracle64/include |
84 |
– |
(cd %i/oracle64/lib && ln -s libclntsh.* $(echo libclntsh.* | sed 's/[0-9.]*$//')) |
85 |
– |
(cd %i/oracle64/lib && ln -s libocci.* $(echo libocci.* | sed 's/[0-9.]*$//')) |
86 |
– |
cat << \EOF_SLC4_64BIT_ENV_SCRIPT_SH >%i/etc/profile.d/init64.sh |
87 |
– |
#!/bin/sh |
88 |
– |
bostype=`uname`:`uname -p` |
89 |
– |
case $bostype in |
90 |
– |
Linux:i*86 ) |
91 |
– |
if ldd /usr/bin/gcc | grep -q /lib64/ ; then |
92 |
– |
bostype=Linux:x86_64 |
93 |
– |
fi |
94 |
– |
;; |
95 |
– |
esac |
96 |
– |
case $bostype in |
97 |
– |
Linux:x86_64 ) |
98 |
– |
PATH="%i/oracle64/bin:$PATH"; export PATH |
99 |
– |
LD_LIBRARY_PATH="%i/oracle64/lib:$LD_LIBRARY_PATH"; export LD_LIBRARY_PATH |
100 |
– |
DYLD_FALLBACK_LIBRARY_PATH="%i/oracle64/lib:$DYLD_FALLBACK_LIBRARY_PATH"; export DYLD_FALLBACK_LIBRARY_PATH |
101 |
– |
SQLPATH="%i/oracle64/bin:$SQLPATH"; export SQLPATH |
102 |
– |
;; |
103 |
– |
esac |
104 |
– |
EOF_SLC4_64BIT_ENV_SCRIPT_SH |
105 |
– |
cat << \EOF_SLC4_64BIT_ENV_SCRIPT_CSH >%i/etc/profile.d/init64.csh |
106 |
– |
#!/bin/csh |
107 |
– |
set bostype=`uname`:`uname -p` |
108 |
– |
switch ($bostype) |
109 |
– |
case Linux:i*86: |
110 |
– |
ldd /usr/bin/gcc | grep -q /lib64/ |
111 |
– |
if ("X$?" == "X0") set bostype=Linux:x86_64 |
112 |
– |
breaksw |
113 |
– |
endsw |
114 |
– |
switch ($bostype) |
115 |
– |
case Linux:x86_64: |
116 |
– |
setenv PATH "%i/oracle64/bin:$PATH" |
117 |
– |
setenv LD_LIBRARY_PATH "%i/oracle64/lib:$LD_LIBRARY_PATH" |
118 |
– |
setenv DYLD_FALLBACK_LIBRARY_PATH "%i/oracle64/lib:$DYLD_FALLBACK_LIBRARY_PATH" |
119 |
– |
setenv SQLPATH "%i/oracle64/bin:$SQLPATH" |
120 |
– |
breaksw |
121 |
– |
endsw |
122 |
– |
EOF_SLC4_64BIT_ENV_SCRIPT_CSH |
41 |
|
%endif |
42 |
|
(cd %i/lib && ln -s libclntsh.* $(echo libclntsh.* | sed 's/[0-9.]*$//')) |
43 |
|
(cd %i/lib && ln -s libocci.* $(echo libocci.* | sed 's/[0-9.]*$//')) |
44 |
|
chmod -R g-w %i |
127 |
– |
touch %i/etc/profile.d/init64.sh |
128 |
– |
touch %i/etc/profile.d/init64.csh |
45 |
|
|
46 |
|
# SCRAM ToolBox toolfile |
47 |
|
mkdir -p %i/etc/scram.d |
48 |
< |
cat << \EOF_TOOLFILE >%i/etc/scram.d/%n |
48 |
> |
# oracle-client toolfile (w/o libocci) |
49 |
> |
cat << \EOF_TOOLFILE >%i/etc/scram.d/oracleclient |
50 |
|
<doc type=BuildSystem::ToolDoc version=1.0> |
51 |
< |
<Tool name=%n version=%v> |
51 |
> |
<Tool name=oracleclient version=%v> |
52 |
|
<lib name=clntsh> |
136 |
– |
<lib name=occi> |
53 |
|
<lib name=nnz10> |
54 |
|
<Client> |
55 |
|
<Environment name=ORACLE_BASE default="%i"></Environment> |
67 |
|
<Runtime name=TNS_ADMIN default="$ORACLE_ADMINDIR"> |
68 |
|
</Tool> |
69 |
|
EOF_TOOLFILE |
70 |
+ |
|
71 |
+ |
# oracle toolfile (oracleclient + libocci) |
72 |
+ |
cat << \EOF_TOOLFILE >%i/etc/scram.d/%n |
73 |
+ |
<doc type=BuildSystem::ToolDoc version=1.0> |
74 |
+ |
<Tool name=%n version=%v> |
75 |
+ |
<lib name=occi> |
76 |
+ |
<use name=oracleclient> |
77 |
+ |
</Tool> |
78 |
+ |
EOF_TOOLFILE |
79 |
|
%post |
155 |
– |
echo ". $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init64.sh" >> $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.sh |
156 |
– |
echo "source $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init64.csh" >> $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.csh |
80 |
|
%{relocateConfig}etc/scram.d/%n |
158 |
– |
%{relocateConfig}etc/profile.d/init64.sh |
159 |
– |
%{relocateConfig}etc/profile.d/init64.csh |