Imported Upstream version 1.1.1
[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.  Updated February 2006.
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_srtm2sdf()
20 {
21         cp srtm2sdf /usr/local/bin
22         echo "srtm2sdf installed!"
23 }
24
25 install_fontdata()
26 {
27         cp fontdata /usr/local/bin
28         echo "fontdata installed!"
29 }
30
31 whoami=`whoami`
32
33 if [ $whoami != "root" ]; then
34         echo "Sorry, $whoami.  You need to be 'root' to install this software.  :-("
35 fi
36
37 if [ $# == "0" ]; then
38         echo "Usage: ./install  { citydecoder, srtm2sdf, usgs2sdf, fontdata, all }"
39 else 
40
41         if [ $1 == "citydecoder" ] && [ $whoami == "root" ] && [ -x citydecoder ]; then
42                 install_citydecoder
43         fi
44
45         if [ $1 == "srtm2sdf" ] && [ $whoami == "root" ] && [ -x srtm2sdf ]; then
46                 install_srtm2sdf
47         fi
48
49         if [ $1 == "usgs2sdf" ] && [ $whoami == "root" ] && [ -x usgs2sdf ]; then
50                 install_usgs2sdf
51         fi
52
53         if [ $1 == "fontdata" ] && [ $whoami == "root" ] && [ -x fontdata ]; then
54                 install_fontdata
55         fi
56
57         if [ $1 == "all" ]  && [ $whoami == "root" ]; then
58                 if [ -x citydecoder ]; then
59                         install_citydecoder
60                 fi
61
62                 if [ -x srtm2sdf ]; then
63                         install_srtm2sdf
64                 fi
65
66                 if [ -x usgs2sdf ]; then
67                         install_usgs2sdf
68                 fi
69
70                 if [ -x fontdata ]; then
71                         install_fontdata
72                 fi
73         fi
74
75         if [ $1 != "citydecoder" ] && [ $1 != "srtm2sdf" ] && [ $1 != "usgs2sdf" ] && [ $1 != "fontdata" ] && [ $1 != "all" ]; then
76                 echo "Usage: install { citydecoder, srtm2sdf, usgs2sdf, fontdata, all }"
77         fi
78 fi
79