#!/bin/sh # Heavily based on the Slackware 13.37 SlackBuild (v1) # Written by Loris Vincenzi (http://www.slacky.eu) # Last build from Savino Pio Liguori ( jimmy_page_89 AT hotmail DOT it ) # Slackware build script for flash-player-plugin # Official Site: http://www.adobe.com # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: # # 1. Redistributions of this script must retain the above copyright # notice, this list of conditions and the following disclaimer. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. set -e PKGNAME=flash-player-plugin VERSION=${VERSION:-11.2} # Set no if is a standard release BETAVERSION=${BETAVERSION:-b2} BUILD=${BUILD:-1} TAG=${TAG:-sl} ARCH=${ARCH:-x86_64} LAHF_FIX=${LAHF_FIX:-yes} if [ -e EULA.TXT ];then more EULA.TXT echo "Do you accept terms? (yes/[no])" read ACCEPT if [ "$ACCEPT" != "yes" ];then echo; echo "SlackBuild Aborted!!" exit 1 fi fi case "$ARCH" in i?86) DSUFF="i386" if [ "$BETAVERSION" != "no" ]; then DSUFF="32" fi LIBDIRSUFFIX="" ARCH=i386 ;; x86_64) DSUFF="x86_64" if [ ! "$BETAVERSION" = "no" ]; then DSUFF="64" fi LIBDIRSUFFIX="64" ;; esac SOURCE="http://download.macromedia.com/pub/labs/flashplatformruntimes/flashplayer11-2/flashplayer11-2_p2_install_lin_${DSUFF}_112211.tar.gz" # If stable #SOURCE="http://fpdownload.macromedia.com/get/flashplayer/pdc/$VERSION/install_flash_player_$MAINVERSION_linux.$DSUFF.tar.gz" TAR= DIR= CWD=$(pwd) PKG=$TMP/package-$PKGNAME OUTPUT=${OUTPUT:-$CWD} TAR=${TAR:-$(basename $SOURCE)} DIR=${DIR:-$(echo "$TAR"|sed -r 's/(\.tar|)(.gz|.bz2|.tgz|)$//')} if [ ! -e $CWD/$TAR ];then wget $SOURCE fi rm -rf $PKG mkdir -p $PKG $OUTPUT cd $PKG tar xvf $CWD/$TAR chown -R root:root . chmod -R u+w,go+r-w,a-s . mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/mozilla/plugins install -m 0755 libflashplayer.so $PKG/usr/lib$LIBDIRSUFFIX/mozilla/plugins install -m 0644 $CWD/flash-player-properties.desktop $PKG/usr/share/applications # Compile a signal wrapper which intercepts lahf calls in flashplayer code. # On old x86-64 processors (Athlon64 and Athlon FX socket 754/939) this # instruction is not present and the flash plugin will bail out with an "illegal # instruction" exception without the following patch. # Wrapper provided by Maks Verver. # Note: I don't know if this is still needed in version 11 of the plugin, but it shouldn't # harm nevertheless. if [ "$LAHF_FIX" = yes -a -e "$CWD/flashplugin-lahf-fix.c" ] then #BUILD+=_LAHF echo "Compiling LAHF wrapper..." cc -fPIC -shared -nostdlib -lc -o flashplugin-lahf-fix.so \ "${CWD}/flashplugin-lahf-fix.c" || exit 1 echo "Wrapper successfully compiled" install -m 0755 flashplugin-lahf-fix.so usr/lib$LIBDIRSUFFIX/mozilla/plugins rm flashplugin-lahf-fix.so fi VERSION+=$BETAVERSION mkdir -p $PKG/usr/doc/$PKGNAME-$VERSION cp -a \ readme.txt \ $PKG/usr/doc/$PKGNAME-$VERSION cat $CWD/$PKGNAME.SlackBuild > $PKG/usr/doc/$PKGNAME-$VERSION/$PKGNAME.SlackBuild cat $CWD/slack-desc > $PKG/usr/doc/$PKGNAME-$VERSION/slack-desc rm libflashplayer.so readme.txt if [ -d $PKG/usr/man ]; then ( cd $PKG/usr/man find . -type f -exec gzip -9 {} \; for i in $( find . -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done ) fi ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs -r strip --strip-unneeded 2> /dev/null || true ) mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc [ -e $CWD/doinst.sh ] && cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG chown -R root:root $PKG if [ -x "$(which requiredbuilder 2>/dev/null)" ];then requiredbuilder -y -v -s $CWD $PKG fi /sbin/makepkg -l y -c n $OUTPUT/$PKGNAME-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz} if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi