Selaa lähdekoodia

add SQL*Plus command-line client

Ralf S. Engelschall 22 vuotta sitten
vanhempi
commit
835481e123
2 muutettua tiedostoa jossa 31 lisäystä ja 4 poistoa
  1. 4 0
      oracle-barebone/oracle-barebone.pl
  2. 27 4
      oracle-barebone/oracle-barebone.spec

+ 4 - 0
oracle-barebone/oracle-barebone.pl

@@ -17,6 +17,10 @@ my @list = (qw(
     network
     ocommon/
     !ocommon/nls/lbuilder/jlib/
+    bin/sqlplus
+    sqlplus/
+    oracore/zoneinfo/
+    network/admin/samples/
 ));
 
 #   determine effective file list

+ 27 - 4
oracle-barebone/oracle-barebone.spec

@@ -33,7 +33,7 @@ Distribution: OpenPKG [PRIV]
 Group:        Database
 License:      Commercial
 Version:      9.2.0.1
-Release:      20031230
+Release:      20040105
 
 #   list of sources
 Source0:      http://www.oracle.com/::/oracle-barebone-%{version}.ix86-linux.cpio.bz2
@@ -46,7 +46,7 @@ Source3:      oracle-barebone.pl
 #   build information
 Prefix:       %{l_prefix}
 BuildRoot:    %{l_buildroot}
-BuildPreReq:  OpenPKG, openpkg >= 20030908, cpio
+BuildPreReq:  OpenPKG, openpkg >= 20030908
 PreReq:       OpenPKG, openpkg >= 20030908
 AutoReq:      no
 AutoReqProv:  no
@@ -75,7 +75,8 @@ AutoReqProv:  no
           sun4*-sunos5* ) cpio="%{SOURCE1}" ;;
           * ) echo "Platform \"%{l_platform -t}\" not supported" 1>&2; exit 1 ;;
       esac
-      %{l_bzip2} -d -c $cpio | %{l_prefix}/bin/cpio -idmu
+      #   unpack with vendor cpio(1)
+      %{l_bzip2} -d -c $cpio | cpio -idmu
     ) || exit $?
 
     #   fake unix.rgs file (some users like DBD::Oracle use it
@@ -85,8 +86,30 @@ AutoReqProv:  no
     echo "rdbms %{version}" \
         >$RPM_BUILD_ROOT%{l_prefix}/share/oracle-barebone/install/unix.rgs
 
+    #   provide SQL*Plus environment
+    %{l_shtool} mkdir -f -p -m 755 \
+        $RPM_BUILD_ROOT%{l_prefix}/bin \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/oracle-barebone
+    mv  $RPM_BUILD_ROOT%{l_prefix}/share/oracle-barebone/network/admin/samples/*.ora \
+        $RPM_BUILD_ROOT%{l_prefix}/share/oracle-barebone/network/admin/
+    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/oracle-barebone/network/admin/samples
+    %{l_shtool} mkln -s \
+        $RPM_BUILD_ROOT%{l_prefix}/share/oracle-barebone/network/admin/*.ora \
+        $RPM_BUILD_ROOT%{l_prefix}/etc/oracle-barebone/
+    ( echo "#!/bin/sh"
+      echo "ORACLE_HOME=\"%{l_prefix}/share/oracle-barebone\""
+      echo "export ORACLE_HOME"
+      echo "LD_LIBRARY_PATH=\"%{l_prefix}/share/oracle-barebone/lib:/usr/lib\""
+      echo "export LD_LIBRARY_PATH"
+      echo "exec %{l_prefix}/share/oracle-barebone/bin/sqlplus \${1+\"\$@\"}"
+    ) >sqlplus
+    %{l_shtool} install -c -m 755 \
+        sqlplus $RPM_BUILD_ROOT%{l_prefix}/bin/
+
     #   determine installation files
-    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
+    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
+        %{l_files_std} \
+        '%config %{l_prefix}/etc/oracle-barebone/*'
 
 %files -f files