LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File update.sh of Package flash-player (Project openSUSE:Factory:NonFree)

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

t=$(mktemp  -d XXXXXXX)

set -e

pushd $t &>/dev/null


    tar xf ../install_flash_player_11*_linux.i386.tar.bz2 libflashplayer.so
    md5sum libflashplayer.so > ORIG_FLASH
    rm -f libflashplayer.so
    # fetch the current download url
    download_url=$(curl -s 'http://get.adobe.com/flashplayer/completion/?installer=Flash_Player_11.2_for_other_Linux_(.tar.gz)_32-bit' | egrep  -o 'http:\/\/fpdownload.macromedia.com\/get\/flashplayer\/pdc\/11.*\/install_flash_player_11_linux_i386.tar.gz')
    echo "Trying download $download_url";
    wget $download_url
    tar xf install_flash_player_11_linux_i386.tar.gz libflashplayer.so
    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 11," |cut -d' ' -f2 | sed -e 's#,#.#g')
        echo "new version is $version"
        download_url=$(echo $download_url | sed -e 's,i386,ARCH,')

        for arch in i386 x86_64; do
            wget -q $(echo $download_url | sed -e "s,ARCH,$arch,")
            mv install_flash_player_11_linux_$arch.tar.gz install_flash_player_${version}_linux.$arch.tar.gz
            bznew install_flash_player_${version}_linux.$arch.tar.gz
            mv install_flash_player_${version}_linux.$arch.tar.bz2 ..
        done
        sed -i -e "s,Version:.*,Version:        $version," ../flash-player.spec
        ( cd ..; 
        osc vc -m "Update to $version: (bnc#XXXXXX)"
        )
    fi

    for arch in i386; do
        tar xf ../flashplayer_*_sa.$arch.tar.bz2 flashplayer
        md5sum flashplayer > ORIG_FLASH
        rm -rf install_flash_player_linux_sa
        wget http://fpdownload.macromedia.com/pub/flashplayer/updaters/11/flashplayer_11_sa.$arch.tar.gz
        tar xvf flashplayer_11_sa.$arch.tar.gz
        md5sum install_flash_player_linux_sa/flashplayer > NEW_FLASH
        rm -rf install_flash_player_linux_sa

        if cmp -s ORIG_FLASH NEW_FLASH; then

            echo "no new update available"

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

popd &>/dev/null
rm -rf $t