#!/bin/sh
#
# Usage: makedist [name-suffix]
#
# Creates a saml${suffix}.tgz archive suitable for distribution, and saves
# our RCS files in saml_rcs.tgz. FILES is supposed to contain the file list.

case $# in
  0) ARCHIVE=saml-`date +%y%m%d` ;;
  1) ARCHIVE=saml$1 ;;
  *) echo "Usage: $0 [suffix]" 1>&2; exit 1 ;;
esac

# First, copy the important files in a subdirectory
mkdir $ARCHIVE
tar -cf- `cat FILES` | (cd $ARCHIVE; tar -xf-)

# Create the archives and remove the temporary subdirectory
tar -cvzf $ARCHIVE.tgz $ARCHIVE
rm -rf $ARCHIVE
tar -cvzf saml_rcs.tgz RCS */RCS
