#!/bin/sh

# note -- this assumes 'bash' shell, GNU tar, 'gzip'. 

# pass a version number e.g. 1.4.3 as 1st parameter...
ME=`pwd`

/bin/rm -f *~  # get rid of the squggle files
/bin/rm -f Makefile
/bin/rm -f *.o
/bin/rm -f aes.so

# get the version number out of the VERSION file.
. VERSION 

VERSIONSTR=${VERSION}.${SUBVERSION}.${RELEASE}

# okay, now to create a spec file w/the proper version number:
# sed -e "1,\$s/@@VERSION@@/${VERSIONSTR}/g" <aes-rb.spec.in >aes-rb.spec

cd ..
if [ ! -s aes-rb-${VERSIONSTR} ]
then
   ln -s "${ME}" "aes-rb-${VERSIONSTR}"
fi


tar --exclude CVS -czvhf aes-rb-${VERSIONSTR}.tar.gz aes-rb-${VERSIONSTR}

