-
Notifications
You must be signed in to change notification settings - Fork 9
/
install.sh
executable file
·108 lines (95 loc) · 2.29 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
#!/bin/bash
#
# Installation script for rtags (works on Unix) - requires ruby and
# irb.
#
# Usage: install.sh [prefix]
#
function fail()
{
echo $1
echo "INSTALLATION FAILED!"
exit 1
}
###############################################################################
#
# CONFIG SECTION - EDIT TO SUIT YOUR SITE
#
###############################################################################
#
# prefix : everything will be installed under this
#
prefix="$1"
if [ "$prefix" == "" ] ; then prefix='/usr/local' ; fi
#
# sudo : set to 'sudo' if you will need sudo to install into prefix
#
sudo=""
#sudo="sudo"
#
# libdir : libs will installed here
#
libdir="${prefix}/lib"
#
# bindir : executables and scripts will installed here
#
bindir="${prefix}/bin"
#
# full path of dir containing packages to be installed
#
packagedir="`pwd`/packages"
#
# full path of dir where packages will be built
#
builddir="`pwd`/build"
###############################################################################
#
# END OF CONFIG SECTION - do not edit below
#
###############################################################################
# listing of all packages to install into $prefix
#
# info
#
printf "\n$div\n"
printf "CONFIG\n"
printf -- "$line\n"
printf "prefix <$prefix>\n"
printf "libdir <$libdir>\n"
printf "bindir <$bindir>\n"
# printf "packagedir <$packagedir>\n"
# printf "builddir <$builddir>\n"
printf -- "$line\n"
#
# important env settings for proper compilation
#
export PATH="${bindir}:$PATH"
export LD_RUN_PATH="${libdir}"
export LD_LIBRARY_PATH="${libdir}"
#
# important aliases for proper complilation and installation
#
make="env LD_RUN_PATH=${libdir} LD_LIBRARY_PATH=${libdir} make"
ruby=`which ruby`
irb=`which irb`
rtags='./bin/rtags'
#
# Test dependencies
#
if [ -z $ruby ]; then
fail "The Ruby interpreter can not be found. Please install Ruby first."
fi
if [ -z $irb ]; then
fail "The irb (interactive Ruby) interpreter can not be found. Please install irb first."
fi
if [ ! -f $rtags ] ; then
fail "Run this script from the root of the unpacked rtags package"
fi
target=$bindir/rtags
if [ -f $target ] ; then
fail "$target already exists, please remove first!"
fi
cp $rtags $target
chmod a+x $target
echo "rtags installed as $target. Try $target --help"
exit 0