2010-05-11 20:01:27 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-05-11 22:25:00 +02:00
|
|
|
# Slackware build script for x264
|
2010-05-11 20:01:27 +02:00
|
|
|
|
|
|
|
# Written by core (eroc@linuxmail.org)
|
2010-05-11 22:25:00 +02:00
|
|
|
# Modified by Heinz Wiesinger <pprkut@liwjatan.at>
|
2010-05-11 20:01:27 +02:00
|
|
|
|
|
|
|
PRGNAM=x264
|
2010-05-12 17:42:51 +02:00
|
|
|
VERSION=20090310
|
2010-05-11 20:01:27 +02:00
|
|
|
ARCH=${ARCH:-i486}
|
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-11 22:25:00 +02:00
|
|
|
|
2010-05-11 20:01:27 +02:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-11 22:25:00 +02:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-05-11 20:01:27 +02:00
|
|
|
fi
|
|
|
|
|
2010-05-12 17:42:51 +02:00
|
|
|
set -e
|
|
|
|
|
2010-05-11 20:01:27 +02:00
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
2010-05-12 17:42:51 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-*-$VERSION-*.tar.bz2
|
2010-05-11 20:01:27 +02:00
|
|
|
mv $PRGNAM-*-$VERSION-*/ $PRGNAM-$VERSION
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
|
|
|
chmod -R u+w,go+r-w,a-s .
|
|
|
|
|
|
|
|
CFLAGS="$SLKCFLAGS" \
|
|
|
|
CXXFLAGS="$SLKCFLAGS" \
|
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--enable-pthread \
|
|
|
|
--enable-visualize \
|
|
|
|
--enable-shared
|
|
|
|
|
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
2010-05-12 17:42:51 +02:00
|
|
|
( cd $PKG
|
|
|
|
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
|
|
|
|
)
|
2010-05-11 20:01:27 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a AUTHORS COPYING doc/*.txt $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
|
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n -p $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
|