#!/bin/sh

#/**************************************************************************/
#/*                                                                        */
#/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
#/*                                                                        */
#/* NXSCRIPTS, NX protocol compression and NX extensions to this software  */
#/* are copyright of NoMachine. Redistribution and use of the present      */
#/* software is allowed according to terms specified in the file LICENSE   */
#/* which comes in the source distribution.                                */
#/*                                                                        */
#/* Check http://www.nomachine.com/licensing.html for applicability.       */
#/*                                                                        */
#/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
#/*                                                                        */
#/* All rights reserved.                                                   */
#/*                                                                        */
#/**************************************************************************/


set -x

if [ `uname` = "SunOS" ] ; then
  TAR=gtar
  CP="cp -r"
else
  TAR=tar
  CP="cp -a"
fi


# Copy all files pertaining to nxwin-org
# to a temporary directory.

mkdir t 2>/dev/null

cd t 2>/dev/null || exit

mkdir -p nx-X11-org/programs/Xserver/hw

$CP ../nx-X11-org/programs/Xserver/hw/nxwin nx-X11-org/programs/Xserver/hw || exit

# Clean all in nxwin directory.

cd nx-X11-org/programs/Xserver/hw/nxwin || exit

make distclean

cd ../../../../..

# Make the tarfile.

$TAR zcvf ../nxwin-org-XXX.tar.gz nx-X11-org/programs/Xserver/hw/nxwin

