#!/bin/sh
#
# "$Id: makesrcdist 256 2005-06-23 17:54:42Z mike $"
#
#   makesrcdist - make a source distribution of the CUPS DDK.
#
#   Copyright 2002-2005 by Easy Software Products.
#
#   These coded instructions, statements, and computer programs are the
#   property of Easy Software Products and are protected by Federal
#   copyright law.  Distribution and use rights are outlined in the file
#   "LICENSE.txt" which should have been included with this file.  If this
#   file is missing or damaged please contact Easy Software Products
#   at:
#
#       Attn: CUPS Licensing Information
#       Easy Software Products
#       44141 Airport View Drive, Suite 204
#       Hollywood, Maryland 20636 USA
#
#       Voice: (301) 373-9600
#       EMail: cups-info@cups.org
#         WWW: http://www.cups.org
#

echo "Getting distribution..."

if test $# = 0; then
	echo -n "Version number for distribution? "
	read version
else
	version=$1
fi

cd /tmp

if test $version = snapshot; then
	url="https://svn.easysw.com/public/cupsddk/trunk"
else
	url="https://svn.easysw.com/public/cupsddk/tags/release-$version"

	svn copy https://svn.easysw.com/public/cupsddk/trunk "$url" \
		-m "Tag $version" || exit 1
fi

rm -rf cupsddk-$version
svn export $url cupsddk-$version
cd cupsddk-$version

echo "Removing Subversion files and directories..."
rm -f makesrcdist
rm -f ANNOUNCEMENT.txt
rm -f TODO.txt
rm -rf gui
rm -rf icons

cd ..

echo "Making tar.gz distribution..."

gtar czf cupsddk-$version-source.tar.gz cupsddk-$version

echo "Making tar.bz2 distribution..."
gunzip -c cupsddk-$version-source.tar.gz | bzip2 -v9 >cupsddk-$version-source.tar.bz2

echo "Removing distribution directory..."

rm -rf cupsddk-$version

echo "Done!"

#
# End of "$Id: makesrcdist 256 2005-06-23 17:54:42Z mike $".
#
