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

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