j2se.spec 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. %options
  71. %prep
  72. %setup -q -c %{name} -T
  73. %build
  74. # no-op
  75. %install
  76. rm -rf $RPM_BUILD_ROOT
  77. # create installation tree
  78. %{l_shtool} mkdir -f -p -m 755 \
  79. $RPM_BUILD_ROOT%{l_prefix}/bin \
  80. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  81. $RPM_BUILD_ROOT%{l_prefix}/libexec \
  82. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  83. # unpack source distribution
  84. ( umask 022
  85. cd $RPM_BUILD_ROOT%{l_prefix}/libexec
  86. case "%{l_target}" in
  87. ix86-freebsd4* )
  88. %if "%{with_native}" == "yes"
  89. %{l_bzip2} -d -c %{SOURCE j2sdk-%{V_bsd_dist}-freebsd-ix86.tar.bz2} |\
  90. %{l_tar} xf -
  91. mv j2sdk-%{V_bsd_fsys} %{name}
  92. %else
  93. echo "yes" | sh %{SOURCE j2sdk-%{V_lnx_dist}-linux-i586.bin} >/dev/null
  94. mv jdk%{V_lnx_fsys} %{name}
  95. find %{name}/bin -type f -print | xargs chmod u+w
  96. ( cd %{name}; %{l_patch} -p0 <%{SOURCE %{name}.patch} )
  97. brandelf -t Linux \
  98. `find %{name}/bin/ -type f -print` \
  99. >/dev/null 2>&1 || true
  100. %endif
  101. ;;
  102. ix86-linux2.[2-6]* )
  103. echo "yes" | sh $RPM_SOURCE_DIR/j2sdk-%{V_lnx_dist}-linux-i586.bin >/dev/null
  104. mv jdk%{V_lnx_fsys} %{name}
  105. ;;
  106. sparc64-solaris2.[6-9]* )
  107. echo "yes" | sh $RPM_SOURCE_DIR/j2sdk-%{V_sol_dist}-solaris-sparc.sh >/dev/null
  108. mv j2sdk%{V_sol_fsys} %{name}
  109. ;;
  110. * )
  111. echo "Sorry, unsupported architecture '%{l_target}'" 1>&2
  112. exit 1
  113. ;;
  114. esac
  115. )
  116. # post-adjustments to installation area
  117. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/%{name}/demo 2>/dev/null || true
  118. cp $RPM_BUILD_ROOT%{l_prefix}/libexec/%{name}/man/man1/* \
  119. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  120. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/%{name}/man 2>/dev/null || true
  121. # activate binaries
  122. ( cd $RPM_BUILD_ROOT%{l_prefix}/bin
  123. for bin in appletviewer awt_robot extcheck idlj jar jarsigner java \
  124. javac javadoc javah javap jdb keytool native2ascii \
  125. oldjava oldjavac oldjdb policytool rmic rmid rmiregistry \
  126. serialver tnameserv; do
  127. ln -s ../libexec/%{name}/bin/$bin .
  128. done
  129. ( echo "#!/bin/sh"
  130. echo "exec %{l_prefix}/libexec/%{name}/bin/realpath \${1+\"\$@\"}"
  131. ) >realpath
  132. chmod 755 realpath
  133. )
  134. # install run-command script
  135. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  136. %{SOURCE rc.%{name}} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  137. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  138. %files -f files
  139. %clean
  140. rm -rf $RPM_BUILD_ROOT