sbonazzo / rpms / cyrus-sasl

Forked from rpms/cyrus-sasl 2 years ago
Clone

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

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