/[pkg-mixmaster]/trunk/Mix/Install
ViewVC logotype

Contents of /trunk/Mix/Install

Parent Directory Parent Directory | Revision Log Revision Log


Revision 693 - (hide annotations) (download)
Fri Dec 26 00:20:04 2003 UTC (9 years, 5 months ago) by rabbi
File size: 23417 byte(s)
Look for libs on x86_64 platforms.
1 rabbi 1 #!/bin/sh
2 rabbi 685 # Mixmaster version 3.0 -- (C) 1999-2003 Anonymizer Inc. and others.
3 rabbi 1
4     # Mixmaster may be redistributed and modified under certain conditions.
5     # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
6     # ANY KIND, either express or implied. See the file COPYRIGHT for
7     # details.
8    
9 weasel 647 # $Id$
10 rabbi 1
11     #whereis program default-path
12     whereis()
13     {
14     #echo "Looking for $1..."
15     found=""
16     for i in $* `which $1 2>&1`
17     do
18     if [ -f "$i" -a -x "$i" ]
19     then
20     found=$i
21     fi
22     done
23     if [ "$found" = "" ]
24     then
25     found=$2
26     # echo "$1 not found. Using $found."
27     # else
28     # echo "$1 is at $found."
29     fi
30     }
31    
32     if echo -n | grep n >/dev/null
33     then
34     echo1=""
35     echo2="\c"
36     else
37     echo1="-n"
38     echo2=""
39     fi
40    
41     # readln text default
42     readln()
43     {
44     echo $echo1 "$1 [$2] $echo2"
45     read ans
46     if [ -z "$ans" ]
47     then
48     ans="$2"
49     fi
50     }
51    
52     # findlib libxxx.a -- find and configure libraries
53     # Input:
54     # $1 library name
55     # $CONFIG library configure options
56     # $INCDIR possible include directories
57     # $SRCDIR possible library source directories
58     # $LIBDIR possible library binary directories
59     #
60     # Output:
61     # $found library directory
62     # $lib library name
63     # $INCDIR include directory if required, empty otherwise
64     # $LDFLAG linker options
65     # $LIB path to library file
66     # $MAKELIB Makefile entry to compile library
67     findlib()
68     {
69     lib=$1
70     libso=`echo $lib | sed 's/\.a$/.so/'`
71     echo "Looking for $lib..."
72    
73     found=
74     source=
75     type=
76     LIB=
77     LDFLAG=
78     MAKELIB=
79    
80 rabbi 693 for i in /usr/local/lib /usr/lib /lib /usr/lib64
81 rabbi 1 do
82     if [ -r $i/$lib -o -r $i/$libso ]
83     then
84     found=$i
85     type=system
86     fi
87     done
88    
89     for i in $LIBDIR
90     do
91     if [ -r $i/$lib -o -r $i/$libso ]
92     then
93     found=$i
94     type=installed
95     fi
96     done
97    
98     for i in $SRCDIR
99     do
100     if [ -r $i/$lib -o -r $i/lib/$lib ]
101     then
102     found=$i
103     type=binary
104     fi
105     done
106    
107     if [ -r "$found/$libso" ]
108     then
109     echo "Found at $found/$libso."
110     elif [ -r "$found/$lib" ]
111     then
112     echo "Found at $found/$lib."
113     elif [ -r "$found/lib/$lib" ]
114     then
115     echo "Found at $found/lib/$lib."
116     fi
117    
118     for i in $SRCDIR
119     do
120     if [ -d $i -a ! "$type" = binary ]
121     then
122     source=$i
123     fi
124     done
125    
126     if [ "$source" != "" ]
127     then
128     echo "Found source directory $source."
129     if [ "$found" = "" ]
130 weaselp 341 then
131 rabbi 1 ans=y
132     else
133     echo "Use the source if the pre-installed library causes compilation problems."
134     readln "Use source?" n
135     fi
136     if [ "$ans" = "y" ]
137     then
138     found=$source
139     type=source
140     fi
141     fi
142    
143     if [ "$found" = "" ]
144     then
145     echo "Not found."
146     fi
147    
148     if [ -r $found/lib/$lib ]
149     then
150     LIB=$found/lib/$lib
151     else
152     LIB=$found/$lib
153     fi
154     if [ "$type" = system ]
155     then
156     LIB=
157 weaselp 405 LDFLAG="-l`echo $lib | sed 's/^lib//;s/\.a$//'` -L$found"
158     if [ "$found" = "/usr/local/lib" ]
159     then
160     INCDIR="/usr/local/include $INCDIR"
161     fi
162 rabbi 1 fi
163    
164     incdir=$INCDIR
165     INCDIR=
166     for i in $incdir
167     do
168     if [ -d $i ]
169     then
170     INCDIR=$i
171     fi
172     done
173    
174     if [ "$type" = source -o "$type" = binary ]
175     then
176     if [ ! -r $found/lib/$lib ]
177     then
178     MAKELIB="$found/$lib:
179     cd $found; make $lib"
180     fi
181     if [ -d $found/include ]
182     then
183     INCDIR=$found/include
184     else
185     INCDIR=$found
186     fi
187     fi
188    
189     if [ "$type" = source ]
190     then
191     dir=`pwd`
192     if [ "$dir" = "" ]
193     then
194     dir=$PWD
195     fi
196    
197     cd $found
198     if [ -x configure ]
199     then
200     echo "Configuring..."
201     ./configure $CONFIG
202     fi
203     if [ "$lib" = "libcrypto.a" ]
204     then
205     if [ -f config ]
206     then
207     sh config
208     elif [ -x Configure ]
209     then
210     ./Configure 2>tmp.$$
211     cat tmp.$$
212     readln "Your system?" `cat tmp.$$ | tr ' ' '\n' | grep -i \`uname\` | tail -1`
213     rm -f tmp.$$
214     echo "Configuring..."
215     ./Configure $ans
216     fi
217     fi
218     cd $dir
219     fi
220     }
221    
222 dybbuk 692 # Global installation.
223    
224    
225 rabbi 1 ##########################################################################
226     umask 077
227    
228     if [ `whoami` = root ]
229     then
230     echo "Please create a new user, e.g, \`mix', and install Mixmaster under that
231     user id. Installing Mixmaster as root is not recommended."
232     readln "Continue anyway?" n
233     if [ "$ans" = n ]
234     then
235     exit 1
236     fi
237     fi
238    
239 dybbuk 393 MIXDIR="$PWD"
240 rabbi 1 if [ "$MIXDIR" = "" ]
241     then
242     MIXDIR=`pwd`
243     fi
244 dybbuk 393 MIXCFG="$MIXDIR/conf"
245     MIXSRC="$MIXDIR/Src"
246 rabbi 1 MIXDEST0=${MIXPATH:-$HOME/Mix}
247    
248     system=`uname`
249     if [ "$system" = "MS-DOS" ]
250     then
251     system=msdos
252     fi
253    
254     if [ "$HOSTNAME" = "" ]
255     then
256     HOSTNAME=`hostname`
257     fi
258     if [ "$HOSTNAME" = "" ]
259     then
260     HOSTNAME=msdos
261     system=msdos
262     fi
263    
264     if [ "$system" = msdos ]
265     then
266     MIXDEST0=${MIXPATH:-C:/Mix}
267     fi
268    
269 dybbuk 393 if [ -f "$MIXSRC/Makefile" ]
270 rabbi 1 then
271     if grep "#Makefile generated.*$HOSTNAME" $MIXSRC/Makefile
272     then
273 rabbi 220 echo "Found a Makefile for this system."
274     readln "Use this Makefile?" y
275     if [ "$ans" = n ]
276     then
277 dybbuk 393 rm -f "$MIXSRC/Makefile"
278 rabbi 220 fi
279 rabbi 1 else
280     readln "Remove old Makefile?" y
281     if [ "$ans" = y ]
282     then
283 dybbuk 393 rm -f "$MIXSRC/Makefile"
284 rabbi 1 fi
285     fi
286     fi
287    
288 dybbuk 393 if [ -f "$MIXSRC/Makefile" ]
289 rabbi 1 then
290     MIXDEST=`grep "DSPOOL=" $MIXSRC/Makefile | sed 's/.*DSPOOL=..//;s/\".*//'`
291     if [ "$MIXDEST" = "" ]
292     then
293     MIXDEST="$MIXDEST0"
294     fi
295     fi
296    
297     if [ "$MIXDEST" = "" ]
298     then
299 dybbuk 393 readln "Mixmaster directory?" "$MIXDEST0"
300 rabbi 1 MIXDEST=$ans
301     else
302     echo "Mixmaster directory: $MIXDEST"
303     fi
304    
305 dybbuk 393 if [ ! -d "$MIXDEST" ]
306 rabbi 1 then
307     echo "Creating directory $MIXDEST"
308 dybbuk 393 mkdir "$MIXDEST"
309 rabbi 1 fi
310    
311 dybbuk 393 if [ ! -d "$MIXDEST" ]
312 rabbi 1 then
313     echo "Cannot not create $MIXDEST"
314     exit 1
315     fi
316    
317 dybbuk 393 if [ -f "$MIXDEST/mix.cfg" ]
318 rabbi 1 then
319 dybbuk 393 if [ -f "$MIXDEST/secring.mix" ]
320 rabbi 1 then
321     remailer=y
322 dybbuk 393 if grep PASSPHRASE "$MIXDEST/mix.cfg" >/dev/null
323 weaselp 157 then
324     PASSINCONFIG=1
325     fi
326 rabbi 1 else
327     readln "Do you want to set up a remailer?" n
328     remailer=$ans
329     fi
330 dybbuk 393 elif [ -f "$MIXDEST/mixmaster.conf" ]
331 rabbi 1 then
332     echo "Upgrading from Mixmaster 2.0.*"
333     remailer=n
334     else
335     readln "Do you want to set up a remailer?" y
336     remailer=$ans
337     fi
338    
339 weaselp 157
340     ans=""
341     if [ "$remailer" = "y" ]
342     then
343     ans="n"
344     if [ "$PASSINCONFIG" != 1 ]
345     then
346 rabbi 241 echo ""
347     echo "You can either compile your secret passphrase into the binary
348 weaselp 157 or you can set it in your config file. Note that the former does not
349 rabbi 241 really increase security as the passphrase can still be discovered by
350     running something like »strings mix«."
351     echo ""
352     echo "Most users should answer »n« to this question:"
353     echo ""
354 rabbi 193 readln "Do you want to compile the passphrase into the binary?" n
355 weaselp 157 fi
356    
357     rm -f "$MIXSRC/mix.o" # make sure our new passphrase takes effect
358     if [ "$ans" = "y" ]
359     then
360     ans=""
361 rabbi 220 echo "Please enter a passphrase for your remailer (must be the same
362 weaselp 157 whenever you re-compile Mixmaster)."
363     read ans
364    
365     if [ "$ans" != "" ]
366     then
367     PASS="PASS=$ans"
368     else
369     echo "WARNING: not setting a passphrase"
370     fi
371     else
372     if [ "$PASSINCONFIG" != 1 ]
373     then
374     ans=""
375 rabbi 220 echo "Please enter a passphrase for your remailer (it will be
376 weaselp 157 stored in mix.cfg in clear)."
377     read ans
378    
379 rabbi 209 if [ "$ans" = "" ]
380 weaselp 157 then
381     echo "WARNING: setting empty passphrase"
382     fi
383 weaselp 341 PASSPHRASE="PASSPHRASE $ans"
384 weaselp 236 if [ -f $MIXDEST/mix.cfg ]
385 rabbi 233 then
386 weaselp 236 echo "$PASSPHRASE" >> $MIXDEST/mix.cfg
387 rabbi 232 fi
388 weaselp 157 fi
389     fi
390     fi
391    
392    
393 dybbuk 393 cd "$MIXSRC"
394 rabbi 1 if [ ! -f Makefile ]
395     then
396     LIBS=
397     INC=
398     DEF=
399     LDFLAGS=
400    
401 weaselp 157 if [ ! -z "$PASS" ]
402     then
403     DEF="$DEF -DCOMPILEDPASS='\"\$(PASS)\"'"
404     fi
405    
406 rabbi 1 if [ "$system" = msdos ]
407     then
408     readln "Use WIN32 GUI?" y
409     if [ "$ans" = y ]
410     then
411     system=win32
412     LDFLAGS=-lwsock32
413     fi
414     fi
415     if [ "$system" = SunOS ]
416     then
417     LDFLAGS="-lsocket -lnsl"
418     fi
419    
420     LIBDIR=
421     INCDIR=
422 dybbuk 691 # SRCDIR=zlib*
423 rabbi 1 findlib libz.a
424     if [ "$found" = "" ]
425     then
426     readln "Continue anyway?" n
427     if [ "$ans" = "n" ]
428     then
429 rabbi 100 echo "Please install zlib 1.1.4 or greater now."
430 rabbi 1 exit 1
431     fi
432     else
433     ZLIB="$MAKELIB"
434     DEF="$DEF -DUSE_ZLIB"
435     LIBS="$LIBS $LIB"
436     LDFLAGS="$LDFLAGS $LDFLAG"
437     if [ "$INCDIR" != "" ]
438     then
439     INC="$INC -I$INCDIR"
440     fi
441     fi
442    
443     LIBDIR=
444     INCDIR=
445 dybbuk 691 # SRCDIR=pcre*
446 rabbi 1 findlib libpcre.a
447     if [ "$found" != "" ]
448     then
449     PCRE="$MAKELIB"
450     DEF="$DEF -DUSE_PCRE"
451     LIBS="$LIBS $LIB"
452     LDFLAGS="$LDFLAGS $LDFLAG"
453     if [ "$INCDIR" != "" ]
454     then
455     INC="$INC -I$INCDIR"
456     fi
457     fi
458    
459 rabbi 685 opensslinfo="Please get OpenSSL 0.9.6l or greater from http://www.openssl.org/"
460     opensslwarning6="WARNING: This version of OpenSSL contains known vulnerabilities. Please upgrade to OpenSSL 0.9.6l or greater!"
461     opensslwarning7="WARNING: This version of OpenSSL contains known vulnerabilities. Please upgrade to OpenSSL 0.9.7c or greater!"
462     opensslwarning0=$opensslwarning7
463 rabbi 1 LIBDIR=/usr/local/ssl/lib
464     INCDIR="/usr/include /usr/include/ssl /usr/lib/ssl/include /usr/local/ssl/include"
465     SRCDIR="openssl*"
466    
467 rabbi 209 opensslwarn()
468     {
469 rabbi 685 if [ "$1" = "6" ]
470     then
471     echo $opensslwarning6
472     elif [ "$1" = "7" ]
473     then
474     echo $opensslwarning7
475     else
476     echo $opensslwarning0
477     fi
478 rabbi 209 readln "Continue anyway?" y
479     if [ "$ans" = "n" ]
480     then
481     echo $opensslinfo
482     exit 1
483     fi
484     }
485    
486 rabbi 1 if [ "$system" = win32 ]
487     then
488     findlib libeay32.a
489     else
490     findlib libcrypto.a
491     fi
492     if [ "$found" = "" ]
493     then
494     echo $opensslinfo
495     exit 1
496     fi
497    
498 weaselp 412 OPENSSLLIB="$LIB"
499 rabbi 1 LIBS="$LIBS $LIB"
500     LDFLAGS="$LDFLAGS $LDFLAG"
501     if [ "$MAKELIB" != "" ]
502     then
503     OPENSSL="$found/$lib:
504     cd $found/crypto; make"
505     fi
506     if [ -d "$INCDIR/openssl" ]
507     then
508     INC="$INC -I$INCDIR"
509     else
510     # detect old SSLeay versions
511     if [ -f "$INCDIR/crypto.h" ]
512     then
513     version=800
514     if grep OPENSSL "$INCDIR/crypto.h" > /dev/null
515     then
516     version=920
517     fi
518     fi
519 weaselp 341 fi
520 rabbi 1
521     # Find the OpenSSL version header
522 dybbuk 393 if [ -f "$INCDIR/openssl/opensslv.h" ]
523 rabbi 1 then
524 rabbi 93 version=`grep 'SSL.*_VERSION_NUMBER.*0x' $INCDIR/openssl/opensslv.h | sed 's/.*0x0*//;s/[ ].*//;s/L$//'`
525 dybbuk 393 elif [ -f "$INCDIR/opensslv.h" ]
526 rabbi 93 then
527 rabbi 8 version=`grep 'SSL.*_VERSION_NUMBER.*0x' $INCDIR/opensslv.h | sed 's/.*0x0*//;s/[ ].*//;s/L$//'`
528 rabbi 1 fi
529     if [ "$version" = "" ]
530     then
531     echo "Warning: Can't find OpenSSL version number!"
532     readln "Continue anyway?" y
533     if [ "$ans" = "n" ]
534     then
535     echo $opensslinfo
536     exit 1
537     fi
538 rabbi 210 elif [ "$version" = "90581f" ]
539 rabbi 1 then
540 rabbi 100 echo "Compiling with OpenSSL 0.9.5a."
541 rabbi 685 opensslwarn 6
542 rabbi 210 elif [ "$version" = "90601f" ]
543 rabbi 100 then
544 rabbi 93 echo "Compiling with OpenSSL 0.9.6a."
545 rabbi 685 opensslwarn 6
546 rabbi 210 elif [ "$version" = "90602f" ]
547 rabbi 93 then
548     echo "Compiling with OpenSSL 0.9.6b."
549 rabbi 685 opensslwarn 6
550 rabbi 210 elif [ "$version" = "90603f" ]
551 rabbi 93 then
552     echo "Compiling with OpenSSL 0.9.6c."
553 rabbi 685 opensslwarn 6
554 rabbi 210 elif [ "$version" = "90604f" ]
555 rabbi 93 then
556     echo "Compiling with OpenSSL 0.9.6d."
557 rabbi 685 opensslwarn 6
558 rabbi 210 elif [ "$version" = "90605f" ]
559 rabbi 125 then
560     echo "Compiling with OpenSSL 0.9.6e."
561 rabbi 685 opensslwarn 6
562 rabbi 210 elif [ "$version" = "90606f" ]
563 rabbi 125 then
564     echo "Compiling with OpenSSL 0.9.6f."
565 rabbi 685 opensslwarn 6
566 rabbi 210 elif [ "$version" = "90607f" ]
567 rabbi 125 then
568     echo "Compiling with OpenSSL 0.9.6g."
569 rabbi 685 opensslwarn 6
570     elif [ "$version" = "90608f" ]
571     then
572     echo "Compiling with OpenSSL 0.9.6h."
573     opensslwarn 6
574     elif [ "$version" = "90609f" ]
575     then
576     echo "Compiling with OpenSSL 0.9.6i."
577     opensslwarn 6
578     elif [ "$version" = "9060a0" ]
579     then
580     echo "Compiling with OpenSSL 0.9.6j."
581     opensslwarn 6
582     elif [ "$version" = "9060b0" ]
583     then
584     echo "Compiling with OpenSSL 0.9.6k."
585     opensslwarn 6
586     elif [ "$version" = "9060c0" ]
587     then
588     echo "Compiling with OpenSSL 0.9.6l."
589 weaselp 489 elif [ "$version" = "90700f" ]
590 rabbi 210 then
591 weaselp 489 echo "Compiling with OpenSSL 0.9.7."
592 rabbi 685 opensslwarn 7
593 rabbi 689 DEF="$DEF -DUSE_AES"
594 rabbi 685 elif [ "$version" = "90701f" ]
595     then
596     echo "Compiling with OpenSSL 0.9.7a."
597     opensslwarn 7
598 rabbi 689 DEF="$DEF -DUSE_AES"
599 rabbi 685 elif [ "$version" = "90702f" ]
600     then
601     echo "Compiling with OpenSSL 0.9.7b."
602     opensslwarn 7
603 rabbi 689 DEF="$DEF -DUSE_AES"
604 rabbi 685 elif [ "$version" = "90703f" ]
605     then
606     echo "Compiling with OpenSSL 0.9.7c."
607 rabbi 689 DEF="$DEF -DUSE_AES"
608 rabbi 93 elif [ "$version" -lt "920" ]
609     then
610 rabbi 8 echo "This version: ${version} of SSLeay is not supported."
611 rabbi 1 echo $opensslinfo
612     exit 1
613 rabbi 93 elif [ "$version" -lt "903100" ]
614 rabbi 1 then
615 rabbi 8 echo "This version: ${version} of OpenSSL is not supported."
616 rabbi 1 echo $opensslinfo
617     exit 1
618 rabbi 93 elif [ "$version" -gt "906000" ]
619 rabbi 1 then
620 rabbi 8 echo "Warning: This version: ${version} of OpenSSL is untested."
621 rabbi 1 readln "Continue anyway?" y
622     if [ "$ans" = "n" ]
623     then
624     echo $opensslinfo
625     exit 1
626 rabbi 689 else
627     echo "Does this version of OpenSSL contain AES support?"
628     readln "If unsure of the answer, say n" n
629     if [ "$ans" = "y" ]
630     then
631     DEF="$DEF -DUSE_AES"
632     fi
633 rabbi 1 fi
634     fi
635    
636     LIBDIR=
637     INCDIR=/usr/include/ncurses
638     SRCDIR=ncurses*
639     CONFIG=--enable-termcap
640     if [ "$TERMINFO" != "" ]
641     then
642     CONFIG="--datadir=$TERMINFO"
643     fi
644     if [ -d /usr/share/terminfo ]
645     then
646     CONFIG=
647     fi
648     if [ -d /usr/lib/terminfo ]
649     then
650     CONFIG=--datadir=/usr/lib/terminfo
651     fi
652    
653     if [ `uname` = OpenBSD ]
654     then
655     findlib libcurses.a
656     else
657     findlib libncurses.a
658     fi
659 weaselp 341 if [ "$found" = "" ]
660 rabbi 1 then
661     if [ "$system" != win32 ]
662     then
663     readln "Do you want to use Mixmaster's menu-based user interface?" y
664     if [ "$ans" = "y" ]
665     then
666 rabbi 685 echo "Please install ncurses now. It is available from http://www.clark.net/pub/dickey/ncurses/ncurses.tar.gz"
667 rabbi 1 exit 1
668     fi
669     fi
670     else
671     DEF="$DEF -DUSE_NCURSES"
672     if [ "$type" = system -o "$type" = installed ]
673     then
674     LIBS="$LIBS $LIB"
675     LDFLAGS="$LDFLAGS $LDFLAG"
676     else
677     LIBS="$LIBS $found/lib/$lib"
678     NCURSES="$found/lib/$lib:
679     cd $found/ncurses; make ../lib/$lib"
680     fi
681     if [ "$INCDIR" != "" ]
682     then
683     INC="$INC -I$INCDIR"
684     elif [ -f "/usr/include/ncurses.h" ]
685     then
686     DEF="$DEF -DHAVE_NCURSES_H"
687     fi
688     fi
689    
690 weaselp 404 ideawarn()
691     {
692     echo "
693 weaselp 489 WARNING: Your version of OpenSSL has been configured without IDEA support.
694     If you continue, Mixmaster will be installed with reduced functionality.
695     This means (among other things) that Mixmaster will not create an RSA
696     OpenPGP key (to avoid mail loss in the Type I system). You may want to
697     re-install OpenSSL before proceeding.
698    
699     This will not concern you if you only plan to run a type II remailer or
700     simply want a type II client."
701 weaselp 404 readln "Continue anyway?" y
702     if [ "$ans" = "n" ]
703     then
704     exit 1
705     fi
706     }
707    
708 weaselp 159 if [ "$system" = OpenBSD ]
709     then
710     LIBDIR=
711     INCDIR=
712     SRCDIR=idea*
713     findlib libidea.a
714     if [ "$found" = "" ]
715     then
716 weaselp 404 ideawarn
717 weaselp 159 else
718     DEF="$DEF -DUSE_IDEA"
719     IDEALIB="$MAKELIB"
720     LIBS="$LIBS $LIB"
721     LDFLAGS="$LDFLAGS $LDFLAG"
722     if [ "$INCDIR" != "" ]
723     then
724     INC="$INC -I$INCDIR"
725     fi
726     fi
727     elif [ "$system" = msdos -o "$system" = win32 ]
728     then
729     DEF="$DEF -DUSE_IDEA"
730     else
731 weaselp 489 echo "Checking for IDEA support..."
732 weaselp 159 cat <<END >tmptst.c
733     #include <openssl/idea.h>
734     int main() {
735 weaselp 388 void *dummy;
736     dummy = idea_cfb64_encrypt;
737 weaselp 159 exit(0);
738     }
739     END
740 weaselp 489 if gcc $LDFLAGS $INC tmptst.c -o tmptst $OPENSSLLIB
741 weaselp 159 then
742     DEF="$DEF -DUSE_IDEA"
743     else
744 weaselp 404 ideawarn
745 weaselp 159 fi
746 weaselp 489 rm -f tmptst.c tmptst
747 weaselp 159 fi
748    
749    
750 rabbi 1 # if [ "$MIXDEST" = "$HOME/Mix" ]
751     # then
752     # SPOOL=
753     # else
754     SPOOL=-DSPOOL=\'\"$MIXDEST\"\'
755     # fi
756    
757     echo "Generating Makefile."
758     echo "#Makefile generated on $HOSTNAME `date`" >Makefile
759     sed -e "s#%MIXDIR#$SPOOL#" \
760     -e "s#%LIBS#$LIBS#" \
761     -e "s#%LDFLAGS#$LDFLAGS#" \
762     -e "s#%INC#$INC#" \
763 rabbi 685 -e "s#%DEF#$DEF#" < Makefile.in >> Makefile
764 dybbuk 692 # echo "$ZLIB" >>Makefile
765     # echo "$PCRE" >>Makefile
766 rabbi 8 echo "$IDEALIB" >>Makefile
767 rabbi 1 echo "$NCURSES" >>Makefile
768     echo "$OPENSSL" >>Makefile
769     fi
770    
771    
772    
773 weaselp 157
774    
775 rabbi 1 echo "Compiling. Please wait."
776 weaselp 388 whereis make
777 rabbi 1 make=$found
778    
779     if [ "$system" = win32 ]
780     then
781 dybbuk 692 # (cd zlib*; make libz.a)
782     # (cd pcre*; make libpcre.a)
783 rabbi 1 if [ "$PASS" != "" ]
784     then
785     $make "$PASS" dllmix
786     else
787     $make dllmix
788     fi
789     else
790     if [ "$PASS" != "" ]
791     then
792     $make "$PASS"
793     else
794     $make
795     fi
796     fi
797    
798 rabbi 689 if [ -x mixmaster ]
799 rabbi 1 then
800     echo
801     else
802     echo "Error: The compilation failed. Please consult the documentation (section
803     \`Installation problems')."
804     readln "Remove the old Makefile?" y
805     if [ "$ans" = y ]
806     then
807     rm -f Makefile
808     fi
809     exit 1
810     fi
811    
812 dybbuk 393 if [ -f "$MIXDEST/mixmaster.conf" -a ! -f "$MIXDEST/mix.cfg" ]
813 rabbi 1 then
814     export MIXDEST
815     export MIXDIR
816     export MIXSRC
817 dybbuk 393 "${MIXDIR}/upgrade"
818 rabbi 1 exit 0
819     fi
820    
821 rabbi 689 if [ -f mixmaster.exe ]
822 rabbi 1 then
823 rabbi 689 cp mixmaster.exe "$MIXDEST"
824 rabbi 1 else
825 rabbi 689 cp mixmaster "$MIXDEST"
826 rabbi 1 fi
827    
828 dybbuk 393 cd "$MIXCFG"
829 rabbi 1 for i in mlist.txt pubring.mix rlist.txt pubring.asc type2.list
830     do
831 dybbuk 393 if [ ! -f "$MIXDEST/$i" ]
832 rabbi 1 then
833 dybbuk 393 cp "$i" "$MIXDEST"
834 rabbi 1 fi
835     done
836    
837     if [ "$remailer" = "y" ]
838     then
839 dybbuk 393 cd "$MIXCFG"
840 rabbi 1 for i in adminkey.txt dest.alw
841     do
842 dybbuk 393 if [ ! -f "$MIXDEST/$i" ]
843 rabbi 1 then
844 dybbuk 393 cp "$i" "$MIXDEST"
845 rabbi 1 fi
846     done
847     fi
848    
849     if [ "$remailer" = "n" ]
850     then
851 dybbuk 393 if [ ! -f "$MIXDEST/mix.cfg" ]
852 rabbi 1 then
853     whereis sendmail /usr/lib/sendmail /usr/sbin/sendmail
854 dybbuk 393 echo "SENDMAIL $found -t" >"$MIXDEST/mix.cfg"
855     cat mix.cfg >>"$MIXDEST/mix.cfg"
856 rabbi 1 fi
857     echo "Client installation complete."
858     exit
859     fi
860    
861     for i in *.blk
862     do
863 dybbuk 393 if [ ! -f "$MIXDEST/$i" ]
864 rabbi 1 then
865 dybbuk 393 cp "$i" "$MIXDEST"
866 rabbi 1 fi
867     done
868    
869 dybbuk 393 cd "$MIXDEST"
870 rabbi 1
871     installed=n
872     if [ -f mix.cfg ]
873     then
874     if grep REMAILERADDR mix.cfg >/dev/null
875     then
876     installed=y
877     fi
878 weaselp 341 fi
879 rabbi 1
880     if [ "$installed" = "n" ]
881     then
882     Date=`date`
883     whereis sendmail /usr/lib/sendmail /usr/sbin/sendmail
884     sendmail=$found
885    
886     echo "Mixmaster can be installed in the low-maintenance \`middleman' mode.
887     In that mode, it will send mail to other remailers only, to avoid
888     complaints about anonymous messages."
889     readln "Install as middleman?" n
890     middle=$ans
891    
892     readln "The e-mail address of your remailer:" `whoami`@$HOSTNAME
893     RMA=$ans
894    
895     echo "Do you want Mixmaster to send auto-replies to messages it does not
896     understand (If the address <$RMA> is also used"
897     readln "for mail to be read by a human, type \`n')?" y
898     autoreply=$ans
899    
900     if [ "$middle" = n ]
901     then
902     readln "An address to appear in the \`From:' line of anonymous messages:" `echo $RMA | sed 's/.*@/nobody@/'`
903     RAA=$ans
904    
905     readln "Address for complaints to be sent to:" `echo $RMA | sed 's/.*@/abuse@/'`
906     CA=$ans
907     else
908     RAA=$RMA
909     CA=$RMA
910     fi
911    
912     echo "Choose a name for your remailer. It will appear in remailer status messages."
913     readln "Long name:" "Anonymous Remailer"
914     RMN=$ans
915    
916     if [ "$middle" = n ]
917     then
918     echo "Choose a name to be used in the \`From:' line of remailed messages."
919     readln "Anon long name:" "Anonymous"
920     RAN=$ans
921     fi
922    
923     readln "A short name to appear in lists:" `echo $HOSTNAME|sed 's/\..*//'`
924     SN=$ans
925    
926     readln "Accept Mixmaster (Type II) messages?" y
927     mix=$ans
928    
929 rabbi 93 readln "Accept PGP (Type I) remailer messages?" n
930 rabbi 1 pgp=$ans
931    
932     unencrypted=n
933     if [ "$pgp" = "y" ]
934     then
935     readln "Accept unencrypted remailer messages?" n
936     unencrypted=$ans
937     fi
938    
939     echo "Mixmaster will log error messages and warnings. Do you want to log"
940 weaselp 341 readln "informational messages about normal operation as well?" y
941 rabbi 1 if [ "$ans" = y ]
942 weaselp 341 then
943 rabbi 1 verbose=2
944     else
945     verbose=1
946     fi
947    
948     readln "Filter binary attachments?" n
949     binfilter=$ans
950    
951     if [ "$middle" = n ]
952     then
953     if [ "$autoreply" = y ]
954     then
955     readln "Allow users to add themselves to the list of blocked addresses?" y
956     autoblock=$ans
957     fi
958    
959     echo "Do you want to allow posting? Newsgroups can be restricted in dest.blk.
960     y)es, post locally; use m)ail-to-news gateway; n)o."
961     readln "Allow posting to Usenet?" m
962     post="$ans"
963     if [ "$ans" = y ]
964     then
965     whereis inews /usr/lib/news/inews
966     readln "News posting software:" "$found -h"
967     news=$ans
968     readln "Organization line for anonymous Usenet posts:" "Anonymous Posting Service"
969     orga=$ans
970     readln "Use anti-spam message IDs?" y
971     mid=$ans
972     elif [ "$ans" = m ]
973     then
974     readln "Mail-to-news gateway:" mail2news@nym.alias.net
975     news=$ans
976     fi
977     fi
978    
979     echo "How many messages do you want to keep in the reordering pool?
980     A larger pool is more secure, but also causes higher latency.
981     0 means to remail immediately."
982     readln "Pool size:" 20
983     poolsize=$ans
984    
985     mbox=
986     if [ -f ~/.forward ]
987     then
988     mbox=`head -1 ~/.forward | sed 's/^"//;s/"$//'`
989     if echo "$mbox" | grep 'mix' >/dev/null 2>/dev/null
990     then
991     mbox=
992     elif echo "$mbox" | grep 'procmail' >/dev/null 2>/dev/null
993     then
994     if grep mix ~/.procmailrc >/dev/null 2>/dev/null
995     then
996     mbox=
997     fi
998     fi
999     fi
1000    
1001     if [ "$mbox" = "" ]
1002     then
1003     mbox=${MAIL:-/usr/spool/mail/$NAME}
1004     touch "$mbox"
1005     if [ ! -w "$mbox" ]
1006     then
1007     echo "$mbox is not writeable."
1008 dybbuk 393 readln "Mailbox for non-remailer messages:" "${MIXDEST}/mbox"
1009 rabbi 1 mbox=$ans
1010     fi
1011     fi
1012    
1013     cat <<END >mix.cfg
1014     # mix.cfg -- installed $Date
1015     SENDMAIL $sendmail -t
1016    
1017     # Where to store non-remailer messages:
1018     MAILBOX $mbox
1019     #MAILABUSE mbox.abuse
1020     #MAILBLOCK mbox.block
1021     #MAILUSAGE mbox.usage
1022     #MAILANON mbox.anon
1023     #MAILERROR mbox.error
1024     #MAILBOUNCE mbox.bounce
1025    
1026     REMAIL y
1027     MIDDLEMAN $middle
1028    
1029     BINFILTER $binfilter
1030     AUTOBLOCK $autoblock
1031    
1032 rabbi 92 ERRLOG error.log
1033 rabbi 1 VERBOSE $verbose
1034    
1035     # Remailer name and addresses
1036     REMAILERADDR $RMA
1037     ANONADDR $RAA
1038     COMPLAINTS $CA
1039    
1040     SHORTNAME $SN
1041     REMAILERNAME $RMN
1042     ANONNAME $RAN
1043    
1044     # Supported formats:
1045     MIX $mix
1046     PGP $pgp
1047     UNENCRYPTED $unencrypted
1048    
1049     # Maximum message size in kB (0 for no limit):
1050     SIZELIMIT 0
1051    
1052     # Usenet news:
1053     NEWS $news
1054     ORGANIZATION $orga
1055     MID $mid
1056    
1057     # Remailing strategy:
1058 rabbi 220 SENDPOOLTIME 1h
1059 rabbi 1 POOLSIZE $poolsize
1060 rabbi 220 RATE 95
1061     INDUMMYP 20
1062     OUTDUMMYP 67
1063 rabbi 1 IDEXP 7d
1064     PACKETEXP 7d
1065    
1066 weaselp 157 $PASSPHRASE
1067    
1068 rabbi 1 END
1069    
1070 weaselp 157 fi # not yet installed
1071    
1072    
1073 rabbi 1 REPLACE="s/%RMN/$RMN/g;s/%RMA/$RMA/g;s/%CA/$CA/g;s/%RAA/$RAA/g"
1074     if [ "$installed" = "n" ]
1075     then
1076 dybbuk 393 cd "$MIXCFG"
1077     if [ ! -f "$MIXDEST/help.txt" ]
1078 rabbi 1 then
1079 dybbuk 393 sed "$REPLACE" < intro.hlp >"$MIXDEST/help.txt"
1080 rabbi 1 if [ "$mix" = y ]
1081     then
1082 dybbuk 393 sed "$REPLACE" < mix.hlp >>"$MIXDEST/help.txt"
1083 rabbi 1 fi
1084     if [ "$unencrypted" = y ]
1085     then
1086 dybbuk 393 sed "$REPLACE" < type1.hlp >>"$MIXDEST/help.txt"
1087 rabbi 1 if [ "$pgp" = y ]
1088     then
1089 dybbuk 393 sed "$REPLACE" < pgp.hlp >>"$MIXDEST/help.txt"
1090 rabbi 1 fi
1091     elif [ "$pgp" = y ]
1092     then
1093 dybbuk 393 sed "$REPLACE" < pgponly.hlp >>"$MIXDEST/help.txt"
1094 rabbi 1 fi
1095     if [ "$post" = y ]
1096     then
1097     if [ "$pgp" = y -o "$unencrypted" = y ]
1098     then
1099 dybbuk 393 sed "$REPLACE" < news.hlp >>"$MIXDEST/help.txt"
1100 rabbi 1 fi
1101     fi
1102 dybbuk 393 sed "$REPLACE" < end.hlp >>"$MIXDEST/help.txt"
1103 rabbi 1 fi
1104    
1105     for i in *.txt.in
1106     do
1107     j=`echo $i | sed 's/\.in$//'`
1108 dybbuk 393 if [ ! -f "$MIXDEST/$j" ]
1109 rabbi 1 then
1110 dybbuk 393 sed "$REPLACE" < "$i" >"$MIXDEST/$j"
1111 rabbi 1 fi
1112     done
1113 dybbuk 393 cd "$MIXDEST"
1114 rabbi 1 fi
1115    
1116     echo
1117     if [ ! -f secring.mix ]
1118     then
1119     echo "Generating secret keys. This may take a while..."
1120     else
1121     echo "Updating secret keys..."
1122     fi
1123 rabbi 689 ./mixmaster -K
1124 rabbi 1 if [ -f key.txt ]
1125     then
1126     echo "Done."
1127     echo
1128     else
1129     echo "Installation failed. Please consult the Mixmaster documentation."
1130     exit 1
1131     fi
1132    
1133     if [ "$system" = msdos -o "$system" = win32 ]
1134     then
1135     exit
1136     fi
1137    
1138     umask 033
1139    
1140     # Set .forward?
1141     set=y
1142    
1143     if grep procmail ~/.forward >/dev/null 2>/dev/null
1144     then
1145     if grep mix ~/.procmailrc >/dev/null 2>/dev/null
1146     then
1147     echo "Mixmaster is installed in your .procmailrc file."
1148     set=n
1149     fi
1150     fi
1151    
1152     if [ "$set" = y -a -f ~/.forward ]
1153     then
1154     echo "Your current .forward is:"
1155     cat ~/.forward
1156     echo
1157     if grep mix ~/.forward >/dev/null 2>/dev/null
1158     then
1159     echo "Mixmaster already is installed in your .forward file."
1160     set=n
1161     elif [ "$mbox" != "" ]
1162     then
1163     if echo "$mbox" | grep '|' >/dev/null 2>/dev/null
1164     then
1165     echo "Mixmaster will pipe messages to $mbox"
1166     elif echo $mbox | grep '@' >/dev/null 2>/dev/null
1167     then
1168     echo "Mixmaster will forward messages to $mbox"
1169     else
1170     echo "Mixmaster will store messages to $mbox"
1171     fi
1172     fi
1173     fi
1174    
1175     if [ "$set" = y ]
1176     then
1177     echo "Set .forward to the following line:"
1178 rabbi 689 echo "\"|${MIXDEST}/mixmaster -RM\""
1179 rabbi 1 if [ -f ~/.forward ]
1180     then
1181     readln "Overwrite now?" n
1182     else
1183 weaselp 112 readln "Do that now?" n
1184 rabbi 1 fi
1185     if [ "$ans" = "y" ]
1186     then
1187 rabbi 689 echo "\"|${MIXDEST}/mixmaster -RM\"" >~/.forward
1188 rabbi 1 fi
1189     fi
1190    
1191     if [ "$RMA" != "" ]
1192     then
1193     echo "
1194     Mixmaster will send the following files as auto-replies:
1195     Mail to <$RMA> with Subject: remailer-help => help.txt"
1196     echo "Mail to <$RMA> with Subject: remailer-adminkey => adminkey.txt
1197     Remember to add your Remailer Admin public PGP key to the adminkey.txt file."
1198     if [ "$autoblock" = y ]
1199     then
1200     echo "Mail to <$RMA> with line DESTINATION-BLOCK => blocked.txt"
1201     fi
1202     if [ "$autoreply" = y ]
1203     then
1204     echo "Other mail to <$RMA> => usage.txt"
1205     echo
1206     if [ "$CA" != "$RMA" ]
1207     then
1208     echo "If you arrange for mail to <$CA> and <$RAA>
1209     to be forwarded to <$RMA>:
1210     Mail to <$CA> => abuse.txt
1211     Mail to <$RAA> => reply.txt"
1212     fi
1213     fi
1214     fi
1215    
1216     echo
1217     echo "Mixmaster installation complete."
1218    

Properties

Name Value
svn:executable *
svn:keywords Id

  ViewVC Help
Powered by ViewVC 1.1.5