#!/bin/sh
# prerm script for flashplugin-nonfree
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <prerm> `remove'
# * <old-prerm> `upgrade' <new-version>
# * <new-prerm> `failed-upgrade' <old-version>
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
# * <deconfigured's-prerm> `deconfigure' `in-favour'
# <package-being-installed> <version> `removing'
# <conflicting-package> <version>
# for details, see
http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
VARIANTS="iceape iceweasel mozilla firefox xulrunner midbrowser xulrunner-addons"
case "$1" in
remove)
update-rc.d -f flashplugin-nonfree remove >/dev/null 2>&1
rm -rf /usr/lib/flashplugin-nonfree-unpackdir
rm -rf /usr/lib/flashplugin-nonfree/*
rm -f /var/lib/flashplugin-nonfree/*
rm -rf /var/cache/flashplugin-nonfree-unpackdir
rm -rf /var/cache/flashplugin-nonfree
for p in $VARIANTS; do
update-alternatives --remove "$p-flashplugin" /usr/lib/flashplugin-nonfree/libflashplayer.so;
done
for p in $VARIANTS; do
update-alternatives --remove "$p-flashplugin" /var/lib/flashplugin-nonfree/npwrapper.libflashplayer.so;
done
for p in $VARIANTS; do
[ `update-alternatives --list "$p-flashplugin" | wc -l` = 0 ] && \
update-alternatives --remove-all "$p-flashplugin"
done
;;
upgrade|deconfigure)
update-rc.d -f flashplugin-nonfree remove >/dev/null 2>&1
rm -rf /usr/lib/flashplugin-nonfree-unpackdir
rm -rf /usr/lib/flashplugin-nonfree/*
rm -f /var/lib/flashplugin-nonfree/*
rm -f /var/cache/flashplugin-nonfree/libflashplayer.so
rm -f /var/cache/flashplugin-nonfree/flashplayer.xpt
for p in $VARIANTS; do
update-alternatives --remove "$p-flashplugin" /usr/lib/flashplugin-nonfree/libflashplayer.so;
done
for p in $VARIANTS; do
update-alternatives --remove "$p-flashplugin" /var/lib/flashplugin-nonfree/npwrapper.libflashplayer.so;
done
for p in $VARIANTS; do
[ `update-alternatives --list "$p-flashplugin" | wc -l` = 0 ] && \
update-alternatives --remove-all "$p-flashplugin"
done
;;
failed-upgrade)
if dpkg --compare-versions "$2" ">>" 9.0.48.0.0ubuntu4 &&
dpkg --compare-versions "$2" "<<" 9.0.48.0.0ubuntu8
then
update-rc.d -f flashplugin-nonfree remove >/dev/null 2>&1
rm -rf /usr/lib/flashplugin-nonfree-unpackdir
rm -rf /usr/lib/flashplugin-nonfree
rm -f /var/lib/flashplugin-nonfree/*
rm -f /var/cache/flashplugin-nonfree/libflashplayer.so
rm -f /var/cache/flashplugin-nonfree/flashplayer.xpt
for p in $VARIANTS; do
update-alternatives --remove "$p-flashplugin" /usr/lib/flashplugin-nonfree/libflashplayer.so;
done
for p in $VARIANTS; do
update-alternatives --remove "$p-flashplugin" /var/lib/flashplugin-nonfree/npwrapper.libflashplayer.so;
done
for p in $VARIANTS; do
[ `update-alternatives --list "$p-flashplugin" | wc -l` = 0 ] && \
update-alternatives --remove-all "$p-flashplugin"
done
else
cho "prerm called with argument \`$1'" >&2
exit 1
fi
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
exit 0
# vim: ts=2 sw=2