8 |
|
|
9 |
debug="yes" |
debug="yes" |
10 |
checkperms="yes" |
checkperms="yes" |
11 |
|
memlock="yes" |
12 |
encpasswds="yes" |
encpasswds="yes" |
13 |
ssl="yes" |
ssl="yes" |
14 |
|
|
16 |
libenc="-lcrypto" |
libenc="-lcrypto" |
17 |
libssl="-lssl -lcrypto" |
libssl="-lssl -lcrypto" |
18 |
|
|
19 |
|
cflags="" |
20 |
|
|
21 |
interactive="no" |
interactive="no" |
22 |
|
|
23 |
|
|
50 |
if [ $body = "yes" ]; then checkperms="yes" |
if [ $body = "yes" ]; then checkperms="yes" |
51 |
elif [ $body = "no" ]; then checkperms="no" |
elif [ $body = "no" ]; then checkperms="no" |
52 |
fi |
fi |
53 |
|
elif [ $head = "memlock" ] |
54 |
|
then |
55 |
|
if [ $body = "yes" ]; then memlock="yes" |
56 |
|
elif [ $body = "no" ]; then memlock="no" |
57 |
|
fi |
58 |
elif [ $head = "encpasswds" ] |
elif [ $head = "encpasswds" ] |
59 |
then |
then |
60 |
if [ $body = "yes" ]; then encpasswds="yes" |
if [ $body = "yes" ]; then encpasswds="yes" |
86 |
Options: |
Options: |
87 |
debug Debugging information, useful during development [yes] |
debug Debugging information, useful during development [yes] |
88 |
checkperms Configuration file's permissions checking [yes] |
checkperms Configuration file's permissions checking [yes] |
89 |
|
memlock Try to lock memory pages to avoid swapping [yes] |
90 |
encpasswds Encrypted passwords support [yes] |
encpasswds Encrypted passwords support [yes] |
91 |
ssl Secure Socket Layer and Transport Layer Security [yes] |
ssl Secure Socket Layer and Transport Layer Security [yes] |
92 |
EOF |
EOF |
100 |
|
|
101 |
if [ $interactive = "yes" ] |
if [ $interactive = "yes" ] |
102 |
then |
then |
103 |
echo -n "Destination directory [$destdir]: " |
printf "Destination directory [$destdir]: " |
104 |
read tmp |
read tmp |
105 |
if [ -n "$tmp" ]; then destdir="$tmp"; fi |
if [ -n "$tmp" ]; then destdir="$tmp"; fi |
106 |
|
|
107 |
echo -n "Binaries directory [$bindir]: " |
printf "Binaries directory [$bindir]: " |
108 |
read tmp |
read tmp |
109 |
if [ -n "$tmp" ]; then bindir="$tmp"; fi |
if [ -n "$tmp" ]; then bindir="$tmp"; fi |
110 |
|
|
111 |
echo -n "Manual pages directory [$mandir]: " |
printf "Manual pages directory [$mandir]: " |
112 |
read tmp |
read tmp |
113 |
if [ -n "$tmp" ]; then mandir="$tmp"; fi |
if [ -n "$tmp" ]; then mandir="$tmp"; fi |
114 |
|
|
115 |
echo -n "Debugging information [$debug]: " |
printf "Debugging information [$debug]: " |
116 |
read tmp |
read tmp |
117 |
if [ -n "$tmp" ]; then debug="$tmp"; fi |
if [ -n "$tmp" ]; then debug="$tmp"; fi |
118 |
|
|
119 |
echo -n "Configuration file permissions checking [$checkperms]: " |
printf "Configuration file permissions checking [$checkperms]: " |
120 |
read tmp |
read tmp |
121 |
if [ -n "$tmp" ]; then checkperms="$tmp"; fi |
if [ -n "$tmp" ]; then checkperms="$tmp"; fi |
122 |
|
|
123 |
echo -n "Encrypted passwords support: " |
printf "Try to lock memory pages to avoid swapping [$memlock]: " |
124 |
|
read tmp |
125 |
|
if [ -n "$tmp" ]; then memlock="$tmp"; fi |
126 |
|
|
127 |
|
printf "Encrypted passwords support: " |
128 |
read tmp |
read tmp |
129 |
if [ -n "$tmp" ]; then encpasswds="$tmp"; fi |
if [ -n "$tmp" ]; then encpasswds="$tmp"; fi |
130 |
|
|
131 |
echo -n "Secure Socket Layer and Transport Layer Security [$ssl]: " |
printf "Secure Socket Layer and Transport Layer Security [$ssl]: " |
132 |
read tmp |
read tmp |
133 |
if [ -n "$tmp" ]; then ssl="$tmp"; fi |
if [ -n "$tmp" ]; then ssl="$tmp"; fi |
134 |
else |
else |
138 |
Manual pages directory: $mandir |
Manual pages directory: $mandir |
139 |
Debugging information: $debug |
Debugging information: $debug |
140 |
Configuration file permissions checking: $checkperms |
Configuration file permissions checking: $checkperms |
141 |
|
Try to lock memory pages to avoid swapping: $memlock |
142 |
Encrypted passwords support: $encpasswds |
Encrypted passwords support: $encpasswds |
143 |
Secure Socket Layer and Transport Layer Security: $ssl |
Secure Socket Layer and Transport Layer Security: $ssl |
144 |
EOF |
EOF |
156 |
fi |
fi |
157 |
|
|
158 |
|
|
159 |
|
# C flags |
160 |
|
|
161 |
|
if [ $debug = "yes" ] |
162 |
|
then |
163 |
|
cflags="-g" |
164 |
|
else |
165 |
|
cflags="-O" |
166 |
|
fi |
167 |
|
|
168 |
|
|
169 |
# Backup of original Makefile and config.h |
# Backup of original Makefile and config.h |
170 |
|
|
178 |
|
|
179 |
cat > Makefile << EOF |
cat > Makefile << EOF |
180 |
CC = cc |
CC = cc |
181 |
CFLAGS = -Wall -O2 |
CFLAGS = $cflags |
182 |
|
|
183 |
DESTDIR = $destdir |
DESTDIR = $destdir |
184 |
BINDIR = $bindir |
BINDIR = $bindir |
185 |
MANDIR = $mandir |
MANDIR = $mandir |
186 |
|
|
|
INSTALL = install -c |
|
|
INST_DIR = install -d |
|
|
INST_BIN = \$(INSTALL) -m 755 |
|
|
INST_DOC = \$(INSTALL) -m 644 |
|
|
|
|
187 |
MAN_BIN = imapfilter.1 |
MAN_BIN = imapfilter.1 |
188 |
MAN_RC = imapfilterrc.5 |
MAN_RC = imapfilterrc.5 |
189 |
|
|
201 |
data.o imapfilter.o imap.o file.o passwd.o request.o socket.o: data.h |
data.o imapfilter.o imap.o file.o passwd.o request.o socket.o: data.h |
202 |
|
|
203 |
install: imapfilter |
install: imapfilter |
204 |
if test ! -d \$(BINDIR); then \$(INST_DIR) \$(BINDIR); fi |
if test ! -d \$(BINDIR); then mkdir -p \$(BINDIR); fi |
205 |
\$(INST_BIN) \$(BIN) \$(BINDIR) |
cp -f \$(BIN) \$(BINDIR) && chmod 0755 \$(BINDIR)/\$(BIN) |
206 |
if test ! -d \$(MANDIR)/man1; then \$(INST_DIR) \$(MANDIR)/man1; fi |
if test ! -d \$(MANDIR)/man1; then mkdir -p \$(MANDIR)/man1; fi |
207 |
\$(INST_DOC) \$(MAN_BIN) \$(MANDIR)/man1 |
cp -f \$(MAN_BIN) \$(MANDIR)/man1 && chmod 0644 \$(MANDIR)/man1/\$(MAN_BIN) |
208 |
if test ! -d \$(MANDIR)/man5; then \$(INST_DIR) \$(MANDIR)/man5; fi |
if test ! -d \$(MANDIR)/man5; then \$(MKDIR) \$(MANDIR)/man5; fi |
209 |
\$(INST_DOC) \$(MAN_RC) \$(MANDIR)/man5 |
cp -f \$(MAN_RC) \$(MANDIR)/man5 && chmod 0644 \$(MANDIR)/man5/\$(MAN_RC) |
210 |
|
|
211 |
uninstall: |
uninstall: |
212 |
rm -f \$(BINDIR)/\$(BIN) \$(MANDIR)/man1/\$(MAN_BIN) \$(MANDIR)/man5/\$(MAN_RC) |
rm -f \$(BINDIR)/\$(BIN) \$(MANDIR)/man1/\$(MAN_BIN) \$(MANDIR)/man5/\$(MAN_RC) |
215 |
rm -f \$(OBJ) \$(BIN) imapfilter.core core *.BAK *~ |
rm -f \$(OBJ) \$(BIN) imapfilter.core core *.BAK *~ |
216 |
|
|
217 |
distclean: clean |
distclean: clean |
218 |
@if test -f .Makefile; then mv .Makefile Makefile; fi |
@if test -f .Makefile; then mv -f .Makefile Makefile; fi |
219 |
@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 |
|
220 |
EOF |
EOF |
221 |
|
|
222 |
|
|
242 |
fi |
fi |
243 |
echo >> config.h |
echo >> config.h |
244 |
|
|
245 |
|
echo "/* Try to lock memory pages to avoid swapping. */" >> config.h |
246 |
|
if [ $memlock = "yes" ] |
247 |
|
then |
248 |
|
echo "#define MEMORY_LOCK" >> config.h |
249 |
|
else |
250 |
|
echo "#undef MEMORY_LOCK" >> config.h |
251 |
|
fi |
252 |
|
echo >> config.h |
253 |
|
|
254 |
echo "/* Encrypted passwords support. */" >> config.h |
echo "/* Encrypted passwords support. */" >> config.h |
255 |
if [ $encpasswds = "yes" ] |
if [ $encpasswds = "yes" ] |
256 |
then |
then |