/[imapfilter]/imapfilter/config
ViewVC logotype

Diff of /imapfilter/config

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2.2.1 by lefcha, Fri Jan 25 16:55:09 2002 UTC revision 1.27 by lefcha, Fri Feb 13 12:17:15 2004 UTC
# Line 6  destdir="/usr/local" Line 6  destdir="/usr/local"
6  bindir="$destdir/bin"  bindir="$destdir/bin"
7  mandir="$destdir/man"  mandir="$destdir/man"
8    
9  debug="yes"  encpasswds="yes"
10  checkperms="yes"  ssltls="yes"
11  ssl="yes"  cram="yes"
12    
13  libs=""  libs=""
14  libssl="-lssl -lcrypto"  libssl="-lssl"
15    libcrypto="-lcrypto"
16    
17    cflags="-g"
18    ldflags=""
19    
20  interactive="no"  interactive="no"
21    
# Line 35  do Line 39  do
39    o)    o)
40      head=`echo $OPTARG | cut -d= -f1`      head=`echo $OPTARG | cut -d= -f1`
41      body=`echo $OPTARG | cut -d= -f2`      body=`echo $OPTARG | cut -d= -f2`
42      if [ $head = "debug" ]      if [ $head = "encpasswds" ]
43      then      then
44        if [ $body = "yes" ]; then debug="yes"        if [ $body = "yes" ]; then encpasswds="yes"
45        elif [ $body = "no" ]; then debug="no"        elif [ $body = "no" ]; then encpasswds="no"
46        fi        fi
47      elif [ $head = "checkperms" ]      elif [ $head = "ssltls" ]
48      then      then
49        if [ $body = "yes" ]; then checkperms="yes"        if [ $body = "yes" ]; then ssltls="yes"
50        elif [ $body = "no" ]; then checkperms="no"        elif [ $body = "no" ]; then ssltls="no"
51        fi        fi
52      elif [ $head = "ssl" ]      elif [ $head = "cram" ]
53      then      then
54        if [ $body = "yes" ]; then ssl="yes"        if [ $body = "yes" ]; then cram="yes"
55        elif [ $body = "no" ]; then ssl="no"        elif [ $body = "no" ]; then cram="no"
56        fi        fi
57      fi      fi  
58      ;;      ;;
59    i)    i)
60      interactive="yes"      interactive="yes"
# Line 63  Usage: Line 67  Usage:
67  Description:  Description:
68    -h                    This brief usage and description message.    -h                    This brief usage and description message.
69    -i                    Interactive mode.    -i                    Interactive mode.
70    -d destdir            Installation path for program's files [/usr/local]    -d destdir            Installation path for program's files [$destdir]
71    -b bindir             Installation path for binaries [\$destdir/bin]    -b bindir             Installation path for binaries [$bindir]
72    -m mandir             Installation path for manual pages [\$destdir/man]    -m mandir             Installation path for manual pages [$mandir]
73    -o option=argument    Enabling/disabling of program's options.    -o option=argument    Enabling/disabling of program's options.
74    
75  Options:  Options:
76    debug                 Debugging information, useful during development [yes]    encpasswds            Encrypted passwords support [$encpasswds]
77    checkperms            Configuration file's permissions checking [yes]    ssltls                Secure Socket Layer and Transport Layer Security [$ssltls]
78    ssl                   Secure Socket Layer and Transport Layer Security [yes]    cram                  Challenge-Response Authentication Mechanism [$cram]
79  EOF  EOF
80      exit 1      exit 1
81      ;;      ;;
# Line 83  done Line 87  done
87    
88  if [ $interactive = "yes" ]  if [ $interactive = "yes" ]
89  then  then
90    echo -n "Destination directory [$destdir]: "    printf "Destination directory [$destdir]: "
91    read tmp    read tmp
92    if [ -n "$tmp" ]; then destdir="$tmp"; fi    if [ -n "$tmp" ]; then destdir="$tmp"; fi
93    
94    echo -n "Binaries directory [$bindir]: "    printf "Binaries directory [$bindir]: "
95    read tmp    read tmp
96    if [ -n "$tmp" ]; then bindir="$tmp"; fi    if [ -n "$tmp" ]; then bindir="$tmp"; fi
97    
98    echo -n "Manual pages directory [$mandir]: "    printf "Manual pages directory [$mandir]: "
99    read tmp    read tmp
100    if [ -n "$tmp" ]; then mandir="$tmp"; fi    if [ -n "$tmp" ]; then mandir="$tmp"; fi
101        
102    echo -n "Debugging information [$debug]: "    printf "Encrypted passwords support [$encpasswds]: "
103    read tmp    read tmp
104    if [ -n "$tmp" ]; then debug="$tmp"; fi    if [ -n "$tmp" ]; then encpasswds="$tmp"; fi
105      
106    echo -n "Configuration file permissions checking [$checkperms]: "    printf "Secure Socket Layer and Transport Layer Security [$ssltls]: "
107    read tmp    read tmp
108    if [ -n "$tmp" ]; then checkperms="$tmp"; fi    if [ -n "$tmp" ]; then ssltls="$tmp"; fi
109      
110    echo -n "Secure Socket Layer and Transport Layer Security [$ssl]: "    printf "Challenge-Response Authentication Mechanism [$cram]: "
111    read tmp    read tmp
112    if [ -n "$tmp" ]; then ssl="$tmp"; fi    if [ -n "$tmp" ]; then cram="$tmp"; fi
113  else  else
114    cat << EOF    cat << EOF
115  Destination directory:                                  $destdir  Destination directory:                                  $destdir
116  Binaries directory:                                     $bindir  Binaries directory:                                     $bindir
117  Manual pages directory:                                 $mandir  Manual pages directory:                                 $mandir
118  Debugging information:                                  $debug  Encrypted passwords support:                            $encpasswds
119  Configuration file permissions checking:                $checkperms  Secure Socket Layer and Transport Layer Security:       $ssltls
120  Secure Socket Layer and Transport Layer Security:       $ssl  Challenge-Response Authentication Mechanism:            $cram
121  EOF  EOF
122  fi  fi
123    
124    
125  # Libraries  # Libraries
126    
127  if [ $ssl = "yes" ]  if [ $ssltls = "yes" ]
128  then  then
129    libs="$libs $libssl"    libs="$libs $libssl $libcrypto"
130    elif [ $encpasswds = "yes" ] || [ $cram = "yes" ]
131    then
132      libs="$libs $libcrypto"
133  fi  fi
134    
135    
136  # Backup of original Makefile and config.h  # Backup of original Makefile and config.h
137    
138  if [ ! -f .Makefile ]; then cp Makefile .Makefile; fi  if [ ! -f .Makefile ]; then cp -f Makefile .Makefile; fi
139  if [ ! -f .config.h ]; then cp config.h .config.h; fi  if [ ! -f .config.h ]; then cp -f config.h .config.h; fi
140    
141    
142  # Write Makefile  # Write Makefile
143    
144  mv Makefile Makefile~  mv -f Makefile Makefile~
145    
146  cat > Makefile << EOF  cat > Makefile << EOF
147  CC = cc  CC = cc
148  CFLAGS = -Wall -O2  CFLAGS = $cflags
149    LDFLAGS =
150    
151  DESTDIR = $destdir  DESTDIR = $destdir
152  BINDIR = $bindir  BINDIR = $bindir
153  MANDIR = $mandir  MANDIR = $mandir
154    
 INSTALL = install -c  
 INST_DIR = install -d  
 INST_BIN = \$(INSTALL) -m 755  
 INST_DOC = \$(INSTALL) -m 644  
   
155  MAN_BIN = imapfilter.1  MAN_BIN = imapfilter.1
156  MAN_RC = imapfilterrc.5  MAN_RC = imapfilterrc.5
157    
158  BIN = imapfilter  BIN = imapfilter
159  OBJ = data.o file.o imap.o imapfilter.o log.o memory.o misc.o \\  OBJ = account.o action.o auth.o buffer.o cert.o destroy.o file.o filter.o \\
160          response.o request.o socket.o          imap.o imapfilter.o lock.o log.o match.o memory.o misc.o parse.o \\
161            passwd.o response.o request.o socket.o tty.o
162    
163  LIBS = $libs  LIBS = $libs
164    
165    all: imapfilter
166    
167  imapfilter: \$(OBJ)  imapfilter: \$(OBJ)
168          \$(CC) \$(LIBS) \$(CFLAGS) -o \$(BIN) \$(OBJ)          \$(CC) \$(LIBS) \$(LDFLAGS) -o \$(BIN) \$(OBJ)
169    
170  data.o file.o imap.o imapfilter.o log.o response.o request.o \\  account.o action.o auth.o buffer.o cert.o destroy.o file.o filter.o imap.o \\
171          memory.o socket.o: imapfilter.h config.h          imapfilter.o lock.o log.o match.o memory.o parse.o passwd.o \\
172  data.o imapfilter.o imap.o file.o request.o socket.o: data.h          request.o response.o socket.o tty.o: config.h imapfilter.h
173    account.o destroy.o filter.o imapfilter.o match.o: account.h
174    action.o destroy.o filter.o imap.o imapfilter.o match.o: filter.h
175    account.o filter.o: struct.h
176    buffer.o imap.o imapfilter.o response.o: buffer.h
177    cert.o file.o lock.o log.o parse.o: pathnames.h
178    imapfilter.o: version.h
179    
180  install: imapfilter  install: imapfilter
181          if test ! -d \$(BINDIR); then \$(INST_DIR) \$(BINDIR); fi          if test ! -d \$(BINDIR); then mkdir -p \$(BINDIR); fi
182          \$(INST_BIN) \$(BIN) \$(BINDIR)          cp -f \$(BIN) \$(BINDIR) && chmod 0755 \$(BINDIR)/\$(BIN)
183          if test ! -d \$(MANDIR)/man1; then \$(INST_DIR) \$(MANDIR)/man1; fi          if test ! -d \$(MANDIR)/man1; then mkdir -p \$(MANDIR)/man1; fi
184          \$(INST_DOC) \$(MAN_BIN) \$(MANDIR)/man1          cp -f \$(MAN_BIN) \$(MANDIR)/man1 && chmod 0644 \$(MANDIR)/man1/\$(MAN_BIN)
185          if test ! -d \$(MANDIR)/man5; then \$(INST_DIR) \$(MANDIR)/man5; fi          if test ! -d \$(MANDIR)/man5; then mkdir -p \$(MANDIR)/man5; fi
186          \$(INST_DOC) \$(MAN_RC) \$(MANDIR)/man5          cp -f \$(MAN_RC) \$(MANDIR)/man5 && chmod 0644 \$(MANDIR)/man5/\$(MAN_RC)
187    
188  uninstall:  deinstall:
189          rm -f \$(BINDIR)/\$(BIN) \$(MANDIR)/man1/\$(MAN_BIN) \$(MANDIR)/man5/\$(MAN_RC)          rm -f \$(BINDIR)/\$(BIN) \$(MANDIR)/man1/\$(MAN_BIN) \$(MANDIR)/man5/\$(MAN_RC)
190    
191    uninstall: deinstall
192    
193  clean:  clean:
194          rm -f \$(OBJ) \$(BIN) imapfilter.core core *.BAK *~          rm -f \$(OBJ) \$(BIN) imapfilter.core core *.BAK *~
195    
196  distclean: clean  distclean: clean
197          @if test -f .Makefile; then mv .Makefile Makefile; fi          @if test -f .Makefile; then mv -f .Makefile Makefile; fi
198          @if test -f .config.h; then mv .config.h config.h; fi          @if test -f .config.h; then mv -f .config.h config.h; fi
   
 .PHONY : install uninstall clean distclean  
199  EOF  EOF
200    
201    
202  # Write config.h  # Write config.h
203    
204  mv config.h config.h~  mv -f config.h config.h~
205    
206    echo "#ifndef CONFIG_H" > config.h
207    echo "#define CONFIG_H" >> config.h
208    echo >> config.h; echo >> config.h
209    
210  echo "/* Debugging information. */" > config.h  echo "/* Encrypted passwords support. */" >> config.h
211  if [ $debug = "yes" ]  if [ $encpasswds = "yes" ]
212  then  then
213    echo "#define DEBUG" >> config.h    echo "#define ENCRYPTED_PASSWORDS" >> config.h
214  else  else
215    echo "#undef DEBUG" >> config.h    echo "#undef ENCRYPTED_PASSWORDS" >> config.h
216  fi  fi
217  echo >> config.h  echo >> config.h
218    
219  echo "/* Configuration file's permissions checking. */" >> config.h  echo "/* Secure Socket Layer and Transport Layer Security support. */" >> config.h
220  if [ $checkperms = "yes" ]  if [ $ssltls = "yes" ]
221  then  then
222    echo "#define CHECK_PERMISSIONS" >> config.h    echo "#define SSL_TLS" >> config.h
223  else  else
224    echo "#undef CHECK_PERMISSIONS" >> config.h    echo "#undef SSL_TLS" >> config.h
225  fi  fi
226  echo >> config.h  echo >> config.h
227    
228  echo "/* Secure Socket Layer and Transport Layer Security support. */" >> config.h  echo "/* Challenge-Response Authentication Mechanism support. */" >> config.h
229  if [ $ssl = "yes" ]  if [ $cram = "yes" ]
230  then  then
231    echo "#define SSL_TLS" >> config.h    echo "#define CRAM_MD5" >> config.h
232  else  else
233    echo "#undef SSL_TLS" >> config.h    echo "#undef CRAM_MD5" >> config.h
234  fi  fi
235    
236    echo >> config.h; echo >> config.h
237    echo "#endif                            /* CONFIG_H */" >> config.h
238    
239    
240  exit 0  exit 0

Legend:
Removed from v.1.2.2.1  
changed lines
  Added in v.1.27

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26