#!/usr/bin/bash # This SlackBuild like script is designed for Vector Linux packages by exeterdad. # This script assumes it will be launched within "/NAME/VERSION/src" dir. With all sources in "src" # Your Vector Linux .tlz package, slack-desc, and slack-required will be found in "VERSION" dir. # The extraction and build will be in a temp dir created in "NAME" dir, and then removed on exit. # Comment out last line to keep this dir intact. SHIM="# " # Add enough spaces between quotes to match quotes around name on next line NAME="transcode" VERSION=`date +%Y%m%d` ARCH=i586 BUILD=2vl59 VL_PACKAGER=exeterdad CWD=`pwd` cd ../ RELEASEDIR=`pwd` cd $CWD mkdir $RELEASEDIR/tmp TMP=$RELEASEDIR/tmp PKG=$TMP/package-$NAME if [ $UID != 0 ]; then echo "You need to be root to run this script." exit fi if [ ! -x /usr/bin/requiredbuilder ]; then echo "Requiredbuilder not installed, or not executable." exit fi export CFLAGS="-O2 -march=i586 -mtune=i686" export CXXFLAGS="-O2 -march=i586 -mtune=i686" rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf $NAME echo "Downloading sources from CVS..." cvs -z3 -d :pserver:cvs:@cvs.exit1.org:/cvstc co -r transcode_1_1 transcode echo "" echo "Compressing copy of CVS files to upload to sources" echo " Creating $NAME-$VERSION.tar.bz2 " echo " Please wait... " echo "" # Save a copy of downloaded cvs files to upload to our sources. tar cjf $CWD/$NAME-$VERSION.tar.bz2 $NAME || exit 1 echo "Done! Let's run autoreconf so we can compile this baby." cd $TMP/$NAME autoreconf -i -f echo "Setting permissions..." chown -R root:root . find . -perm 664 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 2777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 2755 -exec chmod 755 {} \; find . -perm 774 -exec chmod 644 {} \; find . -perm 666 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; echo "Here we go!" ./configure --prefix=/usr \ --mandir=/usr/man \ --with-ffmpeg-libs-includes=/usr/include/ffmpeg \ --with-ffmpeg-libs-libs=/usr/lib \ --with-libquicktime-prefix=/usr \ --with-libquicktime-includes=/usr/include/lqt \ --with-libquicktime-libs=/usr/lib \ --with-libfame-prefix=/usr \ --with-libfame-includes=/usr/include \ --with-libfame-libs=/usr/lib \ --with-lzo-prefix=/usr \ --with-lzo-includes=/usr/include/lzo \ --with-lzo-libs=/usr/lib \ --enable-freetype2 \ --enable-libdv \ --enable-avifile \ --with-avifile-prefix=/usr \ --with-avifile-includes=/usr/include/avifile-0.7 \ --with-avifile-libs=/usr/lib \ --enable-libmpeg3 \ --enable-theora \ --enable-xvid \ --enable-alsa \ --enable-x264 \ --enable-faac \ --enable-ogg \ --enable-v4l \ --enable-vorbis \ --enable-libquicktime \ --enable-a52-default-decoder \ --enable-a52 \ --enable-mjpegtools \ --enable-libfame \ --enable-libxml2 \ --enable-imagemagick \ --enable-sdl \ --enable-gtk \ --enable-lzo || exit 1 make -j3 || exit 1 make install DESTDIR=$PKG || exit 1 mv -f $PKG/usr/share/doc $PKG/usr/ rm -rf $PKG/usr/share mv -f $PKG/usr/doc/$NAME $PKG/usr/doc/$NAME-$VERSION cp -a AUTHORS ChangeLog COPYING INSTALL README TODO $PKG/usr/doc/$NAME-$VERSION cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild mkdir -p $PKG/install cat > $RELEASEDIR/slack-desc << EOF # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. $SHIM|-----handy-ruler------------------------------------------------------| $NAME: transcode (A video stream processing utility) $NAME: $NAME: transcode is a linux text-console utility for video stream $NAME: processing,running on a platform that supports shared libraries and $NAME: threads. Decoding and encoding is done by loading modules that are $NAME: responsible for feeding transcode with raw video/audio streams $NAME: (import modules) and encoding the frames (export modules). $NAME: $NAME: License: GPL 2.0 $NAME: Author: Thomas Östreich $NAME: Website: http://www.transcoding.org/ #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS CONFIGURE: `awk "/\.\/configure\ /" $TMP/$NAME/config.log` EOF cat $RELEASEDIR/slack-desc > $PKG/install/slack-desc cd $PKG echo " " echo "Stripping...." echo " " 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 echo "Finding dependancies..." requiredbuilder -v -y -s $RELEASEDIR $PKG echo "Creating package $NAME-$VERSION-$ARCH-$BUILD.tlz" makepkg -l y -c n $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.tlz cd $CWD echo "Cleaning up temp files..." #rm -rf $TMP echo "Done"