diff options
author | Kyle Guinn <elyk03@gmail.com> | 2012-05-29 19:14:10 -0400 |
---|---|---|
committer | Erik Hanson <erik@slackbuilds.org> | 2012-06-03 15:21:12 -0500 |
commit | 4d80a1caa74e63debe3234358252c46bf7982024 (patch) | |
tree | f3ff85833115b957e2d851d1cba0c671058465ac | |
parent | 3359bbdb4a1e56448e81a53a1ea9cafb1ed92eb6 (diff) | |
download | slackbuilds-4d80a1caa74e63debe3234358252c46bf7982024.tar.gz |
multimedia/gnash: Added (SWF movie player)
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
-rw-r--r-- | multimedia/gnash/README | 6 | ||||
-rw-r--r-- | multimedia/gnash/doinst.sh | 37 | ||||
-rw-r--r-- | multimedia/gnash/gnash.SlackBuild | 117 | ||||
-rw-r--r-- | multimedia/gnash/gnash.info | 10 | ||||
-rw-r--r-- | multimedia/gnash/patch/gnash-0.8.10-cve-2012-1175.patch | 63 | ||||
-rw-r--r-- | multimedia/gnash/patch/gnash-0.8.10-kde4-libdir.patch | 12 | ||||
-rw-r--r-- | multimedia/gnash/patch/gnash-0.8.10-klash.patch | 12 | ||||
-rw-r--r-- | multimedia/gnash/slack-desc | 19 |
8 files changed, 276 insertions, 0 deletions
diff --git a/multimedia/gnash/README b/multimedia/gnash/README new file mode 100644 index 0000000000..06c3725d80 --- /dev/null +++ b/multimedia/gnash/README @@ -0,0 +1,6 @@ +Gnash is the GNU SWF movie player, which can be run standalone on the +desktop or an embedded device, as well as as a plugin for several browsers. + +This requires: agg and xulrunner. + +Optional but recommended: speex, ffmpeg, gst-ffmpeg, and gst-plugins-ugly diff --git a/multimedia/gnash/doinst.sh b/multimedia/gnash/doinst.sh new file mode 100644 index 0000000000..c2e0f8a9fd --- /dev/null +++ b/multimedia/gnash/doinst.sh @@ -0,0 +1,37 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} + +preserve_perms etc/gnashpluginrc.new +preserve_perms etc/gnashthumbnailrc.new +preserve_perms etc/gnashrc.new + +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi diff --git a/multimedia/gnash/gnash.SlackBuild b/multimedia/gnash/gnash.SlackBuild new file mode 100644 index 0000000000..6cd548e10c --- /dev/null +++ b/multimedia/gnash/gnash.SlackBuild @@ -0,0 +1,117 @@ +#!/bin/sh + +# Slackware build script for gnash + +# Copyright 2012 Kyle Guinn <elyk03@gmail.com>, USA +# All rights reserved. +# +# 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. + +PRGNAM=gnash +VERSION=${VERSION:-0.8.10} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$(uname -m)" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$(uname -m) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +DOCS="ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS README* TODO" + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2 +cd $PRGNAM-$VERSION +chown -R root:root . +chmod -R u+w,go+r-w,a-st . + +# Fix paths for kde plugin and a cve patch. +# Ripped from gentoo +patch -p1 < $CWD/patch/gnash-0.8.10-klash.patch +patch -p1 < $CWD/patch/gnash-0.8.10-kde4-libdir.patch +patch -p1 < $CWD/patch/gnash-0.8.10-cve-2012-1175.patch + +autoreconf +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --infodir=/usr/info \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --build=$ARCH-slackware-linux \ + --enable-write \ + --without-gconf \ + --with-plugins-install=system \ + --with-kde4-incl=/usr/include \ + --with-kde4-configdir=/usr/share/config \ + --with-kde4-prefix=/usr \ + --with-kde4-lib=/usr/lib$LIBDIRSUFFIX \ + --with-kde-appsdatadir=/usr/share/apps/klash \ + --with-kde4-servicesdir=/usr/share/kde4/services + +make +make install-strip install-plugins DESTDIR=$PKG + +# make install-plugins doesn't strip the plugins. +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG/etc -type f -exec mv {} {}.new \; +find $PKG/usr/man -type f -exec gzip -9 {} \; + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/multimedia/gnash/gnash.info b/multimedia/gnash/gnash.info new file mode 100644 index 0000000000..7a7b7dae05 --- /dev/null +++ b/multimedia/gnash/gnash.info @@ -0,0 +1,10 @@ +PRGNAM="gnash" +VERSION="0.8.10" +HOMEPAGE="http://gnashdev.org/" +DOWNLOAD="ftp://mirrors.kernel.org/gnu/gnash/0.8.10/gnash-0.8.10.tar.bz2" +MD5SUM="63e9f79c41d93d48c5a2fa94856548c4" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +MAINTAINER="Kyle Guinn" +EMAIL="elyk03@gmail.com" +APPROVED="dsomero" diff --git a/multimedia/gnash/patch/gnash-0.8.10-cve-2012-1175.patch b/multimedia/gnash/patch/gnash-0.8.10-cve-2012-1175.patch new file mode 100644 index 0000000000..9a218d9216 --- /dev/null +++ b/multimedia/gnash/patch/gnash-0.8.10-cve-2012-1175.patch @@ -0,0 +1,63 @@ +From bb4dc77eecb6ed1b967e3ecbce3dac6c5e6f1527 Mon Sep 17 00:00:00 2001 +From: Benjamin Wolsey <bwy@benjaminwolsey.de> +Date: Sat, 10 Mar 2012 14:52:50 +0000 +Subject: Fix crash in GnashImage.cpp + +--- +diff --git a/libbase/GnashImage.cpp b/libbase/GnashImage.cpp +index 11c6956..03a6939 100644 +--- a/libbase/GnashImage.cpp ++++ b/libbase/GnashImage.cpp +@@ -26,6 +26,7 @@ + #include <boost/scoped_array.hpp> + #include <boost/shared_ptr.hpp> + #include <algorithm> ++#include <cassert> + + #ifdef USE_PNG + # include "GnashImagePng.h" +@@ -44,6 +45,21 @@ namespace image { + + namespace { + void processAlpha(GnashImage::iterator imageData, size_t pixels); ++ bool checkValidSize(size_t width, size_t height, size_t channels) { ++ ++ if (width == 0 || height == 0) return false; ++ ++ assert(channels > 0); ++ ++ boost::uint32_t maxSize = std::numeric_limits<boost::int32_t>::max(); ++ if (width >= maxSize || height >= maxSize) return false; ++ ++ maxSize /= channels; ++ maxSize /= width; ++ maxSize /= height; ++ ++ return maxSize > 0; ++ } + } + + GnashImage::GnashImage(iterator data, size_t width, size_t height, +@@ -55,6 +71,8 @@ GnashImage::GnashImage(iterator data, size_t width, size_t height, + _height(height), + _data(data) + { ++ // Callers should check dimensions ++ assert(checkValidSize(_width, _height, channels())); + } + + /// Create an image allocating a buffer of height*pitch bytes +@@ -66,8 +84,9 @@ GnashImage::GnashImage(size_t width, size_t height, ImageType type, + _width(width), + _height(height) + { +- const size_t max = std::numeric_limits<boost::int32_t>::max(); +- if (size() > max) { ++ // Constructed from external input, so restrict dimensions to avoid ++ // overflow in size calculations ++ if (!checkValidSize(_width, _height, channels())) { + throw std::bad_alloc(); + } + _data.reset(new value_type[size()]); +-- +cgit v0.9.0.2 diff --git a/multimedia/gnash/patch/gnash-0.8.10-kde4-libdir.patch b/multimedia/gnash/patch/gnash-0.8.10-kde4-libdir.patch new file mode 100644 index 0000000000..b3279441d2 --- /dev/null +++ b/multimedia/gnash/patch/gnash-0.8.10-kde4-libdir.patch @@ -0,0 +1,12 @@ +diff -ur a/macros/kde4.m4 b/macros/kde4.m4 +--- a/macros/kde4.m4 2011-02-26 19:11:08.000000000 +0100 ++++ b/macros/kde4.m4 2011-11-25 18:09:25.000000000 +0100 +@@ -198,7 +198,7 @@ + if test -d ${KDE4_PREFIX}/lib64 -a -f /etc/redhat-release; then + KDE4_PLUGINDIR="${KDE4_PREFIX}/lib64/kde4" + else +- KDE4_PLUGINDIR="${KDE4_PREFIX}/lib/kde4" ++ KDE4_PLUGINDIR="${KDE4_PREFIX}/${acl_libdirstem}/kde4" + fi + fi + if test x"${with_kde4_servicesdir}" != x ; then diff --git a/multimedia/gnash/patch/gnash-0.8.10-klash.patch b/multimedia/gnash/patch/gnash-0.8.10-klash.patch new file mode 100644 index 0000000000..e6afec04d2 --- /dev/null +++ b/multimedia/gnash/patch/gnash-0.8.10-klash.patch @@ -0,0 +1,12 @@ +diff -ur a/macros/kde4.m4 b/macros/kde4.m4 +--- a/macros/kde4.m4 2011-02-26 19:11:08.000000000 +0100 ++++ b/macros/kde4.m4 2011-03-21 00:04:38.845997945 +0100 +@@ -210,7 +210,7 @@ + KDE4_CONFIGDIR="${KDE4_PREFIX}/share/kde4/config" + fi + if test x"${KDE4_APPSDATADIR}" = x ; then +- KDE4_APPSDATADIR="${KDE4_PREFIX}/share/kde4/apps/klash" ++ KDE4_APPSDATADIR="${KDE4_PREFIX}/share/apps/klash" + fi + + if test x"${ac_cv_path_kde4_incl}" != x ; then diff --git a/multimedia/gnash/slack-desc b/multimedia/gnash/slack-desc new file mode 100644 index 0000000000..f75f5c3f5b --- /dev/null +++ b/multimedia/gnash/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +gnash: Gnash (SWF movie player) +gnash: +gnash: Gnash is the GNU SWF movie player, which can be run standalone on the +gnash: desktop or an embedded device, as well as as a plugin for several +gnash: browsers. +gnash: +gnash: +gnash: +gnash: +gnash: +gnash: |