j2se.spec 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. ##
  2. ## j2se.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2002 Ralf S. Engelschall <rse@engelschall.com>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package versions
  25. %define V_openpkg 1.3.1
  26. %define V_sol_dist 1_3_1_06
  27. %define V_sol_fsys 1.3.1_06
  28. %define V_lnx_dist 1_3_1_06
  29. %define V_lnx_fsys 1.3.1_06
  30. %define V_bsd_dist 1.3.1p7_1
  31. %define V_bsd_fsys 1.3.1
  32. # package options
  33. %ifndef with_native
  34. %define with_native yes
  35. %endif
  36. # package information
  37. Name: j2se
  38. Summary: Java 2 Platform, Standard Edition (J2SE) 1.3
  39. URL: http://java.sun.com/j2se/
  40. Vendor: Sun Microsystems, Inc.
  41. Packager: The OpenPKG Project
  42. Distribution: OpenPKG [PRIV]
  43. Group: Language
  44. License: Commercial
  45. Version: %{V_openpkg}
  46. Release: 20021110
  47. # list of sources
  48. Source0: j2sdk-%{V_sol_dist}-solaris-sparc.sh
  49. Source1: j2sdk-%{V_lnx_dist}-linux-i586.bin
  50. Source2: j2sdk-%{V_bsd_dist}-freebsd-ix86.tar.bz2
  51. Source3: rc.%{name}
  52. Source4: %{name}.patch
  53. # build information
  54. Prefix: %{l_prefix}
  55. BuildRoot: %{l_buildroot}
  56. BuildPreReq: OpenPKG, openpkg >= 20020714
  57. PreReq: OpenPKG, openpkg >= 20020714
  58. AutoReq: no
  59. AutoReqProv: no
  60. Provides: JDK, JRE
  61. %description
  62. This is the Sun Java 2 Platform, Standard Edition (J2SE) 1.3.
  63. It contains the Java Development Kit (JDK) and the Java Runtime
  64. Environment (JRE). The premier solution for rapidly developing
  65. and deploying mission-critical, enterprise applications, J2SE
  66. provides the essential compiler, tools, runtimes, and APIs for
  67. writing, deploying, and running applets and applications in the
  68. Java programming language.
  69. %prep
  70. %setup -q -c %{name} -T
  71. %build
  72. # no-op
  73. %install
  74. rm -rf $RPM_BUILD_ROOT
  75. # create installation tree
  76. %{l_shtool} mkdir -f -p -m 755 \
  77. $RPM_BUILD_ROOT%{l_prefix}/bin \
  78. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  79. $RPM_BUILD_ROOT%{l_prefix}/libexec \
  80. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  81. # unpack source distribution
  82. ( umask 022
  83. cd $RPM_BUILD_ROOT%{l_prefix}/libexec
  84. case "%{l_target}" in
  85. ix86-freebsd4* )
  86. %if "%{with_native}" == "yes"
  87. %{l_bzip2} -d -c %{SOURCE j2sdk-%{V_bsd_dist}-freebsd-ix86.tar.bz2} |\
  88. %{l_tar} xf -
  89. mv j2sdk-%{V_bsd_fsys} %{name}
  90. %else
  91. echo "yes" | sh %{SOURCE j2sdk-%{V_lnx_dist}-linux-i586.bin} >/dev/null
  92. mv jdk%{V_lnx_fsys} %{name}
  93. find %{name}/bin -type f -print | xargs chmod u+w
  94. ( cd %{name}; %{l_patch} -p0 <%{SOURCE %{name}.patch} )
  95. brandelf -t Linux \
  96. `find %{name}/bin/ -type f -print` \
  97. >/dev/null 2>&1 || true
  98. %endif
  99. ;;
  100. ix86-linux2.[2-6]* )
  101. echo "yes" | sh $RPM_SOURCE_DIR/j2sdk-%{V_lnx_dist}-linux-i586.bin >/dev/null
  102. mv jdk%{V_lnx_fsys} %{name}
  103. ;;
  104. sparc64-solaris2.[6-9]* )
  105. echo "yes" | sh $RPM_SOURCE_DIR/j2sdk-%{V_sol_dist}-solaris-sparc.sh >/dev/null
  106. mv j2sdk%{V_sol_fsys} %{name}
  107. ;;
  108. * )
  109. echo "Sorry, unsupported architecture '%{l_target}'" 1>&2
  110. exit 1
  111. ;;
  112. esac
  113. )
  114. # post-adjustments to installation area
  115. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/%{name}/demo 2>/dev/null || true
  116. cp $RPM_BUILD_ROOT%{l_prefix}/libexec/%{name}/man/man1/* \
  117. $RPM_BUILD_ROOT%{l_prefix}/man/man1/
  118. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/%{name}/man 2>/dev/null || true
  119. # activate binaries
  120. ( cd $RPM_BUILD_ROOT%{l_prefix}/bin
  121. for bin in appletviewer awt_robot extcheck idlj jar jarsigner java \
  122. javac javadoc javah javap jdb keytool native2ascii \
  123. oldjava oldjavac oldjdb policytool rmic rmid rmiregistry \
  124. serialver tnameserv; do
  125. ln -s ../libexec/%{name}/bin/$bin .
  126. done
  127. ( echo "#!/bin/sh"
  128. echo "exec %{l_prefix}/libexec/%{name}/bin/realpath \${1+\"\$@\"}"
  129. ) >realpath
  130. chmod 755 realpath
  131. )
  132. # install run-command script
  133. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  134. %{SOURCE rc.%{name}} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  135. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  136. %files -f files
  137. %clean
  138. rm -rf $RPM_BUILD_ROOT