#!/bin/sh CWD=`pwd` TMP=${TMP:-/tmp} PKG=$TMP/package-divx4linux VERSION=20030428 ARCH=${ARCH:-i486} BUILD=G3 if [ ! -d $TMP ]; then mkdir -p $TMP; fi rm -rf $PKG mkdir -p $PKG mkdir -p $PKG/usr/{lib,include} if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mcpu=i686"; elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mcpu=i686"; elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2"; elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2"; fi cd $TMP tar xzvf $CWD/divx4linux-std-$VERSION.tar.gz cd divx4linux-$VERSION chown -R root.root . LIBDIR=$PKG/usr/lib INCLUDEDIR=$PKG/usr/include GREP_RESULT=`grep /usr/lib /etc/ld.so.conf` if [ -z "$GREP_RESULT" ]; then echo >> /etc/ld.so.conf echo $LIBDIR >> /etc/ld.so.conf fi cp -f *.so $LIBDIR cp -f *.h $INCLUDEDIR for NAME in encore decore ; do LIBNAME=${LIBDIR}/libdivx${NAME}.so chown 0 $LIBNAME chmod 755 $LIBNAME rm -f $LIBNAME.0 ln -s $LIBNAME $LIBNAME.0 chown 0 $LIBNAME.0 chmod 755 $LIBNAME.0 done /sbin/ldconfig mkdir -p $PKG/usr/doc/divx4linux-std-$VERSION cp -a *.htm $PKG/usr/doc/divx4linux-std-$VERSION find $PKG/usr/doc/divx4linux-std-$VERSION/ -type f -exec chmod 644 {} \; chown -R root.root $PKG/usr/doc/divx4linux-std-$VERSION/* # strip: ( 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/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG makepkg -l y -c n $TMP/divx4linux-std-$VERSION-$ARCH-$BUILD.tgz # Clean up the extra stuff: if [ "$1" = "--cleanup" ]; then rm -rf $TMP/divx4linux-std-$VERSION rm -rf $PKG fi