j2se.spec 5.5 KB

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