/
install
executable file
·107 lines (95 loc) · 2.99 KB
/
install
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
#!/usr/bin/env sh
# Installation script for Emacs-IDE
# Copyright (C) 2008-2012 Cédric Marie
# This program 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, see <http://www.gnu.org/licenses/>.
option_local=0
while getopts l OPT
do
case $OPT in
l) option_local=1;;
*) exit 1;;
esac
done
shift $(($OPTIND - 1))
if [ $option_local -eq 0 ]; then
printf "\033[1mCheck root privileges:\033[0m "
if [ $(id -u) -eq 0 ]; then
printf "\033[1;32mOK\033[0m\n\n"
else
printf "\033[1;31mFAILED: You need root privileges to install\033[0m\n"
printf "Alternatively, you can use -l option to install locally, i.e. for this user only\n"
exit 1
fi
fi
printf "\033[1mCheck dependencies\033[0m\n"
printf "ctags: "
if which ctags > /dev/null ; then
if ctags --version | grep -q Exuberant ; then
printf "\033[1;32mOK\033[0m\n"
else
printf "\033[1;31mFAILED: Your version of ctags is not \"Exuberant Ctags\"\033[0m\n"
exit 1
fi
else
printf "\033[1;31mFAILED: ctags is not installed\033[0m\n"
exit 1
fi
printf "cscope: "
if which cscope > /dev/null ; then
printf "\033[1;32mOK\033[0m\n"
else
printf "\033[1;31mFAILED: cscope is not installed\033[0m\n"
exit 1
fi
printf "\n\033[1mRemove .elc files (if any)\033[0m\n"
rm -vf src/*.elc
printf "\n\033[1mCompile Emacs-IDE\033[0m\n"
emacs -nw -q -l compile-eide.el
# -nw: don't use X interface
# -q: don't load ~/.emacs
# -l file.el: load lisp file
compilation_ok=1
for file in `ls src/*.el`; do
printf "${file}: "
if [ -e ${file}c ]; then
printf "\033[1;32mOK\033[0m\n"
else
printf "\033[1;31mFAILED\033[0m\n"
compilation_ok=0
fi
done
if [ $compilation_ok -eq 0 ]; then
exit 1
fi
printf "\n\033[1mInstall Emacs-IDE\033[0m\n"
if [ $option_local -eq 0 ]; then
if [ -d /usr/local/share/emacs/site-lisp ]; then
cp -vf src/*.elc /usr/local/share/emacs/site-lisp/
elif [ -d /usr/share/emacs/site-lisp ]; then
cp -vf src/*.elc /usr/share/emacs/site-lisp/
else
printf "\033[1;31mERROR: Neither /usr/local/share/emacs/site-lisp nor /usr/share/emacs/site-lisp exists\033[0m\n"
exit 1
fi
else
mkdir -p ~/.emacs.d/site-lisp
cp -vf src/*.elc ~/.emacs.d/site-lisp/
fi
printf "\n\033[1mRemove .elc files\033[0m\n"
rm -vf src/*.elc
printf "\n\033[1mInstructions for enabling Emacs-IDE\033[0m\n"
printf "You must add following lines in your ~/.emacs:\n\n"
if [ $option_local -eq 1 ]; then
printf "(add-to-list 'load-path \"~/.emacs.d/site-lisp/\")\n"
fi
printf "(require 'eide)\n"
printf "(eide-start)\n"