#!/bin/sh
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
#
# Name:		makedist
# Package:	Simple Web Search
# Author:	David Norris
# CopyRight:	2000 David Norris
# License:	GNU General Public License (see COPYING file)
#
# Modified:	2000-07-18T06:31Z (July 18, 2000 6:31 UTC)
#
# Notes:	If you plan to use this then you may want to 
#		modify which files are included in the archive.
#		You may do that below under the heading
#		Copying Files

# We need to give a version number
if [ -z "$1" ]; then
	echo "Usage: makedist version"
	exit
fi

# Set some variables
DISTVERSION=$1
DISTNAME="simplesearch"
DISTFULL=$DISTNAME-$DISTVERSION

# Announce what we intend to do.
echo "Making distribution for version $DISTVERSION"

# Copy the source files to the distribution
echo "Copying files to ./$DISTFULL"
mkdir $DISTFULL

# Copying Files
# Copy each file we need to the appropriate destination
cp index.html.php3 $DISTFULL/search.php3
cp search.css $DISTFULL/search.css
cp include/* $DISTFULL/
cp user.config $DISTFULL/
cp makedist $DISTFULL/
cp COPYING $DISTFULL/

# Preliminary visual inspection
echo "Listing of ./$DISTFULL"
ls -l $DISTFULL

# Archiving distribution to tape file
echo "Archiving distribution to $DISTFULL.tar.gz"
tar -cvf $DISTFULL.tar $DISTFULL/*
gzip $DISTFULL.tar

# Final visual inspection
echo "Listing contents of $DISTFULL archive"
tar -tvzf $DISTFULL.tar.gz

# Clean up temp files
echo "Cleaning temporary files"
rm -Rf $DISTFULL

echo "Completed making $DISTNAME/$DISTVERSION distribution, you may now\
publish $DISTFULL.tar.gz"

