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-11-04 02:27:59 +01:00
|
|
|
VERSION=20101023
|
2010-05-11 20:01:27 +02:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
2010-05-11 22:25:00 +02:00
|
|
|
|
2010-11-23 21:07:06 +01:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
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"
|
2010-05-13 00:35:19 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 20:01:27 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 00:35:19 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-11 22:25:00 +02:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-05-13 00:35:19 +02:00
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:12:06 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
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 \
|
2010-05-13 00:35:19 +02:00
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
2010-05-11 20:01:27 +02:00
|
|
|
--enable-visualize \
|
2010-06-16 20:56:51 +02:00
|
|
|
--enable-shared \
|
|
|
|
--enable-pic
|
2010-05-11 20:01:27 +02:00
|
|
|
|
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
|
2010-04-18 17:30:23 +02:00
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
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
|
2010-05-13 00:35:19 +02:00
|
|
|
/sbin/makepkg -l y -c n -p $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|