#!/bin/sh # postinst script for lliurex-dgti-defaults-configs # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see https://www.debian.org/doc/debian-policy/ or # the debian-policy package package='lliurex-dgti-defaults-configs' divert_file() { file=$1 theirfile=$2 if ! LC_ALL=C dpkg-divert --list "$package" | \ grep -xFq "diversion of $file to $theirfile by $package"; then dpkg-divert --divert "$theirfile" --rename --package "$package" --add "$file" fi } case "$1" in configure | abort-remove ) divert_file /usr/bin/firefox /usr/bin/firefox-latest divert_file /usr/share/applications/firefox-esr.desktop /usr/share/applications/firefox-esr.desktop.diverted divert_file /opt/firefox-esr/defaults/pref/lliurex-default.js /opt/firefox-esr/defaults/pref/lliurex-default.js.diverted if [ ! -e '/usr/bin/firefox' ]; then ln -s /opt/firefox-esr/firefoxESR /usr/bin/firefox fi alternative=$(readlink -f /etc/alternatives/java) oracle_value='/usr/lib/jvm/java-8-oracle/jre/bin/java' if [ '$alternative' != $oracle_value ]; then update-alternatives --set java $oracle_value fi alternative=$(readlink -f /etc/alternatives/mozilla-javaplugin.so) oracle_value='/usr/lib/jvm/java-8-oracle/jre/lib/amd64/libnpjp2.so' if [ '$alternative' != $oracle_value ]; then update-alternatives --set mozilla-javaplugin.so $oracle_value fi alternative=$(readlink -f /etc/alternatives/javaws) oracle_value='/usr/lib/jvm/java-8-oracle/jre/bin/javaws' if [ '$alternative' != $oracle_value ]; then update-alternatives --set javaws $oracle_value fi ;; abort-upgrade|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0