File mjpegtools-codecpatch.sh of Package mjpegtools
# removes mpeg stuff
# $1 is directory with tarballs
# $2 is original tarball
# $3 is patched tarball
set -o errexit
if test -f "${1}/${2}" ; then
TMPDIR=`mktemp -d`
if test -d $TMPDIR ; then
echo "========================================================"
trap "rm -vrf \"$TMPDIR\" \"${1}/${2}\"" ERR
cd $TMPDIR
tar -xzf "${1}/${2}"
rm -Rf mjpegtools-2.0.0/{aenc,mpeg2enc}
tar -czf "${1}/${3}" mjpegtools-2.0.0
cd - 1>/dev/null
rm -Rf $TMPDIR
else
echo "creating tmp dir failed"
fi
else
echo "file: ${1}/${2} doesn't exist"
fi