64ccb0f48cdf53c4efcea8ffade549376b9a846e
[sven/java-package.git] / lib / oracle-j2sdk-doc.sh
1 # Detect product
2 oracle_j2sdk_doc_detect() {
3   local found=
4       case "$archive_name" in
5         "jdk-6u"[0-9][0-9]"-apidocs.zip") # SUPPORTED
6             j2se_version=1.6.0+update${archive_name:6:2}${revision}
7             j2se_expected_min_size=44 #Mb
8             found=true
9             ;;
10         "jdk-7u"[0-9]"-apidocs.zip") # SUPPORTED
11             j2se_version=1.7.0+update${archive_name:6:1}${revision}
12             j2se_expected_min_size=290 #Mb
13             found=true
14             ;;
15       esac
16   if [[ -n "$found" ]]; then
17         cat << EOF
18
19 Detected product:
20     Java(TM) Development Kit (JDK) Documentation
21     Standard Edition, Version $j2se_version
22     Oracle(TM)
23 EOF
24         if read_yn "Is this correct [Y/n]: "; then
25             j2se_found=true
26             j2se_release="${j2se_version:2:1}"
27             j2se_required_space=$(( $j2se_expected_min_size * 2 + 20 ))
28             j2se_vendor="oracle"
29             j2se_title="Java(TM) JDK, Standard Edition, Oracle(TM) Documentation"
30
31             j2se_install=oracle_j2sdk_doc_install
32             j2se_remove=oracle_j2sdk_doc_remove
33             j2sdk_doc_run
34         fi
35     fi
36 }
37
38 j2se_detect_j2sdk_doc_oracle=oracle_j2sdk_doc_detect
39
40 oracle_j2sdk_doc_install() {
41         cat << EOF
42 if [ ! -e "$javadoc_base$j2se_name" ]; then
43     exit 0
44 fi
45
46 # Register the documentation in the various documentation systems, i.e. dhelp and dwww.
47 if [ "\$1" = configure ] ; then
48     if which install-docs >/dev/null 2>&1; then
49         install-docs -i $javadoc_base$j2se_name
50     fi
51 fi
52 EOF
53 }
54
55 oracle_j2sdk_doc_remove() {
56         cat << EOF
57 if [ ! -e "$javadoc_base$j2se_name" ]; then
58     exit 0
59 fi
60
61 # Unregister documentation from the various documentation systems, i.e. dhelp and dwww.
62 if [ "\$1" = configure ] ; then
63     if which install-docs >/dev/null 2>&1; then
64         install-docs -r $javadoc_base$j2se_name
65     fi
66 fi
67 EOF
68 }
69