#! /bin/bash
version=0.4.10
name=lmms-${version}
suffix=.tar.bz2
newsuffix=.stripped.tar.bz2
compr=bzip2
list=$(tar tjf ${name}${suffix} | egrep 'ogg$|wav$|mmpz?$')
trap '${tmpfile:+rm ${tmpfile}}' EXIT
tmpfile=$(mktemp)
${compr} -cd ${name}${suffix} > ${tmpfile}
tar --delete --file=${tmpfile} ${list}
${compr} -c ${tmpfile} > ${name}${newsuffix}
(
echo "For legal reasons, the following files have been removed from the"
echo "original tarfile:"
echo
for file in $list ; do echo $file ; done
) > README.fedora