"SfR Fresh" - the SfR Freeware/Shareware Archive 
Member "imapfilter-2.0.10/configure" of archive imapfilter-2.0.10.tar.gz:
As a special service "SfR Fresh" has tried to format the requested source page into HTML format using source code syntax highlighting with prefixed line numbers.
Alternatively you can here view or download the uninterpreted source code file.
That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
1 #!/bin/sh
2
3 # Default values
4
5 prefix="/usr/local"
6 bindir="$prefix/bin"
7 sharedir="$prefix/share/imapfilter"
8 mandir="$prefix/man"
9
10 ssltls="yes"
11 crammd5="yes"
12
13 incdirs="-I/usr/local/include"
14 libdirs="-L/usr/local/lib"
15
16 mycflags="-Wall -O"
17 myldflags=""
18
19 libs="-lm -llua -lpcre"
20 libssl="-lssl"
21 libcrypto="-lcrypto"
22
23 defs="-DMAKEFILE_SHAREDIR='\"\$(SHAREDIR)\"'"
24
25 bin="imapfilter"
26
27
28 # Get options and arguments
29
30 while getopts "d:p:b:s:m:o:h" opt
31 do
32 case $opt in
33 d | p)
34 prefix=$OPTARG
35 bindir=$prefix/bin
36 sharedir=$prefix/share/imapfilter
37 mandir=$prefix/man
38 ;;
39 b)
40 bindir=$OPTARG
41 ;;
42 s)
43 sharedir=$OPTARG
44 ;;
45 m)
46 mandir=$OPTARG
47 ;;
48 o)
49 head=`echo $OPTARG | cut -d= -f1`
50 body=`echo $OPTARG | cut -d= -f2`
51 if [ $head = "ssltls" ]
52 then
53 if [ $body = "yes" ]; then ssltls="yes"
54 elif [ $body = "no" ]; then ssltls="no"
55 fi
56 elif [ $head = "crammd5" ]
57 then
58 if [ $body = "yes" ]; then crammd5="yes"
59 elif [ $body = "no" ]; then crammd5="no"
60 fi
61 fi
62 ;;
63 h | *)
64 cat << EOF
65 Usage:
66 configure [-h] [-p prefix] [-b bindir] [-s sharedir] [-m mandir]
67 [-o option=argument]
68
69 Description:
70 -h This brief usage and description message.
71 -p prefix Installation path for program's files [$prefix]
72 -b bindir Installation path for binaries [$bindir]
73 -s sharedir Installation path for libraries [$sharedir]
74 -m mandir Installation path for manual pages [$mandir]
75 -o option=argument Enabling/disabling of program's compilation options.
76
77 Options:
78 ssltls Secure Socket Layer and Transport Layer Security \
79 [$ssltls]
80 crammd5 Challenge-Response Authentication Mechanism [$crammd5]
81 EOF
82 exit 1
83 ;;
84 esac
85 done
86
87
88 # Print values
89
90 cat << EOF
91 Installation directory: $prefix
92 Binaries directory: $bindir
93 Architecture independent libraries: $sharedir
94 Manual pages directory: $mandir
95 Secure Socket Layer and Transport Layer Security: $ssltls
96 Challenge-Response Authentication Mechanism: $crammd5
97 EOF
98
99
100 # Defines
101
102 if [ $ssltls = "no" ]
103 then
104 defs="$defs -DNO_SSLTLS"
105 fi
106
107 if [ $crammd5 = "no" ]
108 then
109 defs="$defs -DNO_CRAMMD5"
110 fi
111
112
113 # Libraries
114
115 if [ $ssltls = "yes" ]
116 then
117 libs="$libs $libssl $libcrypto"
118 elif [ $crammd5 = "yes" ]
119 then
120 libs="$libs $libcrypto"
121 fi
122
123
124 # Binary name
125
126 uname -a | grep -qi cygwin
127 if [ $? = 0 ]
128 then
129 bin="imapfilter.exe"
130 fi
131
132
133 # Backup of original Makefile
134
135 if [ ! -f .Makefile ]; then cp -f Makefile .Makefile; fi
136
137
138 # Write Makefile
139
140 mv -f Makefile Makefile~
141
142 cat > Makefile << EOF
143 DESTDIR =
144 BINDIR = $bindir
145 SHAREDIR = $sharedir
146 MANDIR = $mandir
147
148 INCDIRS = $incdirs
149 LIBDIRS = $libdirs
150
151 MYCFLAGS = $mycflags
152 MYLDFLAGS = $myldflags
153
154 DEFS = $defs
155
156 CFLAGS = \$(MYCFLAGS) \$(DEFS) \$(INCDIRS)
157 LDFLAGS = \$(MYLDFLAGS) \$(LIBDIRS)
158
159 LIBS = $libs
160
161 MAN_BIN = imapfilter.1
162 MAN_CONFIG = imapfilter_config.5
163
164 COMMON_LUA = common.lua
165 SET_LUA = set.lua
166 REGEX_LUA = regex.lua
167 ACCOUNT_LUA = account.lua
168 MAILBOX_LUA = mailbox.lua
169 MESSAGE_LUA = message.lua
170 OPTIONS_LUA = options.lua
171 AUXILIARY_LUA = auxiliary.lua
172 DEPRECATED_LUA = deprecated.lua
173
174 BIN = $bin
175 OBJ = auth.o buffer.o cert.o core.o file.o imap.o imapfilter.o list.o log.o \\
176 lua.o memory.o misc.o namespace.o pcre.o regexp.o request.o \\
177 response.o session.o signal.o socket.o system.o
178
179 all: \$(BIN)
180
181 \$(BIN): \$(OBJ)
182 \$(CC) -o \$(BIN) \$(LDFLAGS) \$(OBJ) \$(LIBS)
183
184 \$(OBJ): imapfilter.h
185 buffer.o imap.o imapfilter.o namespace.o request.o response.o: buffer.h
186 cert.o file.o imapfilter.o log.o lua.o: pathnames.h
187 imapfilter.o log.o session.o: list.h
188 imapfilter.o regexp.o response.o: regexp.h
189 auth.o cert.o imap.o imapfilter.o log.o request.o response.o session.o \\
190 socket.o: session.h
191 imapfilter.o: version.h
192
193 install: \$(BIN)
194 if test ! -d \$(DESTDIR)\$(BINDIR); then \\
195 mkdir -p \$(DESTDIR)\$(BINDIR); fi
196 cp -f \$(BIN) \$(DESTDIR)\$(BINDIR) && \\
197 chmod 0755 \$(DESTDIR)\$(BINDIR)/\$(BIN)
198 if test ! -d \$(DESTDIR)\$(SHAREDIR); then \\
199 mkdir -p \$(DESTDIR)\$(SHAREDIR); fi
200 cp -f \$(COMMON_LUA) \$(DESTDIR)\$(SHAREDIR) && \\
201 chmod 0644 \$(DESTDIR)\$(SHAREDIR)/\$(COMMON_LUA)
202 cp -f \$(SET_LUA) \$(DESTDIR)\$(SHAREDIR) && \\
203 chmod 0644 \$(DESTDIR)\$(SHAREDIR)/\$(SET_LUA)
204 cp -f \$(REGEX_LUA) \$(DESTDIR)\$(SHAREDIR) && \\
205 chmod 0644 \$(DESTDIR)\$(SHAREDIR)/\$(REGEX_LUA)
206 cp -f \$(ACCOUNT_LUA) \$(DESTDIR)\$(SHAREDIR) && \\
207 chmod 0644 \$(DESTDIR)\$(SHAREDIR)/\$(ACCOUNT_LUA)
208 cp -f \$(MAILBOX_LUA) \$(DESTDIR)\$(SHAREDIR) && \\
209 chmod 0644 \$(DESTDIR)\$(SHAREDIR)/\$(MAILBOX_LUA)
210 cp -f \$(MESSAGE_LUA) \$(DESTDIR)\$(SHAREDIR) && \\
211 chmod 0644 \$(DESTDIR)\$(SHAREDIR)/\$(MESSAGE_LUA)
212 cp -f \$(OPTIONS_LUA) \$(DESTDIR)\$(SHAREDIR) && \\
213 chmod 0644 \$(DESTDIR)\$(SHAREDIR)/\$(OPTIONS_LUA)
214 cp -f \$(AUXILIARY_LUA) \$(DESTDIR)\$(SHAREDIR) && \\
215 chmod 0644 \$(DESTDIR)\$(SHAREDIR)/\$(AUXILIARY_LUA)
216 cp -f \$(DEPRECATED_LUA) \$(DESTDIR)\$(SHAREDIR) && \\
217 chmod 0644 \$(DESTDIR)\$(SHAREDIR)/\$(DEPRECATED_LUA)
218 if test ! -d \$(DESTDIR)\$(MANDIR)/man1; then \\
219 mkdir -p \$(DESTDIR)\$(MANDIR)/man1; fi
220 cp -f \$(MAN_BIN) \$(DESTDIR)\$(MANDIR)/man1 && \\
221 chmod 0644 \$(DESTDIR)\$(MANDIR)/man1/\$(MAN_BIN)
222 if test ! -d \$(DESTDIR)\$(MANDIR)/man5; then \\
223 mkdir -p \$(DESTDIR)\$(MANDIR)/man5; fi
224 cp -f \$(MAN_CONFIG) \$(DESTDIR)\$(MANDIR)/man5 && \\
225 chmod 0644 \$(DESTDIR)\$(MANDIR)/man5/\$(MAN_CONFIG)
226
227 deinstall:
228 rm -f \$(DESTDIR)\$(BINDIR)/\$(BIN) \\
229 \$(DESTDIR)\$(SHAREDIR)/\$(COMMON_LUA) \\
230 \$(DESTDIR)\$(SHAREDIR)/\$(SET_LUA) \\
231 \$(DESTDIR)\$(SHAREDIR)/\$(REGEX_LUA) \\
232 \$(DESTDIR)\$(SHAREDIR)/\$(ACCOUNT_LUA) \\
233 \$(DESTDIR)\$(SHAREDIR)/\$(MAILBOX_LUA) \\
234 \$(DESTDIR)\$(SHAREDIR)/\$(MESSAGE_LUA) \\
235 \$(DESTDIR)\$(SHAREDIR)/\$(OPTIONS_LUA) \\
236 \$(DESTDIR)\$(SHAREDIR)/\$(AUXILIARY_LUA) \\
237 \$(DESTDIR)\$(SHAREDIR)/\$(DEPRECATED_LUA) \\
238 \$(DESTDIR)\$(MANDIR)/man1/\$(MAN_BIN) \\
239 \$(DESTDIR)\$(MANDIR)/man5/\$(MAN_CONFIG)
240
241 uninstall: deinstall
242
243 clean:
244 rm -f \$(OBJ) \$(BIN) imapfilter.core core *.orig *.BAK *~
245
246 distclean: clean
247 @if test -f .Makefile; then mv -f .Makefile Makefile; fi
248 EOF
249
250
251 exit 0