sbonazzo / rpms / cyrus-sasl

Forked from rpms/cyrus-sasl 2 years ago
Clone

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

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