File: sun-j2re.sh

package info (click to toggle)
java-package 0.24
  • links: PTS
  • area: contrib
  • in suites: sarge
  • size: 224 kB
  • ctags: 42
  • sloc: sh: 1,149; makefile: 71
file content (74 lines) | stat: -rw-r--r-- 1,998 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Detect product
function sun_j2re_detect() {
local found=
  eval $(dpkg-architecture)
  case "$DEB_BUILD_GNU_TYPE" in
    "i386-linux")
      case "$archive_name" in
	"j2re-1_4_1_"[0-9][0-9]"-linux-i586.bin") # SUPPORTED
	    j2se_version="1.4.1+${archive_name:11:2}"
	    j2se_expected_min_size=54 # 55392 kB
	    found=true
	    ;;
	"j2re-1_4_2-linux-i586.bin") # SUPPORTED
	    j2se_version=1.4.2
	    j2se_expected_min_size=56 # 58000 kB
	    found=true
	    ;;
	"j2re-1_4_2_"[0-9][0-9]"-linux-i586.bin") # SUPPORTED
	    j2se_version="1.4.2+${archive_name:11:2}"
	    j2se_expected_min_size=56 # 58093 kB
	    found=true
	    ;;
	"j2re-1_5_0-beta2-linux-i586.bin") # SUPPORTED
	    j2se_version=1.5.0+beta2
	    j2se_expected_min_size=81 # 83267 kB
	    found=true
	    ;;
	"jre-1_5_0-linux-i586.bin") # SUPPORTED
	    j2se_version=1.5.0+update00
	    j2se_expected_min_size=85 # 86832 kB
	    found=true
	    ;;
	"jre-1_5_0_"[0-9][0-9]"-linux-i586.bin") # SUPPORTED
	    j2se_version=1.5.0+update${archive_name:10:2}
	    j2se_expected_min_size=80
	    found=true
	    ;;
      esac
      ;;
    "x86_64-linux")
      case "$archive_name" in
	"jre-1_5_0-linux-amd64.bin") # SUPPORTED
	    j2se_version=1.5.0+update00
	    j2se_expected_min_size=65 # 69936 kB
	    found=true
	    ;;
	"jre-1_5_0_"[0-9][0-9]"-linux-amd64.bin") # SUPPORTED
	    j2se_version=1.5.0+update${archive_name:10:2}
	    j2se_expected_min_size=60 # 69936 kB
	    found=true
	    ;;
      esac
      ;;
  esac
  if [[ -n "$found" ]]; then
	cat << EOF

Detected product:
    Java(TM) Runtime Environment (J2RE)
    Standard Edition, Version $j2se_version
    Sun Microsystems(TM), Inc.
EOF
	if read_yn "Is this correct [Y/n]: "; then
	    j2se_found=true
	    j2se_release="${j2se_version:0:3}"
	    j2se_required_space=$(( $j2se_expected_min_size * 2 + 20 ))
	    j2se_vendor="sun"
	    j2se_title="Java(TM) 2 RE, Standard Edition, Sun Microsystems(TM)"
	    j2re_run
	fi
    fi
}

j2se_detect_sun_j2re=sun_j2re_detect