#!/bin/sh

if [ $# -lt 3 ]; then
	echo "wrong number of arguments, must be at least 3"
	exit 1
fi
TMPDIR=$1
shift
PACKAGE=$1
shift 1
if [ "$1" != "NO" ]; then
	mkdir -p $TMPDIR/debian-tmp/usr/doc/copyright
	install -c -m 644 -o root -g root $1 $TMPDIR/debian-tmp/usr/doc/copyright/$PACKAGE
fi
shift 1
if [ $# -gt 0 ]; then
	mkdir -p $TMPDIR/debian-tmp/usr/doc/$PACKAGE
	for i in $* ; do
		install -c -m 644 -o root -g root $i $TMPDIR/debian-tmp/usr/doc/$PACKAGE
		gzip --best $TMPDIR/debian-tmp/usr/doc/$PACKAGE/$i
	done
fi
		
	
