Update for 0.51.0
[wmaker-crm.git] / Install
blobea9c153b26eb2c6ff71d1010fe506ef35e3287b6
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 INSTALL and FAQ files before e-mailing "
43 echo "questions. (we are lazy to reply questions already answered "
44 echo "there as much as you are lazy to read these ;) "
45 perai
46 echo "Did you read the INSTALL file?"
47 echo -n "<y/n> "
48 read rtfm
49 if [ "$rtfm" != y ]; then
50 echo "Please read the INSTALL file before installing"
51 exit
53 echo "Are you sure?"
54 echo -n "<y/n> "
55 read rtfm
56 if [ "$rtfm" != y ]; then
57 echo "Please read the INSTALL file before installing"
58 exit
60 echo "Are you lying?"
61 echo -n "<y/n> "
62 read rtfm
63 if [ "$rtfm" != n ]; then
64 echo "What a shame!"
65 echo "Please read the INSTALL file before installing"
66 exit
68 echo "Do you *swear* that you really read the INSTALL file?"
69 echo -n "<y/n> "
70 read rtfm
71 if [ "$rtfm" != y ]; then
72 echo "Please read the INSTALL file before installing"
73 exit
75 echo "Last chance. You will not get help if you have some problem"
76 echo "because you didn't read that file. Even if your computer explodes."
77 echo "Do you *really* read it?"
78 echo -n "<y/n> "
79 read rtfm
80 if [ "$rtfm" != y ]; then
81 echo "Please read the INSTALL file before installing"
82 exit
84 echo
85 echo "Ok, you have been warned."
86 echo
87 perai
90 if test "$USER" != "root"; then
91 echo
92 echo "Warning: you must run this script as root to install"
93 echo "Window Maker. Hit <Control>-<C> to quit this script."
94 perai
95 echo
99 echo
100 echo "Option Selection"
101 echo "================"
103 ######################## KDE
104 echo
105 echo "Do you want KDE support?"
106 echo -n "<y/n> [n] "
107 read kde
108 if [ "$kde" = y -o "$kde" = Y ]; then
109 OPTIONS="$OPTIONS --enable-kde"
112 ######################## GNOME
113 echo
114 echo "Do you want GNOME support?"
115 echo -n "<y/n> [n] "
116 read gnome
117 if [ "$gnome" = y -o "$gnome" = Y ]; then
118 OPTIONS="$OPTIONS --enable-gnome"
121 ######################## OLWM
122 echo
123 echo "Do you want OPEN LOOK(tm)/olwm support?"
124 echo -n "<y/n> [n] "
125 read olwm
126 if [ "$olwm" = y -o "$olwm" = Y ]; then
127 OPTIONS="$OPTIONS --enable-openlook"
130 ######################## NLS
131 echo
132 echo "Do you want National Language Support?"
133 echo -n "<y/n> [n] "
134 read NLS
136 if [ "$NLS" = "y" -o "$NLS" = "Y" ]; then
137 NLS="Y"
138 echo "The supported locales are:"
139 ling=` (cd po; /bin/ls *.po) `
140 ALL_LINGUAS=""
141 for l in $ling; do
142 lname=`(cd po; grep Language-Team $l|cut -f 2 -d: |cut -f 2 -d\ )`
143 lname=`echo $lname`
144 lcode=`basename $l .po`
145 ALL_LINGUAS="$ALL_LINGUAS $lcode"
146 echo "$lcode $lname"
147 done
148 echo "Type in the locales you want (all will install everything) [none]"
149 read foo
150 if test "$foo" = "all"; then
151 LINGUAS="$ALL_LINGUAS"
152 else
153 LINGUAS="$foo"
155 echo "Selected locales are: $LINGUAS"
157 MB=""
158 for i in $LINGUAS; do
159 ok=0
160 for b in $ALL_LINGUAS; do
161 if test "$b" = "$i"; then
162 ok=1
163 break
165 done
166 if test "$ok" = "0"; then
167 echo
168 echo "$i is not a supported locale"
169 perai
170 continue
173 if [ "$MB" = "" -a "$i" = "ja" -o "$i" = "kr" ]; then
174 echo
175 echo "A language you selected needs multi-byte character support"
176 echo "Do you want to enable it?"
177 echo -n "<y/n> [n] "
178 read MB
179 if [ "$MB" = "y" -o "$MB" = "Y" ]; then
180 OPTIONS="$OPTIONS --enable-kanji"
183 done
184 echo
185 echo "Where do you want to put the message files? [$NLSDIR]"
186 echo -n "? "
187 read foo
188 if test "x$foo" != "x"; then
189 NLSDIR=$foo
192 ##################### Installation path
194 done=0
195 while [ $done = 0 ]; do
196 echo
197 echo "Where do you want to install Window Maker? [$PREFIX]"
198 echo "Don't change it if you don't know what you're doing."
199 if test "$USER" != "root"; then
200 echo "Make sure to specify a path where you have write permission."
202 echo "(The default will put Window Maker in $PREFIX/bin, $PREFIX/lib etc.)"
203 echo -n "? "
204 read foo
205 if test "x$foo" != "x"; then
206 if [ "$foo" = "y" -o "$foo" = "n" ]; then
207 echo
208 echo "Hmm... I don't think you really want to install Window Maker into \"$foo\""
209 echo
210 else
211 done=1
212 PREFIX=$foo
214 else
215 done=1
217 echo
218 echo " $PREFIX/bin must be in the PATH environment variable"
219 echo "of all users who will use Window Maker"
220 echo
221 echo " Make sure $PREFIX/lib is in the /etc/ld.so.conf file"
222 perai
223 done
225 OPTIONS="$OPTIONS --prefix=$PREFIX"
229 ##################### Configure
230 echo "--------------------------"
231 echo "Configuring Window Maker..."
232 echo "--------------------------"
233 if [ `uname -s` = "SCO_SV" ]; then
234 echo "CFLAGS=\"$CFLAGS -belf -DANSICPP\" ./configure $OPTIONS"
236 CFLAGS="$CFLAGS -belf -DANSICPP"
238 perform ./configure $OPTIONS
239 else
240 echo "CFLAGS=\"$CFLAGS $GCCFLAGS\" ./configure $OPTIONS"
242 CFLAGS="$CFLAGS $GCCFLAGS"
244 perform ./configure $OPTIONS
248 #################### Compile
249 echo "-------------------------"
250 echo "Compiling Window Maker..."
251 echo "-------------------------"
252 (cd src; perform make clean)
253 perform make
255 echo "--------------------------"
256 echo "Installing Window Maker..."
257 echo "--------------------------"
259 perform make install
261 if [ `uname -s` = "Linux" ]; then
262 /sbin/ldconfig
265 echo
266 echo "Installation Finished!"
267 echo
268 echo "Now, each user that wishes to use WindowMaker must run the wmaker.inst"
269 echo "script that was just installed."
272 if test "$NLS" = "Y"; then
273 echo "Don't forget to set the LANG environment variable to your locale"