install
5.75 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/bin/sh
#
# The installation shell for Anubis under Linux.
# Copyright (c) Alain Proute' 2006
#
MUST_LDCONFIG=0
ERROR_COUNT=0
# Performing a command, tracing it and counting errors
function perform ()
{
echo -n " " $1 " ... "
if 2> errors_report $1;
then echo "OK"
else echo "*** Error ***";
((ERROR_COUNT++))
fi
}
# Copying just one Linux library (if needed)
function install_library ()
{
# $1 is the soname of the library
# $2 is the realname of the library
# $3 is the directory where the library must be installed
# We just test if the soname exists
if [ -e "$3/$1" ]
then echo " " Library "$3/$2" already installed
else perform "cp ./lib/$2 $3";
# configuration is postponed
((MUST_LDCONFIG++))
fi
}
# installing Anubis as root
function install_as_root ()
{
echo -e "\n---" Creating the 'anubis' directory \(if needed\) "---"
perform "mkdir -p /usr/share/anubis";
echo -e "\n---" Installing the Anubis library and documentation "---"
perform "tar -C /usr/share/anubis -xzf anubis_files.tar.gz";
echo -e "\n--- Installing the Anubis binaries ---"
perform "tar -xzf anubis_binaries.tar.gz";
perform "cp bin/anubis /usr/bin/anubis";
perform "cp bin/anbexec /usr/bin/anbexec";
perform "chmod a+x /usr/bin/anubis";
perform "chmod a+x /usr/bin/anbexec";
perform "chown root /usr/bin/anbexec";
perform "chgrp root /usr/bin/anbexec";
perform "chmod ug+s /usr/bin/anbexec"
echo -e "\n---" Copying the not already installed Linux libraries "---"
/sbin/ldconfig # to be sure that the current libraries are configured
# Usage: install_library soname realname installation_directory
# All libraries are in ./lib
install_library "libjpeg.so.62" "libjpeg.so.62.0.0" "/usr/lib"
install_library "libssl.so.0.9.7" "libssl.so.0.9.7" "/usr/lib"
install_library "libcrypto.so.0.9.7" "libcrypto.so.0.9.7" "/usr/lib"
install_library "libm.so.6" "libm-2.3.2.so" "/lib"
install_library "libX11.so.6" "libX11.so.6.2" "/usr/X11R6/lib"
install_library "libdl.so.2" "libdl-2.3.2.so" "/lib"
install_library "libstdc++.so.5" "libstdc++.so.5.0.7" "/usr/lib"
install_library "libpthread.so.0" "libpthread-0.10.so" "/lib"
install_library "libc.so.6" "libc-2.3.2.so" "/lib"
install_library "libgcc_s.so.1" "libgcc_s.so.1" "/lib"
echo -e "\n---" Configuring $MUST_LDCONFIG libraries "---"
if [ $MUST_LDCONFIG != 0 ]
then perform "/sbin/ldconfig"
fi
}
# installing Anubis as non root
function install_as_non_root ()
{
echo -e "\n--- Installing Anubis for user '$USER' only. ---"
echo -e "\n---" Creating the 'anubis' directory \(if needed\) "---"
perform "mkdir -p $HOME/anubis";
echo -e "\n---" Installing the Anubis library and documentation "---"
perform "tar -C $HOME/anubis -xzf anubis_files.tar.gz";
echo -e "\n--- Installing the Anubis binaries ---"
perform "mkdir -p $HOME/bin";
perform "mkdir -p $HOME/anubis/lib";
perform "tar -xzf anubis_binaries.tar.gz";
perform "cp bin/anubis $HOME/bin/anubis";
perform "cp bin/anbexec $HOME/bin/anbexec";
perform "chmod a+x $HOME/bin/anubis";
perform "chmod a+x $HOME/bin/anbexec";
echo -e "\n---" Copying the not already installed Linux libraries "---"
perform "mkdir -p $HOME/anubis/lib"
# Usage: install_library soname realname installation_directory
# All libraries are in ./lib
install_library "libjpeg.so.62" "libjpeg.so.62.0.0" "$HOME/anubis/lib"
install_library "libssl.so.0.9.7" "libssl.so.0.9.7" "$HOME/anubis/lib"
install_library "libcrypto.so.0.9.7" "libcrypto.so.0.9.7" "$HOME/anubis/lib"
install_library "libm.so.6" "libm-2.3.2.so" "$HOME/anubis/lib"
install_library "libX11.so.6" "libX11.so.6.2" "$HOME/anubis/lib"
install_library "libdl.so.2" "libdl-2.3.2.so" "$HOME/anubis/lib"
install_library "libstdc++.so.5" "libstdc++.so.5.0.7" "$HOME/anubis/lib"
install_library "libpthread.so.0" "libpthread-0.10.so" "$HOME/anubis/lib"
install_library "libc.so.6" "libc-2.3.2.so" "$HOME/anubis/lib"
install_library "libgcc_s.so.1" "libgcc_s.so.1" "$HOME/anubis/lib"
echo -e "\n---" Configuring $MUST_LDCONFIG libraries "---"
perform "/sbin/ldconfig -n $HOME/anubis/lib"
}
# Installing Anubis
function install_anubis ()
{
if [ $UID == "0" ]
then echo -e "\n---" Installing Anubis as \'root\' "---";
install_as_root
else if [ $1 == "non_root" ]
then install_as_non_root
else
echo -e " (1) If you have 'root' access, you should better install Anubis as 'root'."
echo -e " Hence, become 'root' before restarting this installation shell."
echo -e " (2) If definitely you have no 'root' access, you can still install"
echo -e " Anubis as a non privileged user. In this case, just issue the command:"
echo -e " install non_root"
return
fi
fi
if [ $ERROR_COUNT != 0 ]
then echo -e "\n--- $ERROR_COUNT errors occured. ---"
else echo -e "\n--- Installation successful. ---"
echo -e " You may remove the directory '$(pwd)' and its content."
fi
if [ $UID == "0" ]
then echo -e "Each user must execute 'anubis' at least one time to have"
echo -e "the 'my_anubis' directory setup in his 'home' directory."
echo -e "The documentation may be found in '/usr/share/anubis/en' or"
echo -e "'/usr/share/anubis/fr'."
else echo -e "You must now execute 'anubis' at least one time to have"
echo -e "your 'my_anubis' directory setup in your 'home' directory."
echo -e "The documentation may be found in '" $HOME "/anubis/en' or"
echo -e "'" $HOME "/anubis/fr'."
fi
}
install_anubis $*