j2se.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. ##
  2. ## j2se.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.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 versions
  26. %define V_openpkg 1.3.1
  27. %define V_sol_dist 1_3_1_06
  28. %define V_sol_fsys 1_3_1_06
  29. %define V_lnx_dist 1_3_1_06
  30. %define V_lnx_fsys 1.3.1_06
  31. %define V_bsd_dist 1.3.1p7_1
  32. %define V_bsd_fsys 1.3.1
  33. # package information
  34. Name: j2se
  35. Summary: Java 2 Platform, Standard Edition (J2SE) 1.3
  36. URL: http://java.sun.com/j2se/
  37. Vendor: Sun Microsystems, Inc.
  38. Packager: The OpenPKG Project
  39. Distribution: OpenPKG [EVAL]
  40. Group: Language
  41. License: Commercial
  42. Version: %{V_openpkg}
  43. Release: 20030404
  44. # package options
  45. %option with_native yes
  46. # list of sources
  47. Source0: http://java.sun.com/j2se/::/j2sdk-%{V_sol_dist}-solaris-sparc.sh
  48. Source1: http://java.sun.com/j2se/::/j2sdk-%{V_lnx_dist}-linux-i586.bin
  49. Source2: http://java.sun.com/j2se/::/j2sdk-%{V_bsd_dist}-freebsd-ix86.tar.bz2
  50. Source3: rc.%{name}
  51. Source4: %{name}.patch
  52. %NoSource 0
  53. %NoSource 1
  54. %NoSource 2
  55. # build information
  56. Prefix: %{l_prefix}
  57. BuildRoot: %{l_buildroot}
  58. BuildPreReq: OpenPKG, openpkg >= 20030108
  59. PreReq: OpenPKG, openpkg >= 20030108
  60. AutoReq: no
  61. AutoReqProv: no
  62. Provides: JDK, JRE
  63. Conflicts: j2se14
  64. %description
  65. This is the Sun Java 2 Platform, Standard Edition (J2SE) 1.3.
  66. It contains the Java Development Kit (JDK) and the Java Runtime
  67. Environment (JRE). The premier solution for rapidly developing
  68. and deploying mission-critical, enterprise applications, J2SE
  69. provides the essential compiler, tools, runtimes, and APIs for
  70. writing, deploying, and running applets and applications in the
  71. Java programming language.
  72. %prep
  73. %integrity
  74. %setup -q -c %{name} -T
  75. %build
  76. # no-op
  77. %install
  78. rm -rf $RPM_BUILD_ROOT
  79. # create installation tree
  80. %{l_shtool} mkdir -f -p -m 755 \
  81. $RPM_BUILD_ROOT%{l_prefix}/bin \
  82. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  83. $RPM_BUILD_ROOT%{l_prefix}/libexec \
  84. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  85. # unpack source distribution
  86. ( umask 022
  87. cd $RPM_BUILD_ROOT%{l_prefix}/libexec
  88. case "%{l_target}" in
  89. ix86-freebsd[45]* )
  90. %if "%{with_native}" == "yes"
  91. %{l_bzip2} -d -c %{SOURCE j2sdk-%{V_bsd_dist}-freebsd-ix86.tar.bz2} |\
  92. %{l_tar} xf -
  93. mv j2sdk-%{V_bsd_fsys} %{name}
  94. %else
  95. echo "yes" | sh %{SOURCE j2sdk-%{V_lnx_dist}-linux-i586.bin} >/dev/null
  96. mv jdk%{V_lnx_fsys} %{name}
  97. find %{name}/bin -type f -print | xargs chmod u+w
  98. ( cd %{name}; %{l_patch} -p0 <%{SOURCE %{name}.patch} )
  99. brandelf -t Linux \
  100. `find %{name}/bin/ -type f -print` \
  101. >/dev/null 2>&1 || true
  102. %endif
  103. ;;
  104. ix86-linux2.[2-6]* )
  105. echo "yes" | sh $RPM_SOURCE_DIR/j2sdk-%{V_lnx_dist}-linux-i586.bin >/dev/null
  106. mv jdk%{V_lnx_fsys} %{name}
  107. ;;
  108. sparc64-solaris2.[6-9]* )
  109. echo "yes" | sh $RPM_SOURCE_DIR/j2sdk-%{V_sol_dist}-solaris-sparc.sh >/dev/null
  110. mv j2sdk%{V_sol_fsys} %{name}
  111. ;;
  112. * )
  113. echo "Sorry, unsupported architecture '%{l_target}'" |\
  114. %{l_rpmtool} msg -b -t error 1>&2
  115. exit 1
  116. ;;
  117. esac
  118. )
  119. # post-adjustments to installation area
  120. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/%{name}/demo 2>/dev/null || true
  121. cp $RPM_BUILD_ROOT%{l_prefix}/libexec/%{name}/man/man1/* \
  122. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  123. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/%{name}/man 2>/dev/null || true
  124. # activate binaries
  125. ( cd $RPM_BUILD_ROOT%{l_prefix}/bin
  126. for bin in appletviewer awt_robot extcheck idlj jar jarsigner java \
  127. javac javadoc javah javap jdb keytool native2ascii \
  128. oldjava oldjavac oldjdb policytool rmic rmid rmiregistry \
  129. serialver tnameserv; do
  130. ln -s ../libexec/%{name}/bin/$bin .
  131. done
  132. ( echo "#!/bin/sh"
  133. echo "exec %{l_prefix}/libexec/%{name}/bin/realpath \${1+\"\$@\"}"
  134. ) >realpath
  135. chmod 755 realpath
  136. )
  137. # install run-command script
  138. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  139. %{SOURCE rc.%{name}} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  140. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  141. %files -f files
  142. %clean
  143. rm -rf $RPM_BUILD_ROOT