-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall.sh
executable file
·66 lines (48 loc) · 1.64 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
#!/usr/bin/env bash
GIT_REQUIRED_VERSION=1.7
echo "Checking git version ..."
echo ""
echo "Required : $GIT_REQUIRED_VERSION"
GIT_VERSION=$(git version | /usr/bin/perl -pe 's/.*?(\d+\.\d+).*/$1/')
echo "Version : $GIT_VERSION"
echo ""
if [ -z "$GIT_VERSION" ]; then
echo "Unable to detect git version"
echo "Canceling installation ..."
echo ""
exit 1
fi
GIT_VERSION_OK=$(echo "$GIT_VERSION >= $GIT_REQUIRED_VERSION" | bc)
if [ "$GIT_VERSION_OK" = "0" ]; then
echo "You need at least git version $GIT_REQUIRED_VERSION !"
echo "Canceling installation ..."
echo ""
exit 1
fi
cd "$(dirname "$0")"
export GRS_ROOT=$HOME/.grs
export GRS_ROOT_LIB=$GRS_ROOT/perl5
export GRS_ROOT_INSTALL=$GRS_ROOT/grs
export PERL_CPANM_OPT="--mirror-only --mirror http://cpan.celogeek.fr --mirror http://cpan.org -l $GRS_ROOT_LIB -L $GRS_ROOT_LIB -nq --self-contained"
set -e
rm -rf "$GRS_ROOT_INSTALL"
mkdir -p "$GRS_ROOT" "$GRS_ROOT_LIB" "$GRS_ROOT_INSTALL"
curl -sL http://cpanmin.us/ | /usr/bin/perl - -v App::local::lib::helper IO::Socket::SSL LWP::Protocol::https Redmine::API Moo MooX::Options Version::Next DateTime Term::ReadLine Date::Parse LWP::UserAgent List::MoreUtils List::Util List::Util::XS autodie utf8::all Term::Size Digest::MD5 Data::UUID JSON::XS URI::Escape IO::Interactive REST::Client URI DDP
cp -RvL share "$GRS_ROOT_INSTALL"
cp -av bin "$GRS_ROOT_INSTALL"
set +e
cat <<EOF
The installation of Git Redmine Suite is done.
Please add this to your bashrc file :
export PATH=\$HOME/.grs/grs/bin:\$PATH
EOF
if [ -n "$CURPWD" ] && [ -n "$1" ]
then
echo ""
echo "Move to $CURPWD"
cd "$CURPWD"
echo ""
echo "Run : $*"
echo ""
exec $*
fi