2 j2se_detect_oracle_j2re=oracle_j2re_detect
5 if [[ $archive_name =~ jre-([0-9]+)u([0-9]+)-linux-(i586|x64|amd64)\.(bin|tar\.gz) ]]
7 j2se_release=${BASH_REMATCH[1]}
8 j2se_update=${BASH_REMATCH[2]}
9 j2se_arch=${BASH_REMATCH[3]}
10 j2se_version=$j2se_release.$j2se_update
11 j2se_priority=$((310 + $j2se_release - 1))
12 j2se_expected_min_size=85 #Mb
14 # check if the architecture matches
17 case "${DEB_BUILD_ARCH:-$DEB_BUILD_GNU_TYPE}" in
19 if [[ "$j2se_arch" != "i586" ]]; then compatible=0; fi
21 amd64|x86_64-linux-gnu)
22 if [[ "$j2se_arch" != "x64" && "$j2se_arch" != "amd64" ]]; then compatible=0; fi
26 if [[ $compatible == 0 ]]
28 echo "The archive $archive_name is not supported on the ${DEB_BUILD_ARCH} architecture"
36 Java(TM) Runtime Environment (JRE)
37 Standard Edition, Version $j2se_release Update $j2se_update
40 if read_yn "Is this correct [Y/n]: "; then
42 j2se_required_space=$(( $j2se_expected_min_size * 2 + 20 ))
44 j2se_title="Java(TM) JRE, Standard Edition, Oracle(TM)"
46 j2se_install=oracle_j2re_install
47 j2se_remove=oracle_j2re_remove
48 j2se_jinfo=oracle_j2re_jinfo
49 oracle_jre_bin_hl="java javaws keytool orbd pack200 rmid rmiregistry servertool tnameserv unpack200 policytool"
50 oracle_jre_bin_jre="javaws policytool"
51 oracle_no_man_jre_bin_jre="ControlPanel"
52 oracle_jre_lib_hl="jexec"
58 oracle_j2re_install() {
60 if [ ! -e "$jvm_base$j2se_name/debian/info" ]; then
64 install_alternatives $jvm_base$j2se_name/bin $oracle_jre_bin_hl
65 install_alternatives $jvm_base$j2se_name/bin $oracle_jre_bin_jre
66 install_no_man_alternatives $jvm_base$j2se_name/bin $oracle_no_man_jre_bin_jre
67 install_no_man_alternatives $jvm_base$j2se_name/lib $oracle_jre_lib_hl
69 plugin_dir="$jvm_base$j2se_name/lib/$DEB_BUILD_ARCH"
70 install_browser_plugin "/usr/lib/iceweasel/plugins" "libjavaplugin.so" "iceweasel-javaplugin.so" "\$plugin_dir/libnpjp2.so"
71 install_browser_plugin "/usr/lib/chromium/plugins" "libjavaplugin.so" "chromium-javaplugin.so" "\$plugin_dir/libnpjp2.so"
72 install_browser_plugin "/usr/lib/mozilla/plugins" "libjavaplugin.so" "mozilla-javaplugin.so" "\$plugin_dir/libnpjp2.so"
73 install_browser_plugin "/usr/lib/firefox/plugins" "libjavaplugin.so" "firefox-javaplugin.so" "\$plugin_dir/libnpjp2.so"
77 oracle_j2re_remove() {
79 if [ ! -e "$jvm_base$j2se_name/debian/info" ]; then
83 remove_alternatives $jvm_base$j2se_name/bin $oracle_jre_bin_hl
84 remove_alternatives $jvm_base$j2se_name/bin $oracle_jre_bin_jre
85 remove_alternatives $jvm_base$j2se_name/bin $oracle_no_man_jre_bin_jre
86 remove_alternatives $jvm_base$j2se_name/lib $oracle_jre_lib_hl
88 plugin_dir="$jvm_base$j2se_name/lib/$DEB_BUILD_ARCH"
89 remove_browser_plugin "iceweasel-javaplugin.so" "\$plugin_dir/libnpjp2.so"
90 remove_browser_plugin "chromium-javaplugin.so" "\$plugin_dir/libnpjp2.so"
91 remove_browser_plugin "mozilla-javaplugin.so" "\$plugin_dir/libnpjp2.so"
92 remove_browser_plugin "firefox-javaplugin.so" "\$plugin_dir/libnpjp2.so"
99 priority=$j2se_priority
102 jinfos "hl" $jvm_base$j2se_name/bin/ $oracle_jre_bin_hl
103 jinfos "jre" $jvm_base$j2se_name/bin/ $oracle_jre_bin_jre
104 jinfos "jre" $jvm_base$j2se_name/bin/ $oracle_no_man_jre_bin_jre
105 jinfos "hl" $jvm_base$j2se_name/lib/ $oracle_jre_lib_hl
106 echo "plugin iceweasel-javaplugin.so $jvm_base$j2se_name/lib/$DEB_BUILD_ARCH/libnpjp2.so"
107 echo "plugin chromium-javaplugin.so $jvm_base$j2se_name/lib/$DEB_BUILD_ARCH/libnpjp2.so"