#!/bin/sh
#
# Create a package with the Libyan SSWF script and all
# the necessary files
#
# Written by Alexis Wilke for Made to Order Software Corp. (c) 2002-2009
#
# Copyright (c) 2002-2009 Made to Order Software Corp.
#
# This work is not free. If you are interested in using
# this Flash animation in part or as a whole, please
# contact Made to Order Software Corp. at:
#
#	contact@m2osw.com
#
# This work is presented here as a sample so you can learn
# how SSWF works. It is not intended for you to use in your
# own Flash animations or your web page(s).
#

##############################
# Get the current packages version
##############################
VERSION=`grep "^.define.*\\<SSWF_VERSION\\>" ../../include/sswf/libsswf-version.h | sed -e 's/.*\\([0-9]\\+\\.[0-9]\\+\\.[0-9]\\+\\).*/\\1/'`


##############################
# Define what needs to be packed
##############################
TOPACK="LICENSE.txt libya.sswf *.html run run.bat pack *.tga"

##############################
# Create the destination directory
##############################
DST="../../sswf-$VERSION"
if test -f $DST/dotar
then
	echo "FATAL ERROR: it seems that you are trying to run this script from the wrong"
	echo "             directory. Please, make sure you are in the correct directory"
	echo "             by deleting the dotar file from the destination directory:"
	echo "                 $DST"
	exit 1;
fi
rm -rf $DST
mkdir -p $DST/samples/libya
cp $TOPACK $DST/samples/libya
cd ../..
tar cjf sswf-$VERSION-sample-libya.tar.bz2 sswf-$VERSION

