j2se14.spec 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. ##
  2. ## j2se14.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_sunjava 1_4_1_01
  27. %define V_filesys 1.4.1_01
  28. %define V_openpkg 1.4.1.01
  29. # package information
  30. Name: j2se14
  31. Summary: Java 2 Platform, Standard Edition (J2SE) 1.4
  32. URL: http://java.sun.com/j2se/
  33. Vendor: Sun Microsystems, Inc.
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG [PRIV]
  36. Group: Language
  37. License: Commercial
  38. Version: %{V_openpkg}
  39. Release: 20021110
  40. # list of sources
  41. Source0: j2sdk-%{V_sunjava}-linux-i586.bin
  42. Source1: j2sdk-%{V_sunjava}-solaris-sparc.sh
  43. Source2: j2sdk-%{V_sunjava}-solaris-sparcv9.sh
  44. Source3: rc.j2se14
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20020714
  49. PreReq: OpenPKG, openpkg >= 20020714
  50. AutoReq: no
  51. AutoReqProv: no
  52. Provides: JDK, JRE
  53. %description
  54. The premier solution for rapidly developing and deploying
  55. mission-critical, enterprise applications, J2SE provides the
  56. essential compiler, tools, runtimes, and APIs for writing,
  57. deploying, and running applets and applications in the Java
  58. programming language.
  59. %prep
  60. %setup -q -c j2se14 -T
  61. %build
  62. %install
  63. rm -rf $RPM_BUILD_ROOT
  64. # select vendor source
  65. pkgfile=""
  66. suppfile=""
  67. pkgdir=%{V_filesys}
  68. case "%{l_target}" in
  69. ix86-linux2.[2-5]* | ix86-freebsd4* )
  70. pkgfile="j2sdk-%{V_sunjava}-linux-i586.bin"
  71. pkgdir="j2sdk%{V_filesys}"
  72. ;;
  73. sparc64-solaris2.[6-9]*)
  74. pkgfile="j2sdk-%{V_sunjava}-solaris-sparc.sh"
  75. suppfile="j2sdk-%{V_sunjava}-solaris-sparcv9.sh"
  76. pkgdir="j2sdk%{V_filesys}"
  77. ;;
  78. esac
  79. if [ ".$pkgfile" = . ]; then
  80. echo "Sorry, unsupported architecture '%{l_target}'" 1>&2
  81. exit 1
  82. fi
  83. # create installation tree
  84. %{l_shtool} mkdir -f -p -m 755 \
  85. $RPM_BUILD_ROOT%{l_prefix}/bin \
  86. $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \
  87. $RPM_BUILD_ROOT%{l_prefix}/libexec \
  88. $RPM_BUILD_ROOT%{l_prefix}/man/man1 \
  89. $RPM_BUILD_ROOT%{l_prefix}/share/j2se14/doc
  90. # unpack vendor distribution
  91. ( umask 022
  92. cd $RPM_BUILD_ROOT%{l_prefix}/libexec
  93. case "%{l_target}" in
  94. ix86-linux2.[2-5]* | ix86-freebsd4* )
  95. echo "yes" | sh $RPM_SOURCE_DIR/$pkgfile \
  96. >$RPM_BUILD_ROOT%{l_prefix}/share/j2se14/doc/COPYING.32
  97. ;;
  98. sparc64-solaris2.[6-9]*)
  99. echo "yes" | sh $RPM_SOURCE_DIR/$pkgfile \
  100. >$RPM_BUILD_ROOT%{l_prefix}/share/j2se14/doc/COPYING.32
  101. echo "yes" | sh $RPM_SOURCE_DIR/$suppfile \
  102. >$RPM_BUILD_ROOT%{l_prefix}/share/j2se14/doc/COPYING.64
  103. ;;
  104. esac
  105. mv $pkgdir j2se14
  106. )
  107. # fix vendor distribution
  108. ( cd $RPM_BUILD_ROOT%{l_prefix}/libexec/j2se14/bin
  109. find . -type f -print | xargs chmod u+w
  110. cd $RPM_BUILD_ROOT%{l_prefix}/libexec/j2se14/jre/bin
  111. find . -type f -print | xargs chmod u+w
  112. case "%{l_target}" in
  113. sparc64-solaris2.[6-9]*)
  114. cd $RPM_BUILD_ROOT%{l_prefix}/libexec/j2se14/bin/sparcv9
  115. find . -type f -print | xargs chmod u+w
  116. cd $RPM_BUILD_ROOT%{l_prefix}/libexec/j2se14/jre/bin/sparcv9
  117. find . -type f -print | xargs chmod u+w
  118. ;;
  119. esac
  120. )
  121. # optionally brand ELF binaries (FreeBSD only)
  122. case "%{l_target}" in
  123. ix86-freebsd4* )
  124. brandelf -t Linux \
  125. `find $RPM_BUILD_ROOT%{l_prefix}/libexec/j2se14/bin/ -type f -print` \
  126. >/dev/null 2>&1 || true
  127. brandelf -t Linux \
  128. `find $RPM_BUILD_ROOT%{l_prefix}/libexec/j2se14/jre/bin/ -type f -print` \
  129. >/dev/null 2>&1 || true
  130. ;;
  131. esac
  132. # clean out installation area
  133. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/j2se14/demo 2>/dev/null || true
  134. # reduce man pages to essential ones and move them to final location
  135. if [ -d $RPM_BUILD_ROOT%{l_prefix}/libexec/j2se14/man/man1 ]; then
  136. cp $RPM_BUILD_ROOT%{l_prefix}/libexec/j2se14/man/man1/* \
  137. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  138. elif [ -d $RPM_BUILD_ROOT%{l_prefix}/libexec/j2se14/man/sman1 ]; then
  139. cp $RPM_BUILD_ROOT%{l_prefix}/libexec/j2se14/man/sman1/* \
  140. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  141. fi
  142. rm -rf $RPM_BUILD_ROOT%{l_prefix}/libexec/j2se14/man 2>/dev/null || true
  143. # link developer binaries
  144. ( cd $RPM_BUILD_ROOT%{l_prefix}/bin
  145. for bin in appletviewer extcheck idlj jar jarsigner java \
  146. java-rmi.cgi javac javadoc javah javap jdb keytool native2ascii \
  147. orbd policytool rmic rmid rmiregistry serialver servertool \
  148. tnameserv; do
  149. ln -s ../libexec/j2se14/bin/$bin .
  150. done
  151. )
  152. # install run-command script
  153. %{l_shtool} install -c -m 755 -e 's;@l_prefix@;%{l_prefix};g' \
  154. %{SOURCE rc.j2se14} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
  155. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  156. %files -f files
  157. %clean
  158. rm -rf $RPM_BUILD_ROOT