new/changelog fix
[wmaker-crm.git] / Install
blobd78e9daa4bb8e9bd29f1ea93ad7e5ab647cb9e0e
1 #!/bin/sh
3 # WindowMaker configuration and compilation script.
5 # Copyright (c) 1997, 1998, 1999 Alfredo K. Kojima
8 export LINGUAS;LINGUAS=""
9 if test "$NLSDIR" = ""; then
10 export NLSDIR;NLSDIR="/usr/lib/locale"
14 OPTIONS=""
15 PREFIX="/usr/local"
17 perai() {
18 echo "Type <Return> to continue"
19 read nada
23 perform() {
24 if ! $* ; then
25 echo
26 echo "Window Maker installation failed or aborted by user."
27 exit 1
32 trap "echo Window Maker installation aborted. ; exit 1" 2 3
34 echo
35 echo "========================="
36 echo "Window Maker Installation"
37 echo "========================="
38 echo
39 echo "NOTE: If this script fails, read the INSTALL file and"
40 echo "install by hand."
41 echo
42 echo "Please read the README, INSTALL and FAQ files before e-mailing "
43 echo "questions. We will IGNORE any questions that are already"
44 echo "answered in the documentation."
45 echo
46 perai
47 echo
48 echo "Did you install libPropList? If not, please install it now."
49 echo
50 perai
51 echo "Did you read the INSTALL file?"
52 echo -n "<y/n> "
53 read rtfm
54 if [ "$rtfm" != y ]; then
55 echo "Please read the INSTALL file before installing"
56 exit
58 echo "Are you sure?"
59 echo -n "<y/n> "
60 read rtfm
61 if [ "$rtfm" != y ]; then
62 echo "Please read the INSTALL file before installing"
63 exit
65 echo "Are you lying?"
66 echo -n "<y/n> "
67 read rtfm
68 if [ "$rtfm" != n ]; then
69 echo "What a shame!"
70 echo "Please read the INSTALL file before installing"
71 exit
73 echo "Do you *swear* that you really read the INSTALL file?"
74 echo -n "<y/n> "
75 read rtfm
76 if [ "$rtfm" != y ]; then
77 echo "Please read the INSTALL file before installing"
78 exit
80 echo "Last chance. You will not get help if you have some problem"
81 echo "because you didn't read that file. Even if your computer explodes."
82 echo "Do you *really* read it?"
83 echo -n "<y/n> "
84 read rtfm
85 if [ "$rtfm" != y ]; then
86 echo "Please read the INSTALL file before installing"
87 exit
89 echo
90 echo "Ok, you have been warned."
91 echo
92 perai
95 if test "$USER" != "root"; then
96 echo
97 echo "Warning: you must run this script as root to install"
98 echo "Window Maker. Hit <Control>-<C> to quit this script."
99 perai
100 echo
104 echo
105 echo "Option Selection"
106 echo "================"
108 ######################## KDE
109 echo
110 echo "Do you want KDE support?"
111 echo -n "<y/n> [n] "
112 read kde
113 if [ "$kde" = y -o "$kde" = Y ]; then
114 OPTIONS="$OPTIONS --enable-kde"
117 ######################## GNOME
118 echo
119 echo "Do you want GNOME support?"
120 echo -n "<y/n> [n] "
121 read gnome
122 if [ "$gnome" = y -o "$gnome" = Y ]; then
123 OPTIONS="$OPTIONS --enable-gnome"
126 ######################## OLWM
127 echo
128 echo "Do you want OPEN LOOK(tm)/olwm support?"
129 echo -n "<y/n> [n] "
130 read olwm
131 if [ "$olwm" = y -o "$olwm" = Y ]; then
132 OPTIONS="$OPTIONS --enable-openlook"
135 ######################## NLS
136 echo
137 echo "Do you want National Language Support?"
138 echo -n "<y/n> [n] "
139 read NLS
141 if [ "$NLS" = "y" -o "$NLS" = "Y" ]; then
142 NLS="Y"
143 echo "The supported locales are:"
144 ling=` (cd po; /bin/ls *.po) `
145 ALL_LINGUAS=""
146 for l in $ling; do
147 lname=`(cd po; grep Language-Team $l|cut -f 2 -d: |cut -f 2 -d\ )`
148 lname=`echo $lname`
149 lcode=`basename $l .po`
150 ALL_LINGUAS="$ALL_LINGUAS $lcode"
151 echo "$lcode $lname"
152 done
153 echo "Type in the locales you want (all will install everything) [none]"
154 read foo
155 if test "$foo" = "all"; then
156 LINGUAS="$ALL_LINGUAS"
157 else
158 LINGUAS="$foo"
160 echo "Selected locales are: $LINGUAS"
162 MB=""
163 for i in $LINGUAS; do
164 ok=0
165 for b in $ALL_LINGUAS; do
166 if test "$b" = "$i"; then
167 ok=1
168 break
170 done
171 if test "$ok" = "0"; then
172 echo
173 echo "$i is not a supported locale"
174 perai
175 continue
178 if [ "$MB" = "" -a "$i" = "ja" -o "$i" = "ko" ]; then
179 echo
180 echo "A language you selected needs multi-byte character support"
181 echo "Do you want to enable it?"
182 echo -n "<y/n> [n] "
183 read MB
184 if [ "$MB" = "y" -o "$MB" = "Y" ]; then
185 OPTIONS="$OPTIONS --enable-kanji"
188 done
189 echo
190 echo "Where do you want to put the message files? [$NLSDIR]"
191 echo -n "? "
192 read foo
193 if test "x$foo" != "x"; then
194 NLSDIR=$foo
197 ##################### Installation path
199 done=0
200 while [ $done = 0 ]; do
201 echo
202 echo "Where do you want to install Window Maker? [$PREFIX]"
203 echo "Don't change it if you don't know what you're doing."
204 if test "$USER" != "root"; then
205 echo "Make sure to specify a path where you have write permission."
207 echo "(The default will put Window Maker in $PREFIX/bin, $PREFIX/lib etc.)"
208 echo -n "? "
209 read foo
210 if test "x$foo" != "x"; then
211 if [ "$foo" = "y" -o "$foo" = "n" ]; then
212 echo
213 echo "Hmm... I don't think you really want to install Window Maker into \"$foo\""
214 echo
215 else
216 done=1
217 PREFIX=$foo
219 else
220 done=1
222 echo
223 echo " $PREFIX/bin must be in the PATH environment variable"
224 echo "of all users who will use Window Maker"
225 perai
226 done
228 OPTIONS="$OPTIONS --prefix=$PREFIX"
232 ##################### Configure
233 echo "--------------------------"
234 echo "Configuring Window Maker..."
235 echo "--------------------------"
236 if [ `uname -s` = "SCO_SV" ]; then
237 echo "CFLAGS=\"$CFLAGS -belf -DANSICPP\" ./configure $OPTIONS"
239 CFLAGS="$CFLAGS -belf -DANSICPP"
241 perform ./configure $OPTIONS
242 else
243 echo "CFLAGS=\"$CFLAGS $GCCFLAGS\" ./configure $OPTIONS"
245 CFLAGS="$CFLAGS $GCCFLAGS"
247 perform ./configure $OPTIONS
251 #################### Compile
252 echo "-------------------------"
253 echo "Compiling Window Maker..."
254 echo "-------------------------"
255 (cd src; perform make clean)
256 perform make
258 echo "--------------------------"
259 echo "Installing Window Maker..."
260 echo "--------------------------"
262 perform make install
264 if [ `uname -s` = "Linux" ]; then
265 echo
266 echo " Make sure $PREFIX/lib is in the /etc/ld.so.conf file"
267 /sbin/ldconfig
270 echo
271 echo "Installation Finished!"
272 echo
273 echo "Now, each user that wishes to use WindowMaker must run the wmaker.inst"
274 echo "script that was just installed."
277 if test "$NLS" = "Y"; then
278 echo "Don't forget to set the LANG environment variable to your locale"