sbonazzo / rpms / cyrus-sasl

Forked from rpms/cyrus-sasl 2 years ago
Clone

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

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