File: configure.ac

package info (click to toggle)
clamassassin 1.2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 240 kB
  • sloc: sh: 264; makefile: 16; sed: 15
file content (223 lines) | stat: -rw-r--r-- 5,572 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
AC_INIT(clamassassin, 1.2.4, james.lick@gmail.com)

AC_REVISION($Id: configure.ac.in,v 1.53 2007/03/04 13:02:44 jlick Exp $)

AC_CONFIG_FILES([clamassassin Makefile],[chmod 555 clamassassin])

AC_PATH_PROG(CONF_RM, rm)
if test "$CONF_RM" = ""
then
  AC_MSG_ERROR([Required utility rm not found.])
fi

AC_PATH_PROG(CONF_CAT, cat)
if test "$CONF_CAT" = ""
then
  AC_MSG_ERROR([Required utility cat not found.])
fi

AC_PATH_PROG(CONF_SED, sed)
if test "$CONF_SED" = ""
then
  AC_MSG_ERROR([Required utility sed not found.])
fi

AC_PATH_PROG(CONF_ECHO, echo)
if test "$CONF_ECHO" = ""
then
  AC_MSG_ERROR([Required utility echo not found.])
fi

AC_PATH_PROG(CONF_FORMAIL, formail)
if test "$CONF_FORMAIL" = ""
then
  AC_MSG_ERROR([Required utility formail not found.])
fi

AC_PATH_PROG(CONF_MKTEMP, mktemp)
if test "$CONF_MKTEMP" = ""
then
  AC_MSG_ERROR([Required utility mktemp not found.])
fi

AC_PATH_PROG(CONF_SIGTOOL, sigtool)
if test "$CONF_SIGTOOL" = ""
then
  AC_MSG_ERROR([Required utility sigtool not found.])
fi

AC_PATH_PROG(CONF_CLAMSCAN, clamscan)
if test "$CONF_CLAMSCAN" = ""
then
  AC_MSG_ERROR([Required utility clamscan not found.])
fi
AC_SUBST(CONF_CLAMSCANNER,${CONF_CLAMSCAN})

AC_PATH_PROG(CONF_CLAMDSCAN, clamdscan)
AC_CHECK_FILES(/tmp/clamd)
if test "$ac_cv_file__tmp_clamd" = "yes"
then
  if test "$CONF_CLAMDSCAN" = ""
  then
    AC_MSG_NOTICE([/tmp/clamd found, but can't find clamdscan])
  else
    AC_SUBST(CONF_CLAMSCANNER,${CONF_CLAMDSCAN})
  fi
else
  AC_SUBST(CONF_CLAMSCANNER,${CONF_CLAMSCAN})
fi

AC_ARG_ENABLE(clamdscan,
[  --enable-clamdscan
	Force clamassassin to use clamdscan even if /tmp/clamd not found.
  --disable-clamdscan
	Force clamassassin not to use clamdscan even if /tmp/clamd found.],
[ case $enableval in
    no)
      AC_SUBST(CONF_CLAMSCANNER,${CONF_CLAMSCAN})
      ;;
    *)
      if test "$CONF_CLAMDSCAN" = ""
      then
        AC_MSG_NOTICE([--enable-clamdscan requested, but can't find clamdscan])
      else
        AC_SUBST(CONF_CLAMSCANNER,${CONF_CLAMDSCAN})
      fi
      ;;
  esac
])

DO_VERSION_CHECK="yes";
AC_ARG_ENABLE(version-check,
[  --enable-version-check
	(default) Checks ClamAV version for compatibility.
  --disable-version-check
	Skips checking ClamAV version for compatibility.],
[ if test "$enableval" = "no"
  then
    DO_VERSION_CHECK="no";
  fi
])

if test "${DO_VERSION_CHECK}" = "yes"
then

  CLAMVERS=`${CONF_CLAMSCAN} -V --stdout | ${CONF_SED} -e "s/.*ClamAV //" \
    -e "s/version //" -e "s/\/.*//"`
  CLAMVERSMAJ=`${CONF_ECHO} ${CLAMVERS} | ${CONF_SED} -e "s/[[-\.]].*//"`
  CLAMVERSMIN=`${CONF_ECHO} ${CLAMVERS} | \
    ${CONF_SED} -e "s/[[^-\.]]*[[-\.]]*//" -e "s/[[^0-9]].*//"`
  CLAMVERSEXT=`${CONF_ECHO} ${CLAMVERS} | \
    ${CONF_SED} -e "s/[[^-\.]]*[[-\.]]*//" \
    -e "s/[[0-9]]*\([[^0-9]]*\)/\1/" -e "s/^[[-\.]]//"`
  AC_MSG_NOTICE([ClamAV version ${CLAMVERS} detected.]) 
  # AC_MSG_NOTICE([maj ${CLAMVERSMAJ} min ${CLAMVERSMIN} ext ${CLAMVERSEXT}])
  
  case ${CLAMVERSMAJ} in
    devel)
      AC_MSG_WARN([You are running a devel version of ClamAV.  I guess you know what you're doing])
      ;;
    0)
      if test ${CLAMVERSMIN} -lt 90
      then
        AC_MSG_ERROR([clamassassin requires ClamAV 0.90 or higher])
      fi 
      ;;
  esac
  
fi

AC_MSG_NOTICE([Using scanner ${CONF_CLAMSCANNER}])

AC_SUBST(CONF_CLAMSCANOPT,"--no-summary --stdout")

AC_MSG_NOTICE([Using scanner options ${CONF_CLAMSCANOPT}])

SIGLOC=`${CONF_CLAMSCAN} --debug --tempdir=/dev/null /dev/null 2>&1 | ${CONF_SED} -e "/^LibClamAV debug: Loading databases from /!d" -e "s/.* //" -e q`
if test "$SIGLOC" = ""
then
  AC_MSG_ERROR([Cannot determine virus signature file directory])
else
  AC_MSG_NOTICE([Using virus signature file dir ${SIGLOC}])
  AC_SUBST(CONF_SIGLOC,${SIGLOC})
fi

AC_SUBST(CONF_SIGVERSFLAG,0) 
AC_ARG_ENABLE(signature-version,
[  --enable-signature-version
	Turns on signature version reporting
  --disable-signature-version
	Turns off signature version reporting (default)],
[ if test "$enableval" = "no"
  then
    AC_SUBST(CONF_SIGVERSFLAG,0) 
  else
    AC_SUBST(CONF_SIGVERSFLAG,1) 
  fi
])

if test ${CONF_SIGVERSFLAG} -eq 1
then
  AC_MSG_NOTICE([Signature version reporting is on.])
else
  AC_MSG_NOTICE([Signature version reporting is off.])
fi

AC_SUBST(CONF_ADDSCANNERFLAG,1) 
AC_ARG_ENABLE(name-adding,
[  --enable-name-adding
	Turns on adding of scanner name (default)
  --disable-name-adding
	Turns off adding of scanner name],
[ if test "$enableval" = "no"
  then
    AC_SUBST(CONF_ADDSCANNERFLAG,0) 
  else
    AC_SUBST(CONF_ADDSCANNERFLAG,1) 
  fi
])

if test ${CONF_ADDSCANNERFLAG} -eq 1
then
  AC_MSG_NOTICE([Scanner name adding is on.])
else
  AC_MSG_NOTICE([Scanner name adding is off.])
fi

if test "$TMP" = ""
then
  AC_SUBST(CONF_TMP,/tmp)
else
  AC_SUBST(CONF_TMP,$TMP)
fi
AC_MSG_NOTICE([Using temporary directory $CONF_TMP])

AC_ARG_ENABLE(subject_rewrite,
[  --enable-subject-rewrite[[=message]]
        When a virus is detected, rewrite Subject: header to be
        prefixed with *****VIRUS***** or [[message]] if specified
  --disable-subject-rewrite
        Do not do Subject: header rewriting (default)],
[ case $enableval in
    yes)
      SUBJECTHEAD="*****VIRUS*****"
      ;;
    no)
      SUBJECTHEAD=""
      ;;
    *)
      SUBJECTHEAD=$enableval
      ;;
  esac
],[ SUBJECTHEAD="" ])

if test "$SUBJECTHEAD" = ""
then
  AC_MSG_NOTICE([Subject header rewriting is off.])
else
  AC_MSG_NOTICE([Subject header rewriting is on: $SUBJECTHEAD])
  SUBJECTHEAD="${SUBJECTHEAD} "
  AC_SUBST(CONF_SUBJECTHEAD,$SUBJECTHEAD)
fi

AC_OUTPUT()