-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_emacs_24.5.sh
executable file
·85 lines (66 loc) · 1.88 KB
/
install_emacs_24.5.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
#!/bin/bash
#Script to install emacs 24.5 from the emacs mirror hosted in github
version="emacs-24.5"
url="https://github.com/emacs-mirror/emacs/tarball/$version"
uninstall_flag=$1
function main {
if [[ $uninstall_flag == "--uninstall" ]]; then
uninstall_emacs
else
install_dependencies
install_emacs
install_success
fi
}
function install_dependencies {
sudo apt-get install build-essential \
texinfo libx11-dev libxpm-dev libjpeg-dev libpng-dev \
libgif-dev libtiff-dev libgtk2.0-dev libncurses-dev \
libxml2 libxml2-dev \
autoconf automake
}
function install_emacs {
echo "Go $HOME"
cd $HOME
echo "Creating the emacs folder..."
mkdir emacs
echo "Go to the created emacs folder..."
cd $HOME/emacs
echo "Invoque and untar from the mirror hosted in github"
echo $url
curl -o emacs-$version.tar.gz -L $url
info_tar=$(tar -axvf emacs-$version.tar.gz)
echo "info_tar: $info_tar"
tmp_folder=$(echo $info_tar | cut -f1 -d" ")
echo "Go to $tmp_folder folder"
cd $tmp_folder
echo "Executing the autogen.sh"
./autogen.sh
echo "Executing the default settings"
./configure
echo "Making the installer"
make
echo "Execute the installer with superuser mode, "
echo "basically the binary copy to the path /usr/local/bin"
sudo make install
echo "done!"
}
function uninstall_emacs {
read -p "Are you sure to uninstall emacs? (y/n)" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Go to source folder"
cd "$HOME/emacs/emacs-$version"
echo "uninstalling..."
sudo make uninstall
cd $HOME
sudo rm -fr "$HOME/emacs/emacs-$version"
echo "done."
else
exit 1
fi
}
function install_success {
echo "emacs has been successfully installed :D"
emacs --version
}
main