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

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