#!/bin/sh # SlackBuild created by radi0head on irc.freenode.org ##slackware NAME=ffmpeg ARCH=${ARCH:-i486} BUILD=1 CWD=`pwd` TMP=${TMP:-/tmp} PKG=$TMP/package-$NAME if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mtune=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2" fi if [ ! -d $TMP ]; then mkdir -p $TMP fi if [ -d $PKG ]; then rm -vrf $PKG fi mkdir -p $PKG if [ -d $TMP/$NAME ]; then rm -vrf $TMP/$NAME fi cd $TMP svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk $NAME cd $NAME chown -R root.root . find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 666 -exec chmod 644 {} \; find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 555 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --enable-mp3lame \ --enable-libogg \ --enable-vorbis \ --enable-faad \ --enable-faac \ --enable-libgsm \ --enable-xvid \ --enable-x264 \ --enable-a52 \ --enable-pp \ --enable-shared \ --enable-pthreads \ --enable-dc1394 \ --enable-gpl \ --disable-debug make -j3 make install DESTDIR=$PKG if ls $PKG/bin &> /dev/null; then chown -R root.bin $PKG/bin fi if ls $PKG/usr/bin &> /dev/null; then chown -R root.bin $PKG/usr/bin fi if ls $PKG/sbin &> /dev/null; then chown -R root.bin $PKG/sbin fi if ls $PKG/usr/sbin &> /dev/null; then chown -R root.bin $PKG/usr/sbin fi if ls $PKG/usr/X11R6/bin &> /dev/null; then chown -R root.bin $PKG/usr/X11R6/bin fi ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) mkdir -p $PKG/usr/doc/$NAME cp -a \ COPYING CREDITS Changelog Doxyfile MAINTAINERS Makefile INSTALL README \ doc/TODO doc/faq.html doc/ffmpeg_powerpc_performance_evaluation_howto.txt doc/optimization.txt \ doc/ffserver.conf doc/ffserver-doc.html doc/ffplay-doc.html doc/ffmpeg-doc.html doc/hooks.html \ $PKG/usr/doc/$NAME if [ -d $PKG/usr/man ]; then gzip -9 $PKG/usr/man/man?/* fi if [ -d $PKG/usr/share/man ]; then mv $PKG/usr/share/man $PKG/usr rmdir $PKG/usr/share gzip -9 $PKG/usr/man/man?/* fi mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG SVN_REV="svn_r$(svn info $TMP/$NAME | grep 'Last Changed Rev' | awk '{print $4}')" SVN_DATE="$(svn info $TMP/$NAME | grep 'Last Changed Date' | awk '{print $4}' | tr -d '-')" VERSION="${SVN_REV}_${SVN_DATE}" makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.tgz