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

Contents of /trunk/Mix/Install

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5