OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.7 KiB

  1. #!/bin/sh
  2. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # Filename: package/.../sun-jre-142/java-sun-conf.in
  6. # Copyright (C) 2007 - 2008 The OpenSDE Project
  7. # Copyright (C) 2004 - 2006 The T2 SDE Project
  8. # Copyright (C) 1998 - 2005 Clifford Wolf
  9. #
  10. # More information can be found in the files COPYING and README.
  11. #
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; version 2 of the License. A copy of the
  15. # GNU General Public License can be found in the file COPYING.
  16. # --- SDE-COPYRIGHT-NOTE-END ---
  17. # Prevent normal package extraction. However since auto package
  18. # extraction is turned off, so are the pre and post patch hooks.
  19. # Instead we abuse the preconf hook to do the necessary patching.
  20. autoextract=0
  21. # Prevent executing normal make and install build steps.
  22. # This package has custom make and install.
  23. makeopt=
  24. makeinstopt=
  25. # Make prefix same a java_home. This way artifacts like the bin, lib
  26. # and doc directory are created at the proper level.
  27. . $base/package/*/*/java-jdk-conf.in $1
  28. java_home_original=
  29. # Gnome support is only turned on when gnome is installed.
  30. if pkginstalled libgnome; then
  31. pkgprefix -t libgnome
  32. GNOME_DIR=$root/$( pkgprefix libgnome )
  33. export GNOME_DIR
  34. fi
  35. # The archive to be installed/patched depends on the
  36. # current architecture.
  37. java_srctar=
  38. case $arch in
  39. x86) java_srctar="`match_source_file -p -i586`" ;;
  40. ia64) java_srctar="`match_source_file -p -ia64`" ;;
  41. x86-64) java_srctar="`match_source_file -p -amd64`" ;;
  42. esac
  43. # Make sure there is a file to be patched. If not we
  44. # apparently do not support the current architecture.
  45. [ "$java_srctar" ] || abort "No binary for this architecture ($arch) detected!"
  46. # Custom pre patching.
  47. java_preconf() {
  48. # eliminate interactivity and integrity checks.
  49. cp -v $java_srctar .
  50. sed -i 's,more <<,cat <<,' ${java_srctar##*/}
  51. sed -i 's,agreed=,agreed=1,' ${java_srctar##*/}
  52. sed -i 's,`agree`,yes,' ${java_srctar##*/}
  53. if [[ $pkg == *-150 ]]; then
  54. patch -p0 ${java_srctar##*/} $confdir/../sun-jre-150/mime-type-remove.diff
  55. fi
  56. # Retrieve the original javahome name from the archive.
  57. tempvar="`head -n60 ${java_srctar##*/} | grep javahome`"
  58. java_home_original=${tempvar/*=/}
  59. # Ready to unpack/install the archive.
  60. sh ${java_srctar##*/}
  61. }
  62. # Custom installation.
  63. java_postmake() {
  64. # Copy all stuff from the original home to our java-home.
  65. # But to make sure any possible links stay intact we use
  66. # tar | untar instead of cp.
  67. ( cd $builddir/$java_home_original; tar -c * | tar -x -C /$prefix )
  68. }
  69. hook_add preconf 5 java_preconf
  70. hook_add postmake 5 java_postmake