egroupware_official/debian/egw-sanitize-tarball

42 lines
1.2 KiB
Plaintext
Raw Normal View History

2007-02-26 10:22:01 +01:00
#!/bin/bash
# Call this script with the name of an eGroupWare release tarball,
# and it will build a new tarball that has CVS/SVN cruft and nonfree
# files removed. The new tarball will be placed in the current
# directory.
#
# Written by Peter Eisentraut <petere@debian.org>, 2004-08-11
# Public domain
set -e
case x"$1"x in
*.gzx) taropt=z;;
*.bz2x) taropt=j;;
xx) echo "$0: specify tarball name as argument" 1>&2; exit 1;;
*) echo "$0: $1 does not appear to be a tarball" 1>&2; exit 1;;
esac
version=$(echo $1 | sed 's/egroupware-//' | sed 's/.tar.*//')
version="${version}.dfsg"
origtarname=egroupware_$version.orig.tar.gz
tmpdir=$(mktemp -d)
trap "rm -rf $tmpdir" EXIT
tar -C $tmpdir -x -$taropt -f $1
pushd $tmpdir/ >/dev/null
mv egroupware egroupware-$version
pushd egroupware-$version/ >/dev/null
mv egw-pear egw_pear # required by the internal logic of the rules script
rm calendar/doc/rfc2445.txt # RFC's are not DFSG-free
rm phpgwapi/inc/fpdf/tutorial/calligra.* # doubtful copyright status
rm -rf $(find -name CVS -o -name .cvsignore -o -name .svn) # CVS/SVN cruft
popd >/dev/null
tar -c -z -f $origtarname egroupware-$version/
popd >/dev/null
mv -i $tmpdir/$origtarname .
echo "`basename $0`: wrote \"$origtarname\""