#!/bin/csh -f
#
#      $Id: rm3_1_3,v 1.3 1995-10-05 21:59:02 haley Exp $
#
#########################################################################
#									#
#			   Copyright (C)  1992				#
#	     University Corporation for Atmospheric Research		#
#			   All Rights Reserved				#
#									#
#########################################################################
#
#	File:		rm3_1_3
#
#	Author:		John Clyne
#			National Center for Atmospheric Research
#			PO 3000, Boulder, Colorado
#
#	Date:		Thu Feb 4 10:45:57 MST 1993
#
#	Description:	Remove version 3.1.3 of NCAR Graphics. This script
#			actually only removes those portions of 3.1.3
#			that are not also in 3.2 or later. The intent
#			is that 3.2.x can be installed (which will overwrite
#			portions of any 3.1.3 NCARG on the system) and then
#			rm3.1.3 may be used to clean up the obsolete 3.1.3
#			code not overwritten by 3.2. 
#
#	Usage:		rm3_1_3 [-bin <bindir>] [-man <mandir>] [-lib <libdir>]
#
#	Environment:
#
#	Files:
#
#
#	Options:
#			-bin	: Remove old bin installables from 'bindir'
#			-lib	: Remove old lib installables from 'libdir'
#			-man	: Remove old man installables from 'mandir'
#

set bins = ()
set libs = ()
set mans = ()

set bins = 	(Copyright merge_frames ncargpar ncargsrc \
		ncargsrcx ncargsrcy)

set libs = 	(libagupwrtx.o libconraq.o libconras.o \
		libconrcqck.o libconrcspr.o libctrans.o \
		libdashline.o libdashsmth.o libdashsupr.o \
		libhdf.a libncarv.a libictrans.o libictrans_.o \
		ncargsrc.stats srcagupwrtx.a srcconraq.a \
		srcconras.a srcconrcqck.a srcconrcspr.a \
		srcdashline.a srcdashsmth.a srcdashsupr.a \
		srcncarg.a srcncarg_gks.a srcncarg_loc.a \
		fontcaps graphcaps ezmapdata pwritdata \
		ranfdata  ncargexamples params ncargparams ncargtests)


set mans = 	(areas autograph cgm cgm2ncgm cgm_edit \
		cgmtrans \
		colconv conpack conran conraq conras conrcq \
		conrcspr conrec ctrans dashchar dashline \
		dashsmth dashsupr ezmap.exam ezmap ezmapa \
		fcaps findg fontc fontcap ftrans gcaps \
		gflash graphc graphcap gridal hafton histgr \
		ictrans idt isosrf isosrfhr labelbar med \
		ncargcc ncargex ncargf77 ncargintro ncargmac \
		ncargmac3 ncargmv ncargpar ncargrun ncargsrc \
		ncargtar ncargtest ncarv_spool ncgm2cgm \
		nriftohdf plotchar plt pre2ncgm psblack \
		pswhite pwritx pwrity pwrzi pwrzs pwrzt \
		rasview softfill srface stitle strmln threed \
		velvct xwdtohdf)
while ($#argv) 
	switch ("$argv[1]")
	case -bin:
		shift
		set bindir = $argv[1];
		breaksw

	case -lib:
		shift
		set libdir = $argv[1];
		breaksw

	case -man:
		shift
		set mandir = $argv[1];
		breaksw

	default:
		echo "Invalid option <$argv[1]>"
		echo "Usage: $0 [-bin <bindir>] [-man <mandir>] [-lib <libdir>]"
		exit 1

	endsw

	shift
end

if ($?bindir) then
	foreach file ($bins)
		if (-e "$bindir/$file") then
			/bin/rm -r $bindir/$file
		endif
	end
endif


if ($?libdir) then
	foreach file ($libs)
		if (-e "$libdir/$file") then
			/bin/rm -r $libdir/$file
		endif
	end
endif

if ($?mandir) then
	foreach file ($mans)
		if (-e "$mandir/$file.l") then
			/bin/rm -r $mandir/$file.l
		endif
	end
endif

exit 0

