#!/bin/sh
#
#        Copyright(C) 1997 Network Flight Recorder, Inc.
#        All rights reserved.
#
#        Use and distribution of this software and its source code
#        are governed by the terms and conditions of the
#        Network Flight Recorder Software License ("LICENSE.TXT")
# 
# By Mark Sienkiewicz / NFR
#

INSTALLDIR=$1

# make sure all the directories exist

find . -type d -print | grep -v CVS |
        ( 
        while read a
        do
        [ -d $INSTALLDIR/packages/"$a" ] || mkdir -p $INSTALLDIR/packages/"$a"
        done
        )

# copy all the files over

find . -type f -print | grep -v CVS | grep -v Makefile |
        ( while read a ; do cp "$a" $INSTALLDIR/packages/"$a" ; done )

# trim the empty directories left behind by CVS

find . -type d -print | grep -v CVS |
	(
	while read a
	do
	rmdir $INSTALLDIR/packages/"$a"
	done
	exit 0
	) 2>/dev/null

