--- /dev/null
+
+* To be done :
+
+(from java-pakage-0.42)
+- remove use of dpkg --print-architecture from plugin alternatives installation in install/remove scripts.
+- kinit, klist, and ktab not installed; handling of /etc/krb5.conf not addressed
+
+(from Matthias Klose <doko@ubuntu.com>)
+- install into a multiarch location to allow installing the i386 client vm on amd64 and ia64.
+
+(else)
+- make symbolic links for j2se/jre/bin/* in j2se/bin/ to avoid duplication
+- make symbolic links for j2se/jre/man/man1/* in j2se/man/man1 to avoid duplication
+- make symbolic links for j2se/jre/man/ja_JP.UTF-8 in j2se/man/ja to avoid duplication
+
+
+
+
+* Main variables used in the scripts :
+
+debian_dir : debian files dir during packaging, set by make-jpkg
+install_dir : package files dir during packaging, set by make-jpkg
+DEB_BUILD_ARCH = amd64, .., set by common.sh/get_architecture
+DEB_BUILD_GNU_TYPE = x86_64-linux-gnu, .., set by common.sh/get_architecture
+jvm_base : jvm package installation dir, set by make-jpkg
+javadoc_base : javadoc package installation dir, set by make-jpkg
+j2se_package : final package name, set by j2re/j2sdk/j2sdk-doc.sh
+j2se_name : name of installed package within jvm_base, set by j2re/j2sdk/j2sdk-doc.sh
+
+j2se_install : name of function generating postinst script content, set by each_provider*-j2re/j2sdk/j2sdk-doc.sh
+j2se_remove : name of function generating prerm script content, set by each_provider*-j2re/j2sdk/j2sdk-doc.sh
+j2se_jinfo : name of function generating .jinfo file content, set by each_provider*-j2re/j2sdk/j2sdk-doc.sh
+
+
+
+
+
+++ /dev/null
-
-From old java-pakage :
-Move repeated code in install/remove scripts to a single point; apply the DRY (don't repeat yourself) principle.
-Change handling of alternatives to allow for multiple directories, i.e. when you have executables in both bin and jre/bin in a JDK.
-Remove use of dpkg --print-architecture from plugin alternatives installation in install/remove scripts.
-
-From Matthias Klose <doko@ubuntu.com> :
-
-Support the .jinfo files (update-java-alternatives)
-Install into a multiarch location to allow installing the i386 client vm on amd64 and ia64.
-
java-package (0.50) UNRELEASED; urgency=low
* Java-package reset for reintroduction in debian (removal of all
- previously supported jvm).
+ previously supported jvm, global refactoring).
* Add support for Oracle Java 6 (update >= 10)
* Add support for Oracle Java 7
+ * Add support for .jinfo file (update-java-alternatives tool)
+ * Use jdk included jre binaries (jdk/jre/bin/*)
-- Cédric Pineau <cedric.pineau@gmail.com> Thu, 22 Dec 2011 11:42:13 +0100
dh_installdirs
install -m 755 make-jpkg.out $(B)/usr/bin/make-jpkg
- cp lib/*.sh lib/*-common $(B)/usr/share/java-package/
- for dir in $(wildcard oracle-j2*); do \
- cp -a $$dir $(B)/usr/share/java-package/; \
- done
+ cp lib/*.sh $(B)/usr/share/java-package/
find $(B) -type d -name .svn | xargs -r rm -r
# Generate SUPPORTED
# read_yn <prompt>
-function read_yn() {
+read_yn() {
local prompt="$1"
while true; do
read -e -n 1 -p "$prompt" reply
# diskusage <path>: prints size in MB
-function diskusage() {
+diskusage() {
local path="$1"
read size dummy < <( du -sm "$path" )
echo "$size"
# diskfree <minimum size in MB>
-function diskfree() {
+diskfree() {
local size="$1"
echo -n "Checking free diskspace:"
(( free = `stat -f -c '%a / 2048 * ( %s / 512 )' $tmp ` ))
# extract_bin <file> <expected_min_size> <dest>
-function extract_bin() {
+extract_bin() {
local file="$1"
local expected_min_size="$2"
local dest="$3"
}
-function read_maintainer_info() {
+read_maintainer_info() {
if [ -z "$maintainer_name" ]; then
if [ -n "$DEBFULLNAME" ]; then
maintainer_name="$DEBFULLNAME"
}
# provide the architecture for evaluation by plugins
-function get_architecture() {
+get_architecture() {
echo
export DEB_BUILD_ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH)
+++ /dev/null
- # Common functions for all install scripts
-
- # install_alternative -- add an alternative
- #
- # install_alternative program
- function install_alternative() {
- local program="$1"
- update-alternatives \
- --install "/usr/bin/$program" "$program" \
- "$j2se_base/bin/$program" "$priority" \
- --slave "/usr/share/man/man1/$program.1.gz" "$program.1.gz" \
- "$j2se_base/man/man1/$program.1.gz"
- }
-
- # install_java_plugin -- add an alternative for a browser plugin
- #
- # install_java_plugin browser_plugin_path java_plugin_path priority
- function install_java_plugin() {
- [ -d "$1" ] || install -d -m 755 "$1"
- update-alternatives \
- --install "$1/$2" "$3" "$4" "$5"
- }
-function j2re_readme() {
- j2se_readme
-}
-
-function j2re_changelog() {
- j2se_changelog
-}
-function j2re_control() {
+j2re_control() {
j2se_control
cat << EOF
Package: $j2se_package
EOF
}
-function j2re_copyright() {
- j2se_copyright
-}
-
-function j2re_install_scripts() {
- j2se_install_scripts
-}
-
-function j2re_info() {
- j2se_info
-}
-
-function j2re_build() {
- j2se_build
-}
-
# build debian package
-function j2re_run() {
+j2re_run() {
echo
diskfree "$j2se_required_space"
read_maintainer_info
j2se_package="$j2se_vendor-j2re$j2se_release"
- j2se_base="/usr/lib/jvm/j2re$j2se_release-$j2se_vendor"
- local target="$install_dir$j2se_base"
+ j2se_name="j2re$j2se_release-$j2se_vendor"
+ local target="$install_dir$jvm_base$j2se_name"
install -d -m 755 "$( dirname "$target" )"
extract_bin "$archive_path" "$j2se_expected_min_size" "$target"
rm -rf "$target/.systemPrefs"
- j2re_readme > "$debian_dir/README.Debian"
- j2re_changelog > "$debian_dir/changelog"
+ j2se_readme > "$debian_dir/README.Debian"
+ j2se_changelog > "$debian_dir/changelog"
j2re_control > "$debian_dir/control"
- j2re_copyright > "$debian_dir/copyright"
- j2re_install_scripts
+ j2se_copyright > "$debian_dir/copyright"
+ j2se_install_scripts
install -d "$target/debian"
- j2re_info > "$target/debian/info"
- j2re_build
+ j2se_info > "$target/debian/info"
+ eval "$j2se_jinfo" > "$install_dir$jvm_base.$j2se_name.jinfo"
+ j2se_build
}
-function j2sdk_doc_readme() {
- j2se_readme
-}
-
-function j2sdk_doc_changelog() {
- j2se_changelog
-}
-
-function j2sdk_doc_control() {
+j2sdk_doc_control() {
j2se_control
cat << EOF
Package: $j2se_package
EOF
}
-function j2sdk_doc_copyright() {
- j2se_copyright
-}
-
-function j2sdk_doc_install_scripts() {
- j2se_install_scripts
-}
-
-function j2sdk_doc_info() {
- j2se_info
-}
-
-function j2sdk_doc_doc-base() {
+j2sdk_doc_doc-base() {
cat << EOF
Document: $j2se_package
Title: $j2se_title
EOF
}
-function j2sdk_doc_build() {
- j2se_build
-}
-
# build debian package
-function j2sdk_doc_run() {
+j2sdk_doc_run() {
echo
diskfree "$j2se_required_space"
read_maintainer_info
j2se_package="$j2se_vendor-j2sdk$j2se_release-doc"
- j2se_base="/usr/share/doc/j2sdk$j2se_release-$j2se_vendor-doc"
- local target="$install_dir$j2se_base"
+ j2se_name="j2sdk$j2se_release-$j2se_vendor-doc"
+ local target="$install_dir$javadoc_base$j2se_name"
install -d -m 755 "$( dirname "$target" )"
extract_bin "$archive_path" "$j2se_expected_min_size" "$target"
rm -rf "$target/.systemPrefs"
- j2sdk_doc_readme > "$debian_dir/README.Debian"
- j2sdk_doc_changelog > "$debian_dir/changelog"
+ j2se_readme > "$debian_dir/README.Debian"
+ j2se_changelog > "$debian_dir/changelog"
j2sdk_doc_control > "$debian_dir/control"
- j2sdk_doc_copyright > "$debian_dir/copyright"
+ j2se_copyright > "$debian_dir/copyright"
j2sdk_doc_doc-base > "$debian_dir/$j2se_package.doc-base"
- j2sdk_doc_install_scripts
+ j2se_install_scripts
install -d "$target/debian"
- j2sdk_doc_info > "$target/debian/info"
- j2sdk_doc_build
+ j2se_info > "$target/debian/info"
+ j2se_build
}
-function j2sdk_readme() {
- j2se_readme
-}
-
-function j2sdk_changelog() {
- j2se_changelog
-}
-function j2sdk_control() {
+j2sdk_control() {
j2se_control
cat << EOF
Package: $j2se_package
EOF
}
-function j2sdk_copyright() {
- j2se_copyright
-}
-
-function j2sdk_install_scripts() {
- j2se_install_scripts
-}
-
-function j2sdk_info() {
- j2se_info
-}
-
-function j2sdk_build() {
- j2se_build
-}
-
# build debian package
-function j2sdk_run() {
+j2sdk_run() {
echo
diskfree "$j2se_required_space"
read_maintainer_info
j2se_package="$j2se_vendor-j2sdk$j2se_release"
- j2se_base="/usr/lib/jvm/j2sdk$j2se_release-$j2se_vendor"
- local target="$install_dir$j2se_base"
+ j2se_name="j2sdk$j2se_release-$j2se_vendor"
+ local target="$install_dir$jvm_base$j2se_name"
install -d -m 755 "$( dirname "$target" )"
extract_bin "$archive_path" "$j2se_expected_min_size" "$target"
rm -rf "$target/.systemPrefs"
- j2sdk_readme > "$debian_dir/README.Debian"
- j2sdk_changelog > "$debian_dir/changelog"
+ j2se_readme > "$debian_dir/README.Debian"
+ j2se_changelog > "$debian_dir/changelog"
j2sdk_control > "$debian_dir/control"
- j2sdk_copyright > "$debian_dir/copyright"
- j2sdk_install_scripts
+ j2se_copyright > "$debian_dir/copyright"
+ j2se_install_scripts
install -d "$target/debian"
- j2sdk_info > "$target/debian/info"
- j2sdk_build
+ j2se_info > "$target/debian/info"
+ eval "$j2se_jinfo" > "$install_dir$jvm_base.$j2se_name.jinfo"
+ j2se_build
}
-function j2se_readme() {
+j2se_readme() {
cat << EOF
Package for $j2se_title
---
This package has been automatically created with java-package ($version).
All files from the original distribution should have been installed in
-the directory $j2se_base. Please take a look at this directory for
+the directory $jvm_base$j2se_name. Please take a look at this directory for
further information.
EOF
}
-function j2se_changelog() {
+j2se_changelog() {
cat << EOF
$j2se_package ($j2se_version) unstable; urgency=low
EOF
}
-function j2se_control() {
+j2se_control() {
cat << EOF
Source: $j2se_package
Section: non-free/devel
EOF
}
-function j2se_copyright() {
+j2se_copyright() {
cat << EOF
----------------------------------------------------------------------
This file contains a copy of all copyright files found in the original
distribution. The original copyright files and further information can
-be found in the directory $j2se_base and its
+be found in the directory $jvm_base$j2se_name and its
subdirectories.
----------------------------------------------------------------------
)
}
-function j2se_install_scripts() {
+j2se_install_scripts() {
cat > "$debian_dir/postinst" << EOF
#!/bin/bash
set -e
if [ "\$1" = configure ]; then
-EOF
- cat "$lib_dir/install-common" >> "$debian_dir/postinst"
- cat "$lib_dir/$j2se_package/install" >> "$debian_dir/postinst"
+ # Common functions for all install scripts
+
+ # install_alternatives program_base programs
+ install_alternatives() {
+ program_base="\$1"
+ shift
+ for program in \$*; do
+ update-alternatives \\
+ --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority \\
+ --slave "/usr/share/man/man1/\$program.1.gz" "\$program.1.gz" "$jvm_base$j2se_name/man/man1/\$program.1.gz"
+ done
+ }
+
+ # install_alternatives_no_man program_base programs
+ install_no_man_alternatives() {
+ program_base="\$1"
+ shift
+ for program in \$*; do
+ update-alternatives --install "/usr/bin/\$program" "\$program" "\$program_base/\$program" $j2se_priority
+ done
+ }
+
+ # install_browser_plugin link_path link_name plugin_name plugin
+ install_browser_plugin() {
+ local link_path="\$1"
+ local link_name="\$2"
+ local plugin_name="\$3"
+ local plugin="\$4"
+ [ -d "\$link_path" ] || install -d -m 755 "\$link_path"
+ update-alternatives --install "\$link_path/\$link_name" "\$plugin_name" "\$plugin" $j2se_priority
+ }
+
+EOF
+ eval "$j2se_install" >> "$debian_dir/postinst"
cat >> "$debian_dir/postinst" << EOF
fi
case "\$1" in
remove | deconfigure)
-EOF
- cat "$lib_dir/remove-common" >> "$debian_dir/prerm"
- cat "$lib_dir/$j2se_package/remove" >> "$debian_dir/prerm"
+ # Common functions for all remove scripts
+
+ # remove_alternatives program_base programs
+ remove_alternatives() {
+ program_base="\$1"
+ shift
+ for program in \$*; do
+ update-alternatives --remove "\$program" "\$program_base/\$program"
+ done
+ }
+
+ # remove_browser_plugin plugin_name plugin
+ remove_browser_plugin() {
+ local plugin_name="\$1"
+ local plugin="\$2"
+ update-alternatives --remove "\$plugin_name" "\$plugin"
+ }
+
+EOF
+ eval "$j2se_remove" >> "$debian_dir/prerm"
cat >> "$debian_dir/prerm" << EOF
;;
chmod 755 "$debian_dir/prerm"
}
-function j2se_info() {
+j2se_info() {
cat << EOF
version="$version"
j2se_version="$j2se_version"
EOF
}
-function j2se_build() {
+# jinfos prefix program_base programs
+jinfos() {
+ prefix="$1"
+ program_base="$2"
+ shift ; shift
+ for program in $*; do
+ echo "$prefix $program $program_base$program"
+ done
+}
+
+j2se_build() {
cd "$tmp"
echo "Create debian package:"
# dh_install
# dh_link
# Conditionally wrapping this as not all JRE/JDKs have man directories
- if [ -e "$install_dir/$j2se_base/man" ]; then
+ if [ -e "$install_dir/$jvm_base$j2se_name/man" ]; then
echo " dh_compress"
- dh_compress $( find "$install_dir/$j2se_base/man" -type f ! -name "*.gz" )
+ dh_compress $( find "$install_dir/$jvm_base$j2se_name/man" -type f ! -name "*.gz" )
fi
echo " dh_fixperms"
dh_fixperms
# Detect product
-function oracle_j2re_detect() {
+j2se_detect_oracle_j2re=oracle_j2re_detect
+oracle_j2re_detect() {
local found=
case "${DEB_BUILD_ARCH:-$DEB_BUILD_GNU_TYPE}" in
"jre-6u"[0-9][0-9]"-linux-i586.bin") # SUPPORTED
j2se_version=1.6.0+update${archive_name:6:2}${revision}
j2se_expected_min_size=16 #Mb
+ j2se_priority=314
found=true
;;
"jre-7u"[0-9]"-linux-i586.tar.gz") # SUPPORTED
j2se_version=1.7.0+update${archive_name:6:1}${revision}
j2se_expected_min_size=94 #Mb
+ j2se_priority=316
found=true
;;
esac
"jre-6u"[0-9][0-9]"-linux-x64.bin") # SUPPORTED
j2se_version=1.6.0+update${archive_name:6:2}${revision}
j2se_expected_min_size=16 #Mb
+ j2se_priority=314
found=true
;;
"jre-7u"[0-9]"-linux-x64.tar.gz") # SUPPORTED
j2se_version=1.7.0+update${archive_name:6:1}${revision}
j2se_expected_min_size=88 #Mb
+ j2se_priority=316
found=true
;;
esac
j2se_required_space=$(( $j2se_expected_min_size * 2 + 20 ))
j2se_vendor="oracle"
j2se_title="Java(TM) JRE, Standard Edition, Oracle Microsystems(TM)"
+
+ j2se_install=oracle_j2re_install
+ j2se_remove=oracle_j2re_remove
+ j2se_jinfo=oracle_j2re_jinfo
+ oracle_jre_bin_hl="java javaws keytool orbd pack200 rmid rmiregistry servertool tnameserv unpack200 policytool"
+ oracle_jre_bin_jre="javaws policytool"
+ oracle_no_man_jre_bin_jre="ControlPanel"
+ oracle_jre_lib_hl="jexec"
j2re_run
fi
fi
}
-j2se_detect_oracle_j2re=oracle_j2re_detect
+oracle_j2re_install() {
+ cat << EOF
+if [ ! -e "$jvm_base$j2se_name/debian/info" ]; then
+ exit 0
+fi
+
+install_alternatives $jvm_base$j2se_name/bin $oracle_jre_bin_hl
+install_alternatives $jvm_base$j2se_name/bin $oracle_jre_bin_jre
+install_no_man_alternatives $jvm_base$j2se_name/bin $oracle_no_man_jre_bin_jre
+install_no_man_alternatives $jvm_base$j2se_name/lib $oracle_jre_lib_hl
+
+plugin_dir="$jvm_base$j2se_name/lib/$DEB_BUILD_ARCH"
+install_browser_plugin "/usr/lib/iceweasel/plugins" "libjavaplugin.so" "iceweasel-javaplugin.so" "\$plugin_dir/libnpjp2.so"
+install_browser_plugin "/usr/lib/chromium/plugins" "libjavaplugin.so" "chromium-javaplugin.so" "\$plugin_dir/libnpjp2.so"
+EOF
+}
+
+oracle_j2re_remove() {
+ cat << EOF
+if [ ! -e "$jvm_base$j2se_name/debian/info" ]; then
+ exit 0
+fi
+
+remove_alternatives $jvm_base$j2se_name/bin $oracle_jre_bin_hl
+remove_alternatives $jvm_base$j2se_name/bin $oracle_jre_bin_jre
+remove_alternatives $jvm_base$j2se_name/bin $oracle_no_man_jre_bin_jre
+remove_alternatives $jvm_base$j2se_name/lib $oracle_jre_lib_hl
+
+plugin_dir="$jvm_base$j2se_name/lib/$DEB_BUILD_ARCH"
+remove_browser_plugin "iceweasel-javaplugin.so" "\$plugin_dir/libnpjp2.so"
+remove_browser_plugin "chromium-javaplugin.so" "\$plugin_dir/libnpjp2.so"
+EOF
+}
+
+oracle_j2re_jinfo() {
+ cat << EOF
+name=$j2se_name
+priority=$j2se_priority
+section=main
+EOF
+ jinfos "hl" $jvm_base$j2se_name/bin/ $oracle_jre_bin_hl
+ jinfos "jre" $jvm_base$j2se_name/bin/ $oracle_jre_bin_jre
+ jinfos "jre" $jvm_base$j2se_name/bin/ $oracle_no_man_jre_bin_jre
+ jinfos "hl" $jvm_base$j2se_name/lib/ $oracle_jre_lib_hl
+ echo "plugin iceweasel-javaplugin.so $jvm_base$j2se_name/lib/$DEB_BUILD_ARCH/libnpjp2.so"
+ echo "plugin chromium-javaplugin.so $jvm_base$j2se_name/lib/$DEB_BUILD_ARCH/libnpjp2.so"
+}
+
# Detect product
-function oracle_j2sdk_doc_detect() {
+oracle_j2sdk_doc_detect() {
local found=
case "$archive_name" in
"jdk-6u"[0-9][0-9]"-apidocs.zip") # SUPPORTED
j2se_required_space=$(( $j2se_expected_min_size * 2 + 20 ))
j2se_vendor="oracle"
j2se_title="Java(TM) JDK, Standard Edition, Oracle(TM) Documentation"
+
+ j2se_install=oracle_j2sdk_doc_install
+ j2se_remove=oracle_j2sdk_doc_remove
j2sdk_doc_run
fi
fi
}
j2se_detect_j2sdk_doc_oracle=oracle_j2sdk_doc_detect
+
+oracle_j2sdk_doc_install() {
+ cat << EOF
+if [ ! -e "$javadoc_base$j2se_name" ]; then
+ exit 0
+fi
+
+# Register the documentation in the various documentation systems, i.e. dhelp and dwww.
+if [ "\$1" = configure ] ; then
+ if which install-docs >/dev/null 2>&1; then
+ install-docs -i $javadoc_base$j2se_name
+ fi
+fi
+EOF
+}
+
+oracle_j2sdk_doc_remove() {
+ cat << EOF
+if [ ! -e "$javadoc_base$j2se_name" ]; then
+ exit 0
+fi
+
+# Unregister documentation from the various documentation systems, i.e. dhelp and dwww.
+if [ "\$1" = configure ] ; then
+ if which install-docs >/dev/null 2>&1; then
+ install-docs -r $javadoc_base$j2se_name
+ fi
+fi
+EOF
+}
+
# Detect product
-function oracle_j2sdk_detect() {
+j2se_detect_oracle_j2sdk=oracle_j2sdk_detect
+oracle_j2sdk_detect() {
local found=
case "${DEB_BUILD_ARCH:-$DEB_BUILD_GNU_TYPE}" in
"jdk-6u"[0-9][0-9]"-linux-i586.bin") # SUPPORTED
j2se_version=1.6.0+update${archive_name:6:2}${revision}
j2se_expected_min_size=130 #Mb
+ j2se_priority=315
found=true
;;
"jdk-7u"[0-9]"-linux-i586.tar.gz") # SUPPORTED
j2se_version=1.7.0+update${archive_name:6:1}${revision}
j2se_expected_min_size=190 #Mb
+ j2se_priority=317
found=true
;;
esac
"jdk-6u"[0-9][0-9]"-linux-x64.bin") # SUPPORTED
j2se_version=1.6.0+update${archive_name:6:2}${revision}
j2se_expected_min_size=130 #Mb
+ j2se_priority=315
found=true
;;
"jdk-7u"[0-9]"-linux-x64.tar.gz") # SUPPORTED
j2se_version=1.7.0+update${archive_name:6:1}${revision}
j2se_expected_min_size=180 #Mb
+ j2se_priority=317
found=true
;;
esac
j2se_required_space=$(( $j2se_expected_min_size * 2 + 20 ))
j2se_vendor="oracle"
j2se_title="Java(TM) JDK, Standard Edition, Oracle(TM)"
+
+ j2se_install=oracle_j2sdk_install
+ j2se_remove=oracle_j2sdk_remove
+ j2se_jinfo=oracle_j2sdk_jinfo
+ oracle_jre_bin_hl="java javaws keytool orbd pack200 rmid rmiregistry servertool tnameserv unpack200 policytool"
+ oracle_jre_bin_jre="javaws policytool"
+ oracle_no_man_jre_bin_jre="ControlPanel"
+ oracle_jre_lib_hl="jexec"
+ oracle_bin_jdk="appletviewer extcheck idlj jar jarsigner javac javadoc javah javap jconsole jdb jinfo jmap jps jsadebugd jstack jstat jstatd native2ascii rmic serialver"
j2sdk_run
fi
fi
}
-j2se_detect_oracle_j2sdk=oracle_j2sdk_detect
+oracle_j2sdk_install() {
+ cat << EOF
+if [ ! -e "$jvm_base$j2se_name/debian/info" ]; then
+ exit 0
+fi
+
+install_alternatives $jvm_base$j2se_name/jre/bin $oracle_jre_bin_hl
+install_alternatives $jvm_base$j2se_name/jre/bin $oracle_jre_bin_jre
+install_no_man_alternatives $jvm_base$j2se_name/jre/bin $oracle_no_man_jre_bin_jre
+install_no_man_alternatives $jvm_base$j2se_name/jre/lib $oracle_jre_lib_hl
+install_alternatives $jvm_base$j2se_name/bin $oracle_bin_jdk
+
+plugin_dir="$jvm_base$j2se_name/jre/lib/$DEB_BUILD_ARCH"
+install_browser_plugin "/usr/lib/iceweasel/plugins" "libjavaplugin.so" "iceweasel-javaplugin.so" "\$plugin_dir/libnpjp2.so"
+install_browser_plugin "/usr/lib/chromium/plugins" "libjavaplugin.so" "chromium-javaplugin.so" "\$plugin_dir/libnpjp2.so"
+EOF
+}
+
+oracle_j2sdk_remove() {
+ cat << EOF
+if [ ! -e "$jvm_base$j2se_name/debian/info" ]; then
+ exit 0
+fi
+
+remove_alternatives $jvm_base$j2se_name/jre/bin $oracle_jre_bin_hl
+remove_alternatives $jvm_base$j2se_name/jre/bin $oracle_jre_bin_jre
+remove_alternatives $jvm_base$j2se_name/jre/bin $oracle_no_man_jre_bin_jre
+remove_alternatives $jvm_base$j2se_name/jre/lib $oracle_jre_lib_hl
+remove_alternatives $jvm_base$j2se_name/bin $oracle_bin_jdk
+
+plugin_dir="$jvm_base$j2se_name/jre/lib/$DEB_BUILD_ARCH"
+remove_browser_plugin "iceweasel-javaplugin.so" "\$plugin_dir/libnpjp2.so"
+remove_browser_plugin "chromium-javaplugin.so" "\$plugin_dir/libnpjp2.so"
+EOF
+}
+
+oracle_j2sdk_jinfo() {
+ cat << EOF
+name=$j2se_name
+priority=$j2se_priority
+section=main
+EOF
+ jinfos "hl" $jvm_base$j2se_name/jre/bin/ $oracle_jre_bin_hl
+ jinfos "jre" $jvm_base$j2se_name/jre/bin/ $oracle_jre_bin_jre
+ jinfos "jre" $jvm_base$j2se_name/jre/bin/ $oracle_no_man_jre_bin_jre
+ jinfos "hl" $jvm_base$j2se_name/jre/lib/ $oracle_jre_lib_hl
+ jinfos "jdk" $jvm_base$j2se_name/bin/ $oracle_bin_jdk
+ echo "plugin iceweasel-javaplugin.so $jvm_base$j2se_name/jre/lib/$DEB_BUILD_ARCH/libnpjp2.so"
+ echo "plugin chromium-javaplugin.so $jvm_base$j2se_name/jre/lib/$DEB_BUILD_ARCH/libnpjp2.so"
+}
+++ /dev/null
- # Common functions for all install scripts
-
- # remove_alternative -- remove an alternative
- #
- # remove_alternative program
- function remove_alternative() {
- local program="$1"
- update-alternatives \
- --remove "$program" "/usr/bin/$program-$suffix"
- rm "/usr/bin/$program-$suffix"
- }
-
- # remove_java_plugin -- add an alternative for a browser plugin
- #
- # remove_java_plugin plugins_path
- function remove_java_plugin() {
- local program="$1"
- update-alternatives \
- --remove "$program" "$plugin_dir/libjavaplugin_oji.so"
- }
### Parse options
-function print_usage() {
+print_usage() {
cat << EOF
Usage: $program_name [OPTION]... FILE
EOF
}
-function unrecognized_option() {
+unrecognized_option() {
cat >&2 << EOF
$program_name: unrecognized option \`$1'
Try \`$program_name --help' for more information.
exit 1
}
-function missing_argument() {
+missing_argument() {
cat >&2 << EOF
$program_name: missing argument for option \`$1'
Try \`$program_name --help' for more information.
tmp=
# function is called when script terminates
-function on_exit() {
+on_exit() {
lastcmd="$_"
if [[ -z "$success" && -z "$failed" ]]; then
cat >&2 << EOF
trap on_exit EXIT
# print error message and terminate
-function error_exit() {
+error_exit() {
cat >&2 << EOF
Aborted.
# get architecture information
get_architecture
+jvm_base="/usr/lib/jvm/"
+javadoc_base="/usr/share/doc/"
+
j2se_found=
for var in ${!j2se_detect_*}; do
eval "\$$var"
+++ /dev/null
-suffix=j2re1.6-oracle
-j2se_base="/usr/lib/jvm/$suffix"
-priority=316
-
-if [ ! -e "$j2se_base/debian/info" ]; then
- exit 0
-fi
-
-# alternative <program>
-function program_alternative() {
- local program="$1"
- update-alternatives \
- --install "/usr/bin/$program" "$program" \
- "$j2se_base/bin/$program" "$priority" \
- --slave "/usr/share/man/man1/$program.1.gz" "$program.1.gz" \
- "$j2se_base/man/man1/$program.1.gz"
-}
-
-# kinit, klist, and ktab not installed at this
-# time; handling of /etc/krb5.conf not addressed
-program_alternative ControlPanel
-program_alternative java
-program_alternative javaws
-program_alternative keytool
-program_alternative orbd
-program_alternative pack200
-program_alternative policytool
-program_alternative rmid
-program_alternative rmiregistry
-program_alternative servertool
-program_alternative tnameserv
-program_alternative unpack200
-
-# derive the architecture-specific
-# directory for the plugin
-arch_dir="$(dpkg --print-architecture)"
-
-# assemble the plugin path
-plugin_dir="$j2se_base/lib/$arch_dir"
-
-# iceweasel
-iceweasel_dir="/usr/lib/iceweasel/plugins"
-[ -d "$iceweasel_dir" ] || install -d -m 755 "$iceweasel_dir"
-update-alternatives \
- --install "$iceweasel_dir/libjavaplugin.so" \
- "iceweasel-javaplugin.so" \
- "$plugin_dir/libnpjp2.so" "$priority"
-
-# chromium
-chromium_dir="/usr/lib/chromium/plugins"
-[ -d "$chromium_dir" ] || install -d -m 755 "$chromium_dir"
-update-alternatives \
- --install "$chromium_dir/libjavaplugin.so" \
- "chromium-javaplugin.so" \
- "$plugin_dir/libnpjp2.so" "$priority"
-
+++ /dev/null
-suffix=j2re1.6-oracle
-j2se_base="/usr/lib/jre/$suffix"
-
-if [ ! -e "$j2se_base/debian/info" ]; then
- exit 0
-fi
-
-# alternative <program>
-function program_alternative() {
- local program="$1"
- update-alternatives \
- --remove "$program" "$j2se_base/bin/$program"
-}
-
-program_alternative ControlPanel
-program_alternative java
-program_alternative javaws
-program_alternative keytool
-program_alternative orbd
-program_alternative pack200
-program_alternative policytool
-program_alternative rmid
-program_alternative rmiregistry
-program_alternative servertool
-program_alternative tnameserv
-program_alternative unpack200
-
-# derive the architecture-specific
-# directory for the plugin
-arch_dir="$(dpkg --print-architecture)"
-
-# assemble the plugin path
-plugin_dir="$j2se_base/lib/$arch_dir"
-
-# iceweasel
-update-alternatives \
- --remove "iceweasel-javaplugin.so" "$plugin_dir/libnpjp2.so"
-
-# chromium
-update-alternatives \
- --remove "chromium-javaplugin.so" "$plugin_dir/libnpjp2.so"
+++ /dev/null
-suffix=j2re1.7-oracle
-j2se_base="/usr/lib/jvm/$suffix"
-priority=318
-
-if [ ! -e "$j2se_base/debian/info" ]; then
- exit 0
-fi
-
-# alternative <program>
-function program_alternative() {
- local program="$1"
- update-alternatives \
- --install "/usr/bin/$program" "$program" \
- "$j2se_base/bin/$program" "$priority" \
- --slave "/usr/share/man/man1/$program.1.gz" "$program.1.gz" \
- "$j2se_base/man/man1/$program.1.gz"
-}
-
-# kinit, klist, and ktab not installed at this
-# time; handling of /etc/krb5.conf not addressed
-program_alternative ControlPanel
-program_alternative java
-program_alternative javaws
-program_alternative keytool
-program_alternative orbd
-program_alternative pack200
-program_alternative policytool
-program_alternative rmid
-program_alternative rmiregistry
-program_alternative servertool
-program_alternative tnameserv
-program_alternative unpack200
-
-# derive the architecture-specific
-# directory for the plugin
-arch_dir="$(dpkg --print-architecture)"
-
-# assemble the plugin path
-plugin_dir="$j2se_base/lib/$arch_dir"
-
-# iceweasel
-iceweasel_dir="/usr/lib/iceweasel/plugins"
-[ -d "$iceweasel_dir" ] || install -d -m 755 "$iceweasel_dir"
-update-alternatives \
- --install "$iceweasel_dir/libjavaplugin.so" \
- "iceweasel-javaplugin.so" \
- "$plugin_dir/libnpjp2.so" "$priority"
-
-# chromium
-chromium_dir="/usr/lib/chromium/plugins"
-[ -d "$chromium_dir" ] || install -d -m 755 "$chromium_dir"
-update-alternatives \
- --install "$chromium_dir/libjavaplugin.so" \
- "chromium-javaplugin.so" \
- "$plugin_dir/libnpjp2.so" "$priority"
-
+++ /dev/null
-suffix=j2re1.7-oracle
-j2se_base="/usr/lib/jre/$suffix"
-
-if [ ! -e "$j2se_base/debian/info" ]; then
- exit 0
-fi
-
-# alternative <program>
-function program_alternative() {
- local program="$1"
- update-alternatives \
- --remove "$program" "$j2se_base/bin/$program"
-}
-
-program_alternative ControlPanel
-program_alternative java
-program_alternative javaws
-program_alternative keytool
-program_alternative orbd
-program_alternative pack200
-program_alternative policytool
-program_alternative rmid
-program_alternative rmiregistry
-program_alternative servertool
-program_alternative tnameserv
-program_alternative unpack200
-
-# derive the architecture-specific
-# directory for the plugin
-arch_dir="$(dpkg --print-architecture)"
-
-# assemble the plugin path
-plugin_dir="$j2se_base/lib/$arch_dir"
-
-# iceweasel
-update-alternatives \
- --remove "iceweasel-javaplugin.so" "$plugin_dir/libnpjp2.so"
-
-# chromium
-update-alternatives \
- --remove "chromium-javaplugin.so" "$plugin_dir/libnpjp2.so"
+++ /dev/null
-j2se_base="/usr/share/doc/j2sdk1.6-oracle-doc"
-priority=316
-
-if [ ! -e "$j2se_base/debian/info" ]; then
- exit 0
-fi
-
-# Register the documentation with the various
-# documentation systems, i.e. dhelp and dwww.
-
-if [ "$1" = configure ] ; then
- if which install-docs >/dev/null 2>&1; then
- install-docs -i /usr/share/doc-base/oracle-j2sdk1.6-doc
- fi
-fi
-
+++ /dev/null
-j2se_base="/usr/share/doc/j2sdk1.6-oracle-doc"
-
-if [ ! -e "$j2se_base/debian/info" ]; then
- exit 0
-fi
-
-
+++ /dev/null
-suffix=j2sdk1.6-oracle
-j2se_base="/usr/lib/jvm/$suffix"
-priority=315
-
-if [ ! -e "$j2se_base/debian/info" ]; then
- exit 0
-fi
-
-# alternative <program>
-function program_alternative() {
- local program="$1"
- update-alternatives \
- --install "/usr/bin/$program" "$program" \
- "$j2se_base/bin/$program" "$priority" \
- --slave "/usr/share/man/man1/$program.1.gz" "$program.1.gz" \
- "$j2se_base/man/man1/$program.1.gz"
-}
-
-# alternative <program> without man page
-function program_alternative_no_man() {
- local program="$1"
- update-alternatives \
- --install "/usr/bin/$program" "$program" \
- "$j2se_base/bin/$program" "$priority"
-}
-
-# kinit, klist, and ktab not installed at this
-# time; handling of /etc/krb5.conf not addressed
-# JRE-specific alternatives with JDKs cannot be
-# handled by our current approach
-program_alternative appletviewer
-program_alternative_no_man ControlPanel
-program_alternative extcheck
-program_alternative idlj
-program_alternative jar
-program_alternative jarsigner
-program_alternative java
-program_alternative javac
-program_alternative javadoc
-program_alternative javah
-program_alternative javap
-program_alternative javaws
-program_alternative jconsole
-program_alternative jdb
-program_alternative jinfo
-program_alternative jmap
-program_alternative jps
-program_alternative jsadebugd
-program_alternative jstack
-program_alternative jstat
-program_alternative jstatd
-program_alternative keytool
-program_alternative native2ascii
-program_alternative orbd
-program_alternative pack200
-program_alternative policytool
-program_alternative rmic
-program_alternative rmid
-program_alternative rmiregistry
-program_alternative serialver
-program_alternative servertool
-program_alternative tnameserv
-program_alternative unpack200
-
-# derive the architecture-specific
-# directory for the plugin
-arch_dir="$(dpkg --print-architecture)"
-
-# assemble the plugin path
-plugin_dir="$j2se_base/jre/lib/$arch_dir"
-
-# iceweasel
-iceweasel_dir="/usr/lib/iceweasel/plugins"
-[ -d "$iceweasel_dir" ] || install -d -m 755 "$iceweasel_dir"
-update-alternatives \
- --install "$iceweasel_dir/libjavaplugin.so" \
- "iceweasel-javaplugin.so" \
- "$plugin_dir/libnpjp2.so" "$priority"
-
-# chromium
-chromium_dir="/usr/lib/chromium/plugins"
-[ -d "$chromium_dir" ] || install -d -m 755 "$chromium_dir"
-update-alternatives \
- --install "$chromium_dir/libjavaplugin.so" \
- "chromium-javaplugin.so" \
- "$plugin_dir/libnpjp2.so" "$priority"
-
+++ /dev/null
-suffix=j2sdk1.6-oracle
-j2se_base="/usr/lib/jvm/$suffix"
-
-if [ ! -e "$j2se_base/debian/info" ]; then
- exit 0
-fi
-
-# alternative <program>
-function program_alternative() {
- local program="$1"
- update-alternatives \
- --remove "$program" "$j2se_base/bin/$program"
-}
-
-program_alternative appletviewer
-program_alternative ControlPanel
-program_alternative extcheck
-program_alternative idlj
-program_alternative jar
-program_alternative jarsigner
-program_alternative java
-program_alternative javac
-program_alternative javadoc
-program_alternative javah
-program_alternative javap
-program_alternative java-rmi.cgi
-program_alternative javaws
-program_alternative jconsole
-program_alternative jdb
-program_alternative jinfo
-program_alternative jmap
-program_alternative jps
-program_alternative jsadebugd
-program_alternative jstack
-program_alternative jstat
-program_alternative jstatd
-program_alternative keytool
-program_alternative native2ascii
-program_alternative orbd
-program_alternative pack200
-program_alternative policytool
-program_alternative rmic
-program_alternative rmid
-program_alternative rmiregistry
-program_alternative serialver
-program_alternative servertool
-program_alternative tnameserv
-program_alternative unpack200
-
-# derive the architecture-specific
-# directory for the plugin
-arch_dir="$(dpkg --print-architecture)"
-
-# assemble the plugin path
-plugin_dir="$j2se_base/jre/lib/$arch_dir"
-
-# iceweasel
-update-alternatives \
- --remove "iceweasel-javaplugin.so" "$plugin_dir/libnpjp2.so"
-
-# chromium
-update-alternatives \
- --remove "chromium-javaplugin.so" "$plugin_dir/libnpjp2.so"
+++ /dev/null
-j2se_base="/usr/share/doc/j2sdk1.7-oracle-doc"
-priority=318
-
-if [ ! -e "$j2se_base/debian/info" ]; then
- exit 0
-fi
-
-# Register the documentation with the various
-# documentation systems, i.e. dhelp and dwww.
-
-if [ "$1" = configure ] ; then
- if which install-docs >/dev/null 2>&1; then
- install-docs -i /usr/share/doc-base/oracle-j2sdk1.7-doc
- fi
-fi
-
+++ /dev/null
-j2se_base="/usr/share/doc/j2sdk1.7-oracle-doc"
-
-if [ ! -e "$j2se_base/debian/info" ]; then
- exit 0
-fi
-
-
+++ /dev/null
-suffix=j2sdk1.7-oracle
-j2se_base="/usr/lib/jvm/$suffix"
-priority=317
-
-if [ ! -e "$j2se_base/debian/info" ]; then
- exit 0
-fi
-
-# alternative <program>
-function program_alternative() {
- local program="$1"
- update-alternatives \
- --install "/usr/bin/$program" "$program" \
- "$j2se_base/bin/$program" "$priority" \
- --slave "/usr/share/man/man1/$program.1.gz" "$program.1.gz" \
- "$j2se_base/man/man1/$program.1.gz"
-}
-
-# alternative <program> without man page
-function program_alternative_no_man() {
- local program="$1"
- update-alternatives \
- --install "/usr/bin/$program" "$program" \
- "$j2se_base/bin/$program" "$priority"
-}
-
-# kinit, klist, and ktab not installed at this
-# time; handling of /etc/krb5.conf not addressed
-# JRE-specific alternatives with JDKs cannot be
-# handled by our current approach
-program_alternative appletviewer
-program_alternative_no_man ControlPanel
-program_alternative extcheck
-program_alternative idlj
-program_alternative jar
-program_alternative jarsigner
-program_alternative java
-program_alternative javac
-program_alternative javadoc
-program_alternative javah
-program_alternative javap
-program_alternative_no_man java-rmi.cgi
-program_alternative javaws
-program_alternative jconsole
-program_alternative jdb
-program_alternative jinfo
-program_alternative jmap
-program_alternative jps
-program_alternative jsadebugd
-program_alternative jstack
-program_alternative jstat
-program_alternative jstatd
-program_alternative keytool
-program_alternative native2ascii
-program_alternative orbd
-program_alternative pack200
-program_alternative policytool
-program_alternative rmic
-program_alternative rmid
-program_alternative rmiregistry
-program_alternative serialver
-program_alternative servertool
-program_alternative tnameserv
-program_alternative unpack200
-
-# derive the architecture-specific
-# directory for the plugin
-arch_dir="$(dpkg --print-architecture)"
-
-# assemble the plugin path
-plugin_dir="$j2se_base/jre/lib/$arch_dir"
-
-# iceweasel
-iceweasel_dir="/usr/lib/iceweasel/plugins"
-[ -d "$iceweasel_dir" ] || install -d -m 755 "$iceweasel_dir"
-update-alternatives \
- --install "$iceweasel_dir/libjavaplugin.so" \
- "iceweasel-javaplugin.so" \
- "$plugin_dir/libnpjp2.so" "$priority"
-
-# chromium
-chromium_dir="/usr/lib/chromium/plugins"
-[ -d "$chromium_dir" ] || install -d -m 755 "$chromium_dir"
-update-alternatives \
- --install "$chromium_dir/libjavaplugin.so" \
- "chromium-javaplugin.so" \
- "$plugin_dir/libnpjp2.so" "$priority"
-
+++ /dev/null
-suffix=j2sdk1.7-oracle
-j2se_base="/usr/lib/jvm/$suffix"
-
-if [ ! -e "$j2se_base/debian/info" ]; then
- exit 0
-fi
-
-# alternative <program>
-function program_alternative() {
- local program="$1"
- update-alternatives \
- --remove "$program" "$j2se_base/bin/$program"
-}
-
-program_alternative appletviewer
-program_alternative ControlPanel
-program_alternative extcheck
-program_alternative idlj
-program_alternative jar
-program_alternative jarsigner
-program_alternative java
-program_alternative javac
-program_alternative javadoc
-program_alternative javah
-program_alternative javap
-program_alternative java-rmi.cgi
-program_alternative javaws
-program_alternative jconsole
-program_alternative jdb
-program_alternative jinfo
-program_alternative jmap
-program_alternative jps
-program_alternative jsadebugd
-program_alternative jstack
-program_alternative jstat
-program_alternative jstatd
-program_alternative keytool
-program_alternative native2ascii
-program_alternative orbd
-program_alternative pack200
-program_alternative policytool
-program_alternative rmic
-program_alternative rmid
-program_alternative rmiregistry
-program_alternative serialver
-program_alternative servertool
-program_alternative tnameserv
-program_alternative unpack200
-
-# derive the architecture-specific
-# directory for the plugin
-arch_dir="$(dpkg --print-architecture)"
-
-# assemble the plugin path
-plugin_dir="$j2se_base/jre/lib/$arch_dir"
-
-# iceweasel
-update-alternatives \
- --remove "iceweasel-javaplugin.so" "$plugin_dir/libnpjp2.so"
-
-# chromium
-update-alternatives \
- --remove "chromium-javaplugin.so" "$plugin_dir/libnpjp2.so"