oracle-barebone.spec 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. ##
  2. ## oracle-barebone.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package version
  26. %define V_major 9.2.0
  27. %define V_minor_lnx 4
  28. %define V_minor_sol 1
  29. # package information
  30. Name: oracle-barebone
  31. Summary: Oracle Barebone Distribution
  32. URL: -
  33. Vendor: The OpenPKG Project
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG
  36. Class: PRIV
  37. Group: Database
  38. License: Commercial
  39. Version: %{V_major}
  40. Release: 20040818
  41. # list of sources
  42. Source0: http://www.oracle.com/::/oracle-barebone-%{V_major}.%{V_minor_lnx}.ix86-linux.cpio.bz2
  43. Source1: http://www.oracle.com/::/oracle-barebone-%{V_major}.%{V_minor_sol}.sun4u-sunos5.8.cpio.bz2
  44. Source2: http://www.oracle.com/::/oracle-barebone-%{V_major}.%{V_minor_sol}.sun4u-sunos5.9.cpio.bz2
  45. Source3: oracle-barebone.txt
  46. Source4: oracle-barebone.pl
  47. %NoSource 0
  48. %NoSource 1
  49. %NoSource 2
  50. # build information
  51. Prefix: %{l_prefix}
  52. BuildRoot: %{l_buildroot}
  53. BuildPreReq: OpenPKG, openpkg >= 20040130
  54. PreReq: OpenPKG, openpkg >= 20040130
  55. AutoReq: no
  56. AutoReqProv: no
  57. %description
  58. This is the Oracle Barebone distribution, containing the Oracle 9i
  59. %{V_major}.X Client C API. It is a stripped down installation file
  60. set of a standard Oracle 9i Client Run-Time installation.
  61. %track
  62. prog oracle-barebone = {
  63. disabled
  64. comment = "rse: commercial package, no download URL"
  65. version = 0
  66. url = ftp://ftp.openpkg.org/
  67. regex = .*
  68. }
  69. %prep
  70. %setup -T -D -c
  71. %build
  72. %install
  73. # create installation area
  74. rm -rf $RPM_BUILD_ROOT
  75. %{l_shtool} mkdir -f -p -m 755 \
  76. $RPM_BUILD_ROOT%{l_prefix}/libexec/oracle-barebone
  77. # unpack barebone distribution
  78. # (rpmlint workaround: %{SOURCE3} %{SOURCE4})
  79. ( cd $RPM_BUILD_ROOT%{l_prefix}/libexec/oracle-barebone
  80. case "%{l_platform -t}" in
  81. i?86*-linux* ) cpio="%{SOURCE0}" ;;
  82. sun4*-sunos5.8* ) cpio="%{SOURCE1}" ;;
  83. sun4*-sunos5.9* ) cpio="%{SOURCE2}" ;;
  84. * ) echo "Platform \"%{l_platform -t}\" not supported" 1>&2; exit 1 ;;
  85. esac
  86. # unpack with vendor cpio(1)
  87. %{l_bzip2} -d -c $cpio | cpio -idmu
  88. ) || exit $?
  89. # fake unix.rgs file (some users like DBD::Oracle use it
  90. # to figure out the Oracle version number
  91. %{l_shtool} mkdir -f -p -m 755 \
  92. $RPM_BUILD_ROOT%{l_prefix}/libexec/oracle-barebone/install
  93. echo "rdbms %{version}" \
  94. >$RPM_BUILD_ROOT%{l_prefix}/libexec/oracle-barebone/install/unix.rgs
  95. # provide SQL*Plus environment
  96. %{l_shtool} mkdir -f -p -m 755 \
  97. $RPM_BUILD_ROOT%{l_prefix}/bin \
  98. $RPM_BUILD_ROOT%{l_prefix}/etc/oracle-barebone
  99. if [ ! -f $RPM_BUILD_ROOT%{l_prefix}/libexec/oracle-barebone/network/admin/sqlnet.ora ]; then
  100. mv $RPM_BUILD_ROOT%{l_prefix}/libexec/oracle-barebone/network/admin/samples/sqlnet.ora \
  101. $RPM_BUILD_ROOT%{l_prefix}/libexec/oracle-barebone/network/admin/
  102. fi
  103. if [ ! -f $RPM_BUILD_ROOT%{l_prefix}/libexec/oracle-barebone/network/admin/tnsnames.ora ]; then
  104. mv $RPM_BUILD_ROOT%{l_prefix}/libexec/oracle-barebone/network/admin/samples/tnsnames.ora \
  105. $RPM_BUILD_ROOT%{l_prefix}/libexec/oracle-barebone/network/admin/
  106. fi
  107. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/oracle-barebone/network/admin/samples
  108. %{l_shtool} mkln -s \
  109. $RPM_BUILD_ROOT%{l_prefix}/libexec/oracle-barebone/network/admin/*.ora \
  110. $RPM_BUILD_ROOT%{l_prefix}/etc/oracle-barebone/
  111. for bin in sqlplus tnsping; do
  112. ( echo "#!/bin/sh"
  113. echo "ORACLE_HOME=\"%{l_prefix}/libexec/oracle-barebone\""
  114. echo "export ORACLE_HOME"
  115. echo "LD_LIBRARY_PATH=\"%{l_prefix}/libexec/oracle-barebone/lib:/usr/lib\""
  116. echo "export LD_LIBRARY_PATH"
  117. echo "exec %{l_prefix}/libexec/oracle-barebone/bin/$bin \${1+\"\$@\"}"
  118. ) >$bin
  119. %{l_shtool} install -c -m 755 \
  120. $bin $RPM_BUILD_ROOT%{l_prefix}/bin/$bin
  121. done
  122. # FIXME: cs: fixup permissions caused by bug in
  123. # %{SOURCE oracle-barebone.pl} (fixed in the same commit) this
  124. # chmod(1) is just a quick hack to avoid re-rolling all Oracle
  125. # stuff from vendor cpios. This hack can be removed next time
  126. # when %{SOURCE oracle-barebone.pl} is run.
  127. chmod 755 $RPM_BUILD_ROOT%{l_prefix}/libexec/oracle-barebone/network
  128. # determine installation files
  129. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  130. %{l_files_std} \
  131. '%config %{l_prefix}/libexec/oracle-barebone/network/admin/sqlnet.ora' \
  132. '%config %{l_prefix}/libexec/oracle-barebone/network/admin/tnsnames.ora'
  133. %files -f files
  134. %clean
  135. rm -rf $RPM_BUILD_ROOT