~ubuntu-branches/ubuntu/vivid/icedtea-web/vivid

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
#!/bin/sh -e

PATH=/sbin:/bin:/usr/sbin:/usr/bin

multiarch=@multiarch@
priority=@priority@
browser_dirs="@browser_dirs@"
PLUGIN=@plugin_name@
basedir=/@basedir@
old_basedir=/usr/lib/jvm/java-6/openjdk
PLUGINPTH=$basedir/jre/lib/@archdir@/$PLUGIN
OLD_PLUGINPTH=$old_basedir/jre/lib/@archdir@/$PLUGIN
NPPLUGINPTH=$basedir/jre/lib/@archdir@/IcedTeaNPPlugin.so
LAST_NPP_VERSION=6b18~pre2-2

case "$1" in
    configure)
	# IcedTeaPlugin -> IcedTeaNPPlugin update
	plugin_update=
	if [ -n "$LAST_NPP_VERSION" ] && [ "$1" = configure ] && [ -n "$2" ]; then
	    plugin_update=$(dpkg --compare-versions "$2" lt "$LAST_NPP_VERSION" && echo yes || echo no)
	fi

	for browser_dir in $browser_dirs; do
	    if [ $browser_dir = xulrunner-addons ]; then
		browser=xulrunner-1.9
	    else
		browser=$browser_dir
	    fi

	    if [ "$plugin_update" = yes ]; then
		update-alternatives --quiet --remove \
		    $browser-javaplugin.so \
		    $NPPLUGINPTH || true
	    fi

	    if [ -n "$multiarch" ] && [ "$DPKG_MAINTSCRIPT_ARCH" != $(dpkg --print-architecture) ]; then
		priority=$(expr $priority - 1)
	    fi

            if [ -n "$multiarch" ] && [ -n "$2" ]; then
                if [ -n "$(update-alternatives --list $browser-javaplugin.so 2>/dev/null | grep ^$old_basedir/)" ]; then
		    update-alternatives --remove $browser-javaplugin.so $OLD_PLUGINPTH || true
                fi
	    fi

            if [ -z "$(update-alternatives --list $browser-javaplugin.so 2>/dev/null | grep ^$basedir/)" ]; then
		update-alternatives --quiet --install \
		    /usr/lib/$browser_dir/plugins/libjavaplugin.so \
		    $browser-javaplugin.so \
		    $PLUGINPTH \
		    $priority
	    fi
	done
esac

#DEBHELPER#

exit 0