forked from atheme/atheme
/
setup
executable file
·187 lines (163 loc) · 3.42 KB
/
setup
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#!/bin/sh
#
# Copyright (c) 2005 Atheme Development Group
# Rights to this code are documented in doc/LICENSE.
#
# This file is a simple setup script.
#
# $Id: setup 7871 2007-03-06 01:24:00Z nenolod $
PREFIX="$HOME/atheme"
LARGENET="no"
NLS="yes"
SASL="yes"
VERSION=`grep AC_INIT configure.ac | awk '{print \$2}' | sed s:\,::g`
if [ "x$PAGER" = "x" ]; then
PAGER="more"
fi
export ok INPUT
clear
cat .logo
echo " version $VERSION"
echo ""
if [ -f doc/RELEASE ] ; then
ok=0
echo "Would you like to read the release notes (recommended)?"
while [ $ok -eq 0 ] ; do
echo -n "[Yes] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
echo ""
$PAGER doc/RELEASE
echo ""
echo "-----"
ok=1
fi
case $INPUT in
[Yy]*)
echo ""
$PAGER doc/RELEASE
ok=1
;;
[Nn]*)
ok=1
;;
esac
done
echo ""
fi
ok=0
echo "Where do you want Atheme to be installed?"
echo "Press enter for the default, or type a new destination."
while [ $ok -eq 0 ] ; do
echo -n "[$PREFIX] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$PREFIX
ok=1
else
ok=1
fi
done
PREFIX=$INPUT
echo ""
ok=0
echo "Are you running a large network (more than 2000 users)?"
while [ $ok -eq 0 ] ; do
echo -n "[$LARGENET] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$LARGENET
ok=1
else
ok=1
fi
done
LARGENET=$INPUT
ARGS="--prefix=$PREFIX"
case "$LARGENET" in
[Yy])
ARGS="$ARGS --enable-large-net"
;;
Yes)
ARGS="$ARGS --enable-large-net"
;;
yes)
ARGS="$ARGS --enable-large-net"
;;
esac
echo ""
ok=0
echo "Would you like to enable support for internationalization of"
echo "the messages used by Services? This will require gettext to be"
echo "installed."
while [ $ok -eq 0 ] ; do
echo -n "[$NLS] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=$NLS
ok=1
else
ok=1
fi
done
NLS=$INPUT
case "$NLS" in
[Yy])
ARGS="$ARGS --enable-nls"
;;
Yes)
ARGS="$ARGS --enable-nls"
;;
yes)
ARGS="$ARGS --enable-nls"
;;
esac
echo ""
ok=0
echo "Would you like to pass any additional options to configure? If so,"
echo "place them here:"
while [ $ok -eq 0 ] ; do
echo -n "[no] "
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
if [ ! "$INPUT" ] ; then
INPUT=""
ok=1
else
ok=1
fi
done
ARGS="$ARGS $INPUT"
if [ ! -f configure ]; then sh autogen.sh; fi
sh configure $ARGS
if [ $? != 0 ]; then
echo "Configure failed"
echo "Command was: sh configure $ARGS"
echo "Please fix this and try again"
exit 1
fi
echo ""
echo "Press enter to begin compilation."
echo -n ""
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
make
if [ $? != 0 ]; then
echo "Compilation failed"
echo "Command was: make"
echo "Please fix this and try again"
exit 1
fi
echo ""
echo "Press enter to begin installation."
echo -n ""
if read INPUT ; then : ; else echo "" ; exit 1 ; fi
make install
if [ $? != 0 ]; then
echo "Installation failed"
echo "Command was: make install"
echo "Please fix this and try again"
exit 1
fi
echo "----------------------------------------------------------------"
echo ">>> Atheme setup completed on `date`"
echo "----------------------------------------------------------------"
exit 0