forked from solenopsis/Solenopsis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·127 lines (105 loc) · 4.26 KB
/
install.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
#!/bin/bash
# Copyright 2011 Red Hat Inc.
#
# This file is part of solenopsis
#
# solenopsis is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
# Install script for *nix based operating systems that do not support RPMs
RUN_DIR=`dirname $0`
${RUN_DIR}/uninstall.sh
RUN_LOCAL=""
for PARAM in $*
do
if [ "${PARAM}" = "--local" ]
then
RUN_LOCAL=${PARAM}
fi
done
if [ "${RUN_LOCAL}" = "" ]
then
echo "Cloning the solenopsis git repo"
rm -rf Solenopsis
git clone git://github.com/solenopsis/Solenopsis.git
cd Solenopsis
else
cd ${RUN_DIR}
fi
#
# Take OSX, Linux, etc into account...
#
RUNNING_OS=`uname -a | cut -f 1 -d ' '`
case $RUNNING_OS in
Linux)
SOLENOPSIS_BASH_COMPLETION_HOME=/etc/bash_completion.d
SOLENOPSIS_INSTALL_HOME=/usr/share
SOLENOPSIS_BINARIES=/usr/bin
SOLENOPSIS_PROFILE_PATH=/etc/profile.d
;;
Darwin)
SOLENOPSIS_BASH_COMPLETION_HOME=/usr/local/etc/bash_completion.d
SOLENOPSIS_BINARIES=/usr/local/bin
SOLENOPSIS_PROFILE_PATH=
if type brew >/dev/null; then
SOLENOPSIS_INSTALL_HOME=/usr/local/Cellar
else
SOLENOPSIS_INSTALL_HOME=/usr/share
fi
;;
esac
echo "Installing solenopsis"
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/config
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/docs
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/ant
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/ant/lib
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/ant/lib/1.8.4
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/ant/lib/1.9.1
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/ant/1.1/lib
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/ant/1.1/properties
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/ant/1.1/templates
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/ant/1.1/util
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/ant/1.2/bsh
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/ant/1.2/lib
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/ant/1.2/properties
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/ant/1.2/xslt
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/lib
mkdir -p $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/templates
cp config/defaults.cfg $SOLENOPSIS_INSTALL_HOME/solenopsis/config/
cp docs/* $SOLENOPSIS_INSTALL_HOME/solenopsis/docs/
cp -rf ant $SOLENOPSIS_INSTALL_HOME/solenopsis
cp scripts/solenopsis $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/
cp scripts/bsolenopsis $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/
cp scripts/lib/* $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/lib/
cp scripts/templates/* $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/templates/
cp scripts/solenopsis-profile.sh $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/
rm -rf $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/*.pyc
rm -rf $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/*.pyo
rm -rf $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/lib/*.pyc
rm -rf $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/lib/*.pyo
chmod 755 $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/*
ln -sf $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/solenopsis $SOLENOPSIS_BINARIES/solenopsis
ln -sf $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/bsolenopsis $SOLENOPSIS_BINARIES/bsolenopsis
case $RUNNING_OS in
Linux)
SOLENOPSIS_BASH_COMPLETION_HOME=/etc/bash_completion.d
ln -sf $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/solenopsis-profile.sh $SOLENOPSIS_PROFILE_PATH/solenopsis-profile.sh
;;
esac
if [ -d "${SOLENOPSIS_BASH_COMPLETION_HOME}" ]
then
ln -sf $SOLENOPSIS_INSTALL_HOME/solenopsis/scripts/solenopsis-completion.bash ${SOLENOPSIS_BASH_COMPLETION_HOME}/solenopsis-completion.bash
else
echo "WARNING: Bash completion dir [${SOLENOPSIS_BASH_COMPLETION_HOME}] for [${RUNNING_OS}] does not exist. Ignoring solenopsis completion script."
fi