1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by scripts/Create-CopyPatch.
4 # T2 SDE: package/.../sun-jre-142/java-sun-conf.in
5 # Copyright (C) 2004 - 2020 The T2 SDE Project
6 # Copyright (C) 1998 - 2005 ROCK Linux Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
21 # Make prefix same a java_home. This way artifacts like the bin, lib
22 # and doc directory are created at the proper level.
23 . $base/package/*/*/java-jdk-conf.in $1
27 # Gnome support is only turned on when gnome is installed.
28 if pkginstalled libgnome; then
30 GNOME_DIR=$root/$( pkgprefix libgnome )
34 # The archive to be installed/patched depends on the
35 # current architecture.
38 x86) java_srctar="`match_source_file -p -i586`" ;;
39 ia64) java_srctar="`match_source_file -p -ia64`" ;;
40 x86-64) java_srctar="`match_source_file -p -x64`" ;;
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!"
48 # Custom pre patching.
50 # eliminate interactivity and integrity checks.
52 sed -i 's,more <<,cat <<,' ${java_srctar##*/}
53 sed -i 's,agreed=,agreed=1,' ${java_srctar##*/}
54 sed -i 's,`agree`,yes,' ${java_srctar##*/}
56 if [[ $pkg == *-150 ]]; then
57 patch -p0 ${java_srctar##*/} $confdir/../sun-jre-150/mime-type-remove.diff
60 # Retrieve the original javahome name from the archive.
61 tempvar="`head -n70 ${java_srctar##*/} | grep javahome`"
62 java_home_original=${tempvar/*=/}
64 # Ready to unpack/install the archive.
65 sh ${java_srctar##*/} -noregister
68 # Custom installation.
70 # Copy all stuff from the original home to our java-home.
71 # But to make sure any possible links stay intact we use
72 # tar | untar instead of cp.
73 ( cd $builddir/$java_home_original; tar -c * | tar -x -C /$prefix )
76 hook_add preconf 5 java_preconf
77 hook_add postmake 5 java_postmake