#!/bin/sh # Heavily based on the Slackware 11.0 SlackBuild # Requirements: lame, xvid, imlib2, a52, libdc1394, libraw1394, libtheora # Requirements: faad2, faac, id3lib, libGSM, LibDts, Mpeg4IP, x264, lzo # http://ffmpeg.sourceforge.net/index.php # http://www.3gpp.org/ftp/Specs/2004-03/Rel-5/26_series/ CWD=`pwd` TMP=${TMP:-/tmp/tgz} PKG=$TMP/package NAME=ffmpeg VERSION=`date +%Y%m%d` ARCH=${ARCH:-i486} BUILD=1sl SOURCE=http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip if [ ! -e 26204-510.zip ]; then wget -c $SOURCE fi SOURCE=http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip if [ ! -e 26104-510.zip ]; then wget -c $SOURCE fi SOURCE=http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip if [ ! -e 26073-510.zip ]; then wget -c $SOURCE fi if [ ! -d $TMP ]; then mkdir -p $TMP fi if [ ! -d $PKG ]; then mkdir -p $PKG fi mkdir -p $PKG/usr/bin cd $TMP svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg cd $NAME/libavcodec mkdir amrwb_float mkdir amr_float mkdir amr cd amrwb_float unzip -o $CWD/26204-510.zip unzip -o 26204-510_ANSI-C_source_code.zip mv makefile.gcc makefile cd ../amr_float unzip -o $CWD/26104-510.zip unzip -o 26104-510_ANSI_C_source_code.zip mv makefile.gcc makefile cd ../amr unzip -o $CWD/26073-510.zip unzip -o 26073-510_ANSI-C_source_code.zip cd $TMP/$NAME sed -i "s|-pedantic-errors|-DMMS_IO|g" libavcodec/amrwb_float/makefile sed -i "s|-pedantic-errors|-DMMS_IO|g" libavcodec/amr_float/makefile sed -i "s|-pedantic-errors|-DMMS_IO|g" libavcodec/amr/makefile find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; find . -perm 666 -exec chmod 644 {} \; find . -perm 664 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; chown -R root:root . ./configure --prefix=/usr \ --mandir=/usr/man \ --enable-shared \ --disable-debug \ --enable-mp3lame \ --enable-xvid \ --enable-a52 \ --enable-libogg \ --enable-gpl \ --enable-dc1394 \ --enable-pp \ --enable-faac \ --enable-faad \ --enable-dts \ --enable-libgsm \ --enable-a52bin \ --enable-vorbis \ --enable-faadbin \ --enable-amr_nb-fixed \ --enable-amr_if2 \ --enable-amr_wb \ --enable-pthreads \ --enable-x264 \ --enable-x11grab \ --cpu=i486 make make -C doc all mkdir -p $PKG/usr/doc/$NAME-$VERSION cp [A-Z]* doc/TODO doc/*.{html,txt} $PKG/usr/doc/$NAME-$VERSION cp doc/*.1 $PKG/usr/man/man1 make install DESTDIR=$PKG mkdir $PKG/etc cp -a doc/ffserver.conf $PKG/etc/ffserver.conf.new 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 find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs strip -g 2> /dev/null find $PKG/usr/man -type f -exec gzip -9 {} \; mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/slack-desc cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.tgz if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi