All pastes #179431 Raw Edit

Something

public text v1 · immutable
#179431 ·published 2006-09-22 06:15 UTC
rendered paste body
#!/bin/sh
# SlackBuild created by radi0head on irc.freenode.org ##slackware

NAME=transcode
VERSION=1.0.2
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-$VERSION ]; then
  rm -vrf $TMP/$NAME-$VERSION
fi

cd $TMP
tar xvzf $CWD/$NAME-$VERSION.tar.gz
cd $NAME-$VERSION
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 \
  --sysconfdir=/etc \
  --localstatedir=/var/lib \
  --enable-mmx \
  --enable-3dnow \
  --enable-sse \
  --enable-libavcodec \
  --with-libavcodec-includes=/usr/include \
  --with-libavcodec-prefix=/usr \
  --with-libavcodec-libs=/usr/lib \
  --enable-libmpeg2 \
  --enable-libpostproc \
  --with-libpostproc-includes=/usr/include/postproc \
  --enable-avifile \
  --enable-lame \
  --enable-ogg \
  --enable-vorbis \
  --enable-theora \
  --enable-libdvdread \
  --enable-libdv \
  --enable-libquicktime \
  --enable-a52 \
  --enable-libxml2 \
  --enable-mjpegtools \
  --enable-sdl \
  --enable-gtk \
  --enable-imagemagick \
  --enable-libjpeg \
  --enable-iconv \
  --build=$ARCH-slackware-linux

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-$VERSION
cp -a \
  AUTHORS COPYING ChangeLog INSTALL README README-1.0.1 TODO \
$PKG/usr/doc/$NAME-$VERSION

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
makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.tgz