summaryrefslogtreecommitdiff
path: root/multimedia/MPlayer/MPlayer.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'multimedia/MPlayer/MPlayer.SlackBuild')
-rw-r--r--multimedia/MPlayer/MPlayer.SlackBuild94
1 files changed, 50 insertions, 44 deletions
diff --git a/multimedia/MPlayer/MPlayer.SlackBuild b/multimedia/MPlayer/MPlayer.SlackBuild
index 73cc7e266e..735574e34f 100644
--- a/multimedia/MPlayer/MPlayer.SlackBuild
+++ b/multimedia/MPlayer/MPlayer.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for MPlayer
-# Copyright 2006-2007 Robby Workman (http://rlworkman.net)
+# Copyright 2006-2008 Robby Workman, Northport, AL, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -26,16 +26,18 @@
# Thanks to Eric Hameleers for suggestions (and some code examples) :)
PRGNAM=MPlayer
-VERSION=1.0rc1
-PKGVERSION=$VERSION # This may change later in the script
+VERSION=1.0rc2
ARCH=${ARCH:-custom}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
+PKGVERSION=$VERSION # This may change later in the script
+
# If you installed the codecs package according to the instructions at
# the MPlayer website, you'll probably want to change this variable
# to /usr/local/lib/codecs. Otherwise, you'll want to leave it alone
@@ -63,31 +65,38 @@ OSDFONTS="Arialuni.ttf arial.ttf DejaVuSans.ttf Vera.ttf"
# when running the script: LANGUAGES=en ./MPlayer.SlackBuild
LANGUAGES=${LANGUAGES:-"en nl fr de es"}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
-elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686"
-fi
+set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
-cd $TMP || exit 1
+cd $TMP
rm -rf $PRGNAM-$VERSION
-tar -xjvf $CWD/$PRGNAM-$VERSION.tar.bz2 || exit 1
-cd $PRGNAM-$VERSION || exit 1
+tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
+cd $PRGNAM-$VERSION
chown -R root:root .
-chmod -R a-s,u+rw,go+r-w .
-
-# Fix a security problem and increment package version to try2
-# http://www.debian.org/security/2006/dsa-1244
-patch -p0 < $CWD/asmrules_fix_20061231.diff || exit 1
-PKGVERSION=${VERSION}try2
-
-# Fix a security problem and increment package version to try3
-# http://secunia.com/product/2255/
-# http://svn.mplayerhq.hu/mplayer/trunk/stream/stream_cddb.c?r1=23287&r2=23470&diff_format=u
-patch -p1 < $CWD/stream.cddb_fix_20070606.diff || exit 1
-PKGVERSION=${VERSION}try3
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+# Apply some *almost* official patches. To clarify, the actual work done
+# by the patch is identical to the official patches released by upstream.
+# I just reworked them to apply from the toplevel source directory with -p1
+# --rworkman
+# Fix buffer overflow in url.c
+patch -p1 < $CWD/url_fix_20080120.diff
+# Fix buffer overflow in stream_cddb.c
+patch -p1 < $CWD/stream_cddb_fix_20080120.diff
+# Fix stack overflow in demux_audio.c
+patch -p1 < $CWD/demux_audio_fix_20080129.diff
+# Fix buffer overflow in demux_mov.c
+patch -p1 < $CWD/demux_mov_fix_20080129.diff
+
+# Patch to account for linux-2.6.24.x including ivtv, but MPlayer won't
+# build against it. See this link for more information and patch origin:
+# http://archives.free.net.ph/message/20080201.201454.1047775e.en.html
+patch -p1 < $CWD/ivtv_fix-2.6.24.x.diff
# The MPlayer developers will not support and/or deal with bug reports
# if you don't allow it to automatically determine compiler flags,
@@ -95,20 +104,21 @@ PKGVERSION=${VERSION}try3
CFLAGS= \
./configure \
--prefix=/usr \
+ --mandir=/usr/man \
--confdir=/etc/mplayer \
+ --enable-color-console \
--enable-gui \
--enable-menu \
--enable-runtime-cpudetection \
--enable-largefiles \
- --with-codecsdir="$CODECSDIR" \
- --language="$LANGUAGES" \
- || exit 1
+ --codecsdir="$CODECSDIR" \
+ --language="$LANGUAGES"
-make || exit 1
-make install DESTDIR=$PKG || exit 1
+make
+make install DESTDIR=$PKG
( cd $PKG
- find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+ find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)
@@ -119,10 +129,10 @@ make install DESTDIR=$PKG || exit 1
mkdir -p $PKG/usr/share/mplayer/skins
if [ -r $CWD/$THEME-$THEME_VERSION.tar.bz2 ]; then
- ( cd $PKG/usr/share/mplayer/skins
- tar -xjf $CWD/$THEME-$THEME_VERSION.tar.bz2
- ln -s $THEME default
- ) || exit 1
+ cd $PKG/usr/share/mplayer/skins
+ tar xf $CWD/$THEME-$THEME_VERSION.tar.bz2
+ ln -s $THEME default
+ cd -
else
echo A usable theme tarball does not appear to exist in $CWD
echo \(or you didn't edit the script to reflect it, or something
@@ -137,14 +147,10 @@ else
fi
fi
-# Fix path to icon in desktop file so that the icon will display in kde
-sed -i 's%Icon=mplayer.xpm%Icon=/usr/share/pixmaps/mplayer.xpm%' \
- $PKG/usr/share/applications/mplayer.desktop || exit 1
-
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a AUTHORS ChangeLog Copyright LICENSE README DOCS/* \
- $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a AUTHORS Copyright LICENSE README DOCS $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+rm -rf $PKG/usr/doc/$PRGNAM-$VERSION/DOCS/man
# Don't clobber an existing config file
cat etc/example.conf > $PKG/etc/mplayer/mplayer.conf.new
@@ -153,15 +159,15 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
-# We'll link to one of the standard ttf fonts defined above
-# Thanks to Eric Hameleers for this code snippet
+# We'll link to one of the standard ttf fonts defined above.
+# Thanks to Eric Hameleers for this code snippet and permission to use it.
cat << EOF >> $PKG/install/doinst.sh
# Symlink a default TrueType font for OSD:
if [ ! -f usr/share/mplayer/subfont.ttf ]; then
for font in $OSDFONTS ; do
- if [ -f usr/X11R6/lib/X11/fonts/TTF/\$font ]; then
+ if [ -f usr/share/fonts/TTF/\$font ]; then
( cd usr/share/mplayer
- ln -fs /usr/X11R6/lib/X11/fonts/TTF/\$font subfont.ttf
+ ln -fs /usr/share/fonts/TTF/\$font subfont.ttf
)
break
fi