File update.sh of Package flash-player.import4399

#!/bin/bash
# vim: sw=4 et

t=$(mktemp  -d XXXXXXX)

set -x
set -e

pushd $t &>/dev/null

    tar xf ../install_flash_player_10*_linux.tar.bz2 libflashplayer.so
    md5sum libflashplayer.so > ORIG_FLASH
    rm -f libflashplayer.so
    wget -q http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz
    tar xf install_flash_player_10_linux.tar.gz
    md5sum libflashplayer.so > NEW_FLASH

    if cmp -s ORIG_FLASH NEW_FLASH; then

        echo "no new update available"

    else
        echo "*** NEW flashplugin UPDATE AVAILABLE!"
        version=$(strings  libflashplayer.so | grep "LNX 10," |cut -d' ' -f2 | sed -e 's#,#.#g')
        echo "new version is $version"
        mv install_flash_player_10_linux.tar.gz install_flash_player_${version}_linux.tar.gz
        bznew install_flash_player_${version}_linux.tar.gz
        mv install_flash_player_${version}_linux.tar.bz2 ..
        sed -i -e "s,Version:.*,Version:        $version," ../flash-player.spec
        ( cd ..; 
        osc vc -m "Update to $version: (bnc#XXXXXX)"
        )
    fi

    tar xf ../flashplayer_*_sa.tar.bz2 flashplayer
    md5sum flashplayer > ORIG_FLASH
    rm -f flashplayer
    wget -q http://download.macromedia.com/pub/flashplayer/updaters/10/flashplayer_10_sa.tar.gz
    tar xf flashplayer_10_sa.tar.gz
    md5sum flashplayer > NEW_FLASH

    if cmp -s ORIG_FLASH NEW_FLASH; then

        echo "no new update available"

    else
        echo "*** NEW flashplayer UPDATE AVAILABLE!"
        version=$(strings  flashplayer | grep "LNX 10," |cut -d' ' -f2 | sed -e 's#,#.#g')
        echo "new version is $version"
        mv flashplayer_10_sa.tar.gz flashplayer_${version}_sa.tar.gz
        bznew flashplayer_${version}_sa.tar.gz
        mv flashplayer_${version}_sa.tar.bz2 ..
    fi


popd &>/dev/null
rm -rf $t
openSUSE Build Service is sponsored by