File: install

package info (click to toggle)
viewmol 2.4.1-18
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 7,300 kB
  • sloc: ansic: 30,727; python: 1,846; sh: 1,282; awk: 433; makefile: 374
file content (87 lines) | stat: -rwxr-xr-x 2,748 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/sh
#*******************************************************************************
#                                                                              *
#                                   Viewmol                                    *
#                                                                              *
#                                I N S T A L L                                 *
#                                                                              *
#                 Copyright (c) Joerg-R. Hill, October 2003                    *
#                                                                              *
#*******************************************************************************
#
# $Id: install,v 1.2 2004/08/29 14:53:37 jrh Exp $
# $Log: install,v $
# Revision 1.2  2004/08/29 14:53:37  jrh
# Release 2.4.1
#
# Revision 1.1  2003/11/07 13:05:40  jrh
# Initial revision
#

if [ "$1" = "" ]
then
  prgname=`basename $0`
  echo "${prgname}: ERROR: Usage: $prgname <directory>."
  exit 1
fi
ROOT=$1

# find name of directory for execuatable
os=`uname -s`
case $os in
  AIX)     if [ `uname -m | cut -c9-10` = "70" ]
           then
             dir="${os}_POWER2"
           else
             dir="${os}_POWER"
           fi
           dirorig="AIX_POWER2"
           ;;
  IRIX*)   dir="${os}_`hinv | awk '/CPU:/ {print $3}' | cut -d/ -f2`"
           dirorig="IRIX_R5000"
           ;;
  *)       dir="$os"
           dirorig="$os"
           ;;
esac

# install executable in $ROOT/bin
if [ ! -d $ROOT/bin ]
then
  mkdir -p $ROOT/bin
  chmod 755 $ROOT/bin
fi
cp $dirorig/viewmol $ROOT/bin
chmod 711 $ROOT/bin/viewmol

# install other files needed in $ROOT/lib/viewmol
if [ ! -d $ROOT/lib/viewmol/$dir ]
then
  mkdir -p $ROOT/lib/viewmol/$dir
  chmod 755 $ROOT/lib/viewmol/$dir
fi
cd $dirorig
cp tm bio readgamess readgauss readmopac readpdb $ROOT/lib/viewmol/$dir
chmod 711 $ROOT/lib/viewmol/$dir/*
cd ../..
cp readdmol readdmol.awk readgulp readpqs writecar writegauss.py writemol writetm $ROOT/lib/viewmol
chmod 755 $ROOT/lib/viewmol/*
cp -r doc examples locale scripts tests $ROOT/lib/viewmol
find $ROOT/lib/viewmol -type f -exec chmod a+r {} \;
find $ROOT/lib/viewmol -type d -exec chmod a+rx {} \;
sed 's/\/source//g' viewmolrc > $ROOT/lib/viewmol/viewmolrc
chmod -R 644 $ROOT/lib/viewmol/viewmolrc
if [ -d /usr/X11R6/lib/X11/app-defaults ]
then
  locale=`echo $LANG | cut -c1-2`
  if [ "$locale" = "en" ]
  then
    locale="${locale}_US"
  elif [ "$locale" = "C" ]
  then
    # The C locale is defined by default for rpm builds, overwrite it
    locale="en_US"
  fi
  cp locale/${locale}/Viewmol /usr/X11R6/lib/X11/app-defaults
  chmod a+r /usr/X11R6/lib/X11/app-defaults/Viewmol
fi