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 -xjf "${1}/${2}"
		rm -Rf mjpegtools-1.9.0rc3/{aenc,mpeg2enc}
		tar -cjf "${1}/${3}" mjpegtools-1.9.0rc3
		cd - 1>/dev/null
		rm -Rf $TMPDIR
	else
		echo "creating tmp dir failed"
	fi
else
	echo "file: ${1}/${2} doesn't exist"
fi