#!/bin/sh # postinst script for flashplugin-nonfree # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-deconfigure' `in-favour' # `removing' # # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package # . /usr/share/debconf/confmodule # previously : FP9_plugin_beta_112006.tar.gz and flash-player-plugin-9.0.21.78/ # currently : install_flash_player_9_linux.tar.gz and install_flash_player_9_linux/ fp_exit_with_error() { echo $1 echo "The Flash plugin is NOT installed." db_fset flashplugin-nonfree/local seen false db_fset flashplugin-nonfree/httpget seen false db_set flashplugin-nonfree/httpget false exit 0 # still install the Debian package, undoes the fix for #387263 } fp_download_and_unpack() { cd /var/cache/flashplugin-nonfree db_get flashplugin-nonfree/local if [ -d "$RET" -a -f "$RET"/install_flash_player_9_linux.tar.gz ]; then echo "Installing from local file $RET/install_flash_player_9_linux.tar.gz" cp -f -p "$RET"/install_flash_player_9_linux.tar.gz install_flash_player_9_linux.tar.gz_TEMP mv -f install_flash_player_9_linux.tar.gz_TEMP install_flash_player_9_linux.tar.gz else # no local file db_get flashplugin-nonfree/httpget if [ "$RET" != "true" ]; then fp_exit_with_error "download or license refused" fi # setting wget options :> wgetrc echo "noclobber = off" >> wgetrc echo "dir_prefix = ." >> wgetrc echo "dirstruct = off" >> wgetrc echo "verbose = on" >> wgetrc echo "progress = dot:default" >> wgetrc # downloading the plugin echo "Downloading..." rm -f install_flash_player_9_linux.tar.gz if [ -f /home/bart/src/flashplugin-nonfree/bartm_debug ]; then WGETRC=wgetrc wget http://127.0.0.1/bart/install_flash_player_9_linux.tar.gz \ || fp_exit_with_error "download failed" else WGETRC=wgetrc wget http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_9_linux.tar.gz \ || fp_exit_with_error "download failed" fi rm -f wgetrc echo "Download done." fi # end if local file # verify MD5 checksum of (copied or downloaded) tarball rm -rf install_flash_player_9_linux/ echo "821cc72359a937caef85bb4cc74ef5cd install_flash_player_9_linux.tar.gz"| md5sum -c > /dev/null 2>&1 \ || fp_exit_with_error "md5sum mismatch install_flash_player_9_linux.tar.gz" # unpacking and checking the plugin tar xzf install_flash_player_9_linux.tar.gz || fp_exit_with_error "cannot unpack plugin" echo "be5a2f9032f8fc8bccbbf5d96c5028f9 install_flash_player_9_linux/libflashplayer.so"| md5sum -c > /dev/null 2>&1 \ || fp_exit_with_error "plugin changed, not trusted" echo "a81fd3b03b8c6d6e5a14298110718d3f install_flash_player_9_linux/flashplayer.xpt"| md5sum -c > /dev/null 2>&1 \ || fp_exit_with_error "plugin changed, not trusted" } OLDDIR=/usr/lib/flashplugin-nonfree-unpackdir NEWDIR=/var/cache/flashplugin-nonfree safe_move() { [ ! -f $OLDDIR/$1 ] || [ -f $NEWDIR/$1 ] || mv $OLDDIR/$1 $NEWDIR/$1 2> /dev/null || true [ ! -f $OLDDIR/$1 ] || [ ! -f $NEWDIR/$1 ] || rm -f $OLDDIR/$1 2> /dev/null || true } case "$1" in configure) fp_download_and_unpack install -m 644 install_flash_player_9_linux/libflashplayer.so /usr/lib/flashplugin-nonfree/ rm -rf install_flash_player_9_linux/ echo "Flash Plugin installed." if test ! -x /usr/bin/nspluginwrapper; then for p in iceape iceweasel mozilla firefox xulrunner; do update-alternatives --install "/usr/lib/$p/plugins/flashplugin-alternative.so" "$p-flashplugin" /usr/lib/flashplugin-nonfree/libflashplayer.so 50; done else NSPLUGIN_DIR=/var/lib/flashplugin-nonfree/ /usr/bin/nspluginwrapper -n -i /usr/lib/flashplugin-nonfree/libflashplayer.so for p in iceape iceweasel mozilla firefox xulrunner; do update-alternatives --install "/usr/lib/$p/plugins/flashplugin-alternative.so" "$p-flashplugin" /usr/lib/flashplugin-nonfree/libflashplayer.so 50; done fi safe_move FP9_plugin_beta_101806.tar.gz safe_move FP9_plugin_beta_112006.tar.gz safe_move install_flash_player_7_linux.tar.gz safe_move install_flash_player_9_linux.tar.gz rmdir $OLDDIR 2> /dev/null || true db_fset flashplugin-nonfree/local seen false db_fset flashplugin-nonfree/httpget seen false db_set flashplugin-nonfree/httpget false ;; abort-upgrade|abort-remove|abort-deconfigure) echo "postinst called with argument \`$1'" >&2 exit 1 ;; *) 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. exit 0 # vim: ts=2 sw=2