#!/bin/bash
#  ( Last modified on 23 Dec 2000 at 17:29:56 )
#
#{version}
#version for Intel-like-PC under Linux with gfo (Tue Sep 22 06:19:52 UTC 2009)
#
#  add to the CLASSF.DB file the classification of the problem whose name is
#  given as an argument
#  If two arguments are given the first indicates the name of the directory
#  where this problem resides, otherwise the default is that pointed to by
#  the shell variable $MASTSIF.

#  A.R. Conn and Ph.L. Toint, October 1992, for CGT Productions.
#  modified by I. Bongartz, July 1994.
#
MYSIFDEC=/usr
SAVEDIR=$PWD
MASTSIF=/usr/share/sifdec/sif

#{cmds}
#
#  System specifications
#

SYSTEM="Linux"
KEYSYS="CUNIX"

#
#  Directory for temporary files
#

TMP="/tmp"


#
#  basic system commands
#

MKDIR="/bin/mkdir"
CP="/bin/cp"
RM="/bin/rm -f"
MV="/bin/mv"
CAT="/bin/cat"
CHMOD="/bin/chmod"
SED="/bin/sed"
LN="/bin/ln"
LS="/bin/ls"
AR="/usr/bin/ar"
RMDIR="/bin/rmdir"
GREP="/bin/grep"
AWK="/usr/bin/gawk"
HEAD="/usr/bin/head"
TAIL="/usr/bin/tail"
WC="/usr/bin/wc"
MAKE="/usr/bin/make"

#
#  Fortran compilation and loading
#

CPP="${CPP}"
COMPILE="gfortran -c -ffixed-form"
LOAD="gfortran -ffixed-form"
ISF9095="yes"
COMPILE9095="gfortran -c"
LOAD9095="gfortran"
FFLAGS="-g"
FDEBUGFLAGS="-g"
FPROFILEFLAGS="-pg"

if [[  $# == 1  ]]; then
  cd $MASTSIF
  echo "n"  > $SAVEDIR/CLSF.DAT
  echo "$1">> $SAVEDIR/CLSF.DAT
  echo ' '
  echo '   Your current classification file is : CLASSF.DB '
  echo ' '
  $MYSIFDEC/bin/clsf
  [[  -e $SAVEDIR/CLASSF.UDB  ]] && $MV $SAVEDIR/CLASSF.UDB $SAVEDIR/CLASSF.DB
elif [[  $# == 2  ]]; then
  cd $1
  echo "n"   > $SAVEDIR/CLSF.DAT
  echo "$2" >> $SAVEDIR/CLSF.DAT
  echo ' '
  echo '   Your current classification file is : CLASSF.DB '
  echo ' '
  $MYSIFDEC/bin/clsf
  [[  -e $SAVEDIR/CLASSF.UDB  ]] && $MV $SAVEDIR/CLASSF.UDB $SAVEDIR/CLASSF.DB
else
  echo ' Usage "classify name" or "classify directory name"'
  echo ''
  echo ' where name is the problem name without the .SIF appended,'
  echo '       directory is the name of the directory containing this problem'
fi
$RM $SAVEDIR/CLSF.DAT
