forked from hepcat72/CFF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_linux.sh
executable file
·143 lines (121 loc) · 4.02 KB
/
install_linux.sh
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/bash
#This script is for linux installation only.
#MUST BE EXECUTED FROM THE MAIN CFF DIRECTORY
#USAGE 1: sudo install.tcsh <USEARCH>
#USAGE 2: sudo install.tcsh <USEARCH> <MUSCLE>
#Where the first and second parameters indicate how to install/configure the usearch
#and muscle executables. In other words, "<USEARCH>" and "<MUSCLE>" can be:
# 1. A download URL directly to a tarball or executable file
# 2. A tarball or executable file
# 3. "skip" or "ignore"
#Example:
# install.tcsh http://drive5.com/cgi-bin/upload3.py?license=0000000000000000000
#
#A usearch URL/tarball/executable is required for a successful install. usearch and
#muscle are third-party applications not maintained by us. The muscle executable is
#directly downloadable for anyone, but to get usearch, you must visit
#http://www.drive5.com/usearch/download.html and agree to the terms.
preinstall=0
##
## Make sure curl is installed
##
which curl
if [ $? -ne 0 ]
then
if [ "$EUID" -ne 0 ]
then
echo "Please run this script as root with no parameters so dependencies of the install.tcsh script can be installed first. Then run install.tcsh with your CFF install parameters."
exit 1
fi
apt-get install curl
if [ $? -ne 0 ]
then
#We will try to update the OS
apt-get update
echo
echo '## ERROR 2: Unable to install curl. Going to try an update of apt-get. A window should appear in a moment to walk you through the update.'
echo -n 'Hit return when the update is complete: '
apt-get install curl
if [ $? -ne 0 ]
then
echo "ERROR 3: Still unable to install curl. Please manually install curl to proceed."
exit 3
fi
fi
echo "curl has been installed successfully."
preinstall=1
fi
##
## Make sure tcsh is installed
##
which tcsh
if [ $? -ne 0 ]
then
if [ "$EUID" -ne 0 ]
then
echo "Please run this script as root with no parameters so dependencies of the install.tcsh script can be installed first. Then run install.tcsh with your CFF install parameters."
exit 1
fi
apt-get install tcsh
if [ $? -ne 0 ]
then
#We will try to update the OS
apt-get update
echo
echo '## ERROR 4: Unable to install tcsh. Going to try an update of apt-get. A window should appear in a moment to walk you through the update.'
echo -n 'Hit return when the update is complete: '
apt-get install tcsh
if [ $? -ne 0 ]
then
echo "ERROR 5: Still unable to install tcsh. Please manually install tcsh to proceed."
exit 5
fi
fi
echo "tcsh has been installed successfully."
preinstall=1
fi
##
## make sure ExtUtils::MakeMaker is installed
##
perl -e 'use ExtUtils::MakeMaker' >& /dev/null
if [ $? -ne 0 ]
then
if [ "$EUID" -ne 0 ]
then
echo "Please run this script as root with no parameters so dependencies of the install.tcsh script can be installed first. Then run install.tcsh with your CFF install parameters."
exit 1
fi
sudo yum install -y perl-CPAN
if [ $? -ne 0 ]
then
echo "ERROR 5: Unable to install the tcsh shell"
exit 5
fi
echo "perl module: ExtUtils::MakeMaker has been installed successfully. You may now install CFF by running install.tcsh with a usearch download link."
preinstall=1
fi
args=$#
if [ $args -eq 0 ]
then
if [ "$EUID" -eq 0 ]
then
if [ "$preinstall" -eq 1 ]
then
echo
echo "Dependencies installed. Install CFF by running install.tcsh with a usearch download link."
echo
exit 0
fi
echo
echo "Dependencies appear to already have been installed. Install CFF by running install.tcsh with a usearch download link."
echo
exit 0
fi
fi
if [ ! -e install.tcsh ]
then
echo "ERROR 6: Please run this script from inside the CFF directory."
exit 6
fi
echo "./install.tcsh $@"
./install.tcsh "$@"