#! /bin/csh
#
#	make landscape installer
#
# 
#	Copyright (C) 2003 Hirohisa MORI joshua@nichibun.ac.jp
# 
#	This program is free software; you can redistribute it and/or
#	modify it under the terms of the GLOBALBASE General Public 
#	License as published by http://www.globalbase.org/
# 
#	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.
#
#	Usage::
#
#	make.landscape.installer MACHINE
#
#	for installer of MACHINE
#	MACHINE is corresponding the following dir. names
#
#	solaris
#	linux.redhat
#	linux.debian
#	MacOSX
#	FreeBSD
#	....
#
#	and the result execution file is MACHINE/landscape.tar.gz
#

echo make.landscape.installer for $1
pushd $1

alias rm rm -f

rm -r landscape*

echo -n Copying server script...
cp -r ../../../server .
chmod 0755 server/install.sh
chmod 0755 server/update.sh
echo done.

mkdir server/xlscript/bin

echo -n Copying binaries...
cp bin/* server/xlscript/bin
echo done.

rm server/xlscript/bin/cosmos
rm server/xlscript/bin/vtester
rm server/xlscript/bin/freetype-config
rm server/xlscript/bin/lcconv
find server -name '.*' -exec rm -r {} \;
find server -name 'd' -exec rm {} \;
find server -name 'CVS' -exec rm -r {} \;
chmod 0755 server/install.sh
chmod 0755 server/update.sh

echo Making archive ...
cd server
tar cvf ../landscape.tar .
cd ..
echo -n Compressing ...
gzip landscape.tar
echo done.

echo -n Cleaning up...
rm -r server
echo done.

popd

