Blame SOURCES/make-no-dlcompatorsrp-tarball.sh

2fd749
#!/bin/bash -e
2fd749
#
2fd749
#  See ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/ for unmodified sources.
2fd749
#
2fd749
2fd749
tmppath=`mktemp -d ${TMPDIR:-/tmp}/make-no-dlcompat-tarball-XXXXXX`
2fd749
if test -z "$tmppath" ; then
2fd749
	echo Error creating temporary directory.
2fd749
	exit 1
2fd749
fi
2fd749
trap "rm -fr $tmppath" EXIT
2fd749
2fd749
initialdir=`pwd`
2fd749
2fd749
for tarball in ${initialdir}/cyrus-sasl-*.tar.{gz,bz2} ; do
2fd749
	if ! test -s "$tarball" ; then
2fd749
		continue
2fd749
	fi
2fd749
	rm -fr $tmppath/*
2fd749
	pushd $tmppath > /dev/null
2fd749
	case "$tarball" in
2fd749
	*nodlcompat*)
2fd749
		: Do nothing.
2fd749
		;;
2fd749
	*.gz)
2fd749
		gzip  -dc "$tarball" | tar xf -
2fd749
		rm -fr cyrus-sasl-*/dlcompat*
2fd749
		rm -fr cyrus-sasl-*/plugins/srp*
2fd749
		tar cf - * | gzip  -9c > \
2fd749
		$initialdir/`basename $tarball .tar.gz`-nodlcompatorsrp.tar.gz
2fd749
		;;
2fd749
	*.bz2)
2fd749
		bzip2 -dc "$tarball" | tar xf -
2fd749
		rm -fr cyrus-sasl-*/dlcompat*
2fd749
		rm -fr cyrus-sasl-*/plugins/srp*
2fd749
		tar cf - * | bzip2 -9c > \
2fd749
		$initialdir/`basename $tarball .tar.bz2`-nodlcompatorsrp.tar.bz2
2fd749
		;;
2fd749
	esac
2fd749
	popd > /dev/null
2fd749
done