Imported Upstream version 1.1.0
[debian/splat] / utils / install
1 #!/bin/bash
2 #
3 # Simple shell script for installing SPLAT! and associated utilities.
4 # Written by John A. Magliacane, KD2BD April 2002
5 #
6
7 install_citydecoder()
8 {
9         cp citydecoder /usr/local/bin
10         echo "citydecoder installed!"
11 }
12
13 install_usgs2sdf()
14 {
15         cp usgs2sdf /usr/local/bin
16         echo "usgs2sdf installed!"
17 }
18
19 install_fontdata()
20 {
21         cp fontdata /usr/local/bin
22         echo "fontdata installed!"
23 }
24
25 whoami=`whoami`
26
27 if [ $whoami != "root" ]; then
28         echo "Sorry, $whoami.  You need to be 'root' to install this software.  :-("
29 fi
30
31 if [ $# == "0" ]; then
32         echo "Usage: ./install  { citydecoder, usgs2sdf, fontdata, all }"
33 else 
34
35         if [ $1 == "citydecoder" ] && [ $whoami == "root" ] && [ -x citydecoder ]; then
36                 install_citydecoder
37         fi
38
39         if [ $1 == "usgs2sdf" ] && [ $whoami == "root" ] && [ -x usgs2sdf ]; then
40                 install_usgs2sdf
41         fi
42
43         if [ $1 == "fontdata" ] && [ $whoami == "root" ] && [ -x fontdata ]; then
44                 install_fontdata
45         fi
46
47         if [ $1 == "all" ]  && [ $whoami == "root" ]; then
48                 if [ -x citydecoder ]; then
49                         install_citydecoder
50                 fi
51
52                 if [ -x usgs2sdf ]; then
53                         install_usgs2sdf
54                 fi
55
56                 if [ -x fontdata ]; then
57                         install_fontdata
58                 fi
59         fi
60
61         if [ $1 != "citydecoder" ] && [ $1 != "usgs2sdf" ] && [ $1 != "fontdata" ] && [ $1 != "all" ]; then
62                 echo "Usage: install { citydecoder, usgs2sdf, fontdata, all }"
63         fi
64 fi