2 # Make freshclam (script and daemon)
5 %bcond_with milter # build milter subpackage
6 %bcond_with curl # enable curl support
8 Summary: An anti-virus utility for Unix
9 Summary(pl): Antywirusowe narzêdzie dla Uniksów
16 Source0: http://heanet.dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
17 # Source0-md5: 60081ddd9f29cbb8f0a2fe575e5a8afa
18 # Source0-size: 2668125
20 Source2: %{name}.sysconfig
21 Source3: %{name}-milter.init
22 Source4: %{name}-cron-updatedb
23 Source5: %{name}.logrotate
24 # Remember to update date after databases upgrade
25 %define database_version 20041019
26 Source6: http://db.local.clamav.net/daily.cvd
27 # Source6-md5: 7cde580e2d1ba336dbd0abf86ea9fa93
28 # Source6-size: 100250
29 Source7: http://db.local.clamav.net/main.cvd
30 # Source7-md5: 59f425f2dffe9a98926bfae94f299880
31 # Source7-size: 1284637
32 Source8: %{name}-post-updatedb
33 Source9: %{name}-milter.sysconfig
34 Patch0: %{name}-pld_config.patch
35 Patch1: %{name}-no_auto_libwrap.patch
36 Patch2: %{name}-nolibs.patch
37 Patch3: %{name}-clamd_conf.patch
38 URL: http://www.clamav.net/
39 BuildRequires: autoconf
40 BuildRequires: automake
41 %{?with_curl:BuildRequires: curl-devel}
42 BuildRequires: gmp-devel
43 %{?with_milter:BuildRequires: libwrap-devel}
44 BuildRequires: libtool
45 #BuildRequires: rpmbuild(macros) >= 1.159
46 %{?with_milter:BuildRequires: sendmail-devel >= 8.11}
47 BuildRequires: zlib-devel
48 Requires(pre): /bin/id
49 Requires(pre): /usr/bin/getgid
50 Requires(pre): /usr/sbin/groupadd
51 Requires(pre): /usr/sbin/useradd
52 Requires(postun): /usr/sbin/groupdel
53 Requires(postun): /usr/sbin/userdel
54 Requires(postun): sed >= 4.0
55 Requires(postun,pre): /usr/sbin/usermod
56 Requires(post,preun): /sbin/chkconfig
57 Requires: /usr/sbin/usermod
58 Requires: %{name}-libs = %{epoch}%{version}-%{release}
60 Provides: group(clamav)
61 Provides: user(clamav)
62 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
65 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
66 AMaViS, compressed files, on-access scanning and includes a program
67 for auto-updating with support for digital signatures. The virus
68 database has over 25000 viruses, worms and trojans signatures. The
69 scanner is multithreaded, written in C, and POSIX compliant.
72 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
73 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
74 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
75 Baza wirusów zawiera ponad 25000 sygnatur. Skaner jest wielow±tkowy,
76 napisany w C i zgodny z POSIXem.
79 Summary: Shared libraries for clamav
80 Summary(pl): Biblioteki dzielone clamav
84 Shared libraries for clamav.
86 %description libs -l pl
87 Biblioteki dzielone clamav.
90 Summary: ClamAV filter using milter interface
91 Summary(pl): Filtr ClamAV korzystaj±cy z interfejsu milter
93 Requires: %{name} = %{epoch}:%{version}-%{release}
94 Requires: sendmail >= 8.11
95 Requires: tcp_wrappers
98 ClamAV sendmail filter using MILTER interface.
100 %description -l pl milter
101 Filtr ClamAV dla sendmaila korzystaj±cy z interfejsu MILTER.
104 Summary: clamav - Development header files and libraries
105 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
106 Group: Development/Libraries
107 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
108 Requires: bzip2-devel
113 This package contains the development header files and libraries
114 necessary to develop clamav client applications.
116 %description devel -l pl
117 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
121 Summary: clamav static libraris
122 Summary(pl): Biblioteki statyczne clamav
123 Group: Development/Libraries
124 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
127 clamav static libraries.
129 %description static -l pl
130 Biblioteki statyczne clamav.
133 Summary: Virus database for clamav
134 Summary(pl): Bazy wirusów dla clamav
136 Version: %{version}.%{database_version}
139 %description database
140 Virus database for clamav (updated %{database_version}).
142 %description database -l pl
143 Bazy wirusów dla clamav (aktualizowana %{database_version}).
152 # kill old libtool.m4 copy
153 head -n 489 acinclude.m4 > acinclude.m4.tmp
154 tail -n +4089 acinclude.m4 >> acinclude.m4.tmp
155 mv -f acinclude.m4.tmp acinclude.m4
165 %{!?with_curl:--without-libcurl} \
166 %{?with_milter:--enable-milter} \
167 --with-dbdir=/var/lib/%{name}
171 rm -rf $RPM_BUILD_ROOT
172 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,logrotate.d} \
173 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/{log,spool/clamav}}
176 DESTDIR=$RPM_BUILD_ROOT
177 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
179 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
180 5 * * * * root %{_sbindir}/clamav-cron-updatedb
183 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
185 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
186 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
188 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
189 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
190 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
191 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
192 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}
193 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}
194 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
196 # NOTE: clamd uses sane rights to it's clamd.pid file
197 # So better keep it dir
198 # If it is fixed use of dir will be unecesary
199 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
201 touch $RPM_BUILD_ROOT%{_var}/log/freshclam.log
204 rm -rf $RPM_BUILD_ROOT
206 %triggerin -- amavis-ng
207 AMAVIS=$(/usr/bin/getgid amavis)
209 if [ $RESULT -eq 0 ]; then
210 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
211 echo "adding clamav to amavis group GID=$AMAVIS"
214 %triggerin -- amavisd-new
215 AMAVIS=$(/usr/bin/getgid amavis)
217 if [ $RESULT -eq 0 ]; then
218 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
219 echo "adding clamav to amavis group GID=$AMAVIS"
222 %triggerin -- amavisd
223 AMAVIS=$(/usr/bin/getgid amavis)
225 if [ $RESULT -eq 0 ]; then
226 echo "adding clamav to amavis group GID=$AMAVIS"
227 /usr/sbin/usermod -G amavis clamav 1>&2
231 if [ -n "`/usr/bin/getgid clamav`" ]; then
232 if [ "`/usr/bin/getgid clamav`" != 43 ]; then
233 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
237 echo "Adding group clamav GID=43"
238 /usr/sbin/groupadd -g 43 clamav
240 if [ -n "`/bin/id -u clamav 2>/dev/null`" ]; then
241 if [ "`/bin/id -u clamav`" != 43 ]; then
242 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
246 echo "Adding user clamav UID=43"
247 /usr/sbin/useradd -u 43 -d /tmp -s /bin/false \
248 -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
249 if [ -n "`/usr/bin/getgid amavis`" ]; then
250 echo "adding clamav to amavis group"
251 /usr/sbin/usermod -G amavis clamav 1>&2
256 /sbin/chkconfig --add clamd
257 if [ -f /var/lock/subsys/clamd ]; then
258 /etc/rc.d/init.d/clamd restart >&2
260 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
262 touch %{_var}/log/freshclam.log
263 chown clamav:root %{_var}/log/freshclam.log
264 chmod 640 %{_var}/log/freshclam.log
267 if [ "$1" = "0" ]; then
268 if [ -f /var/lock/subsys/clamd ]; then
269 /etc/rc.d/init.d/clamd stop
271 /sbin/chkconfig --del clamd
275 if [ "$1" = "0" ]; then
276 echo "Removing user clamav"
277 /usr/sbin/userdel clamav
278 echo "Removing group clamav"
279 /usr/sbin/groupdel clamav
282 %triggerpostun -- %{name} <= 0.75.1
283 if [ -f /etc/clamav.conf.rpmsave ]; then
284 echo "Renaming config to new name /etc/clamd.conf"
285 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
286 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
287 echo "Changing config location in freshclam config"
288 sed -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
293 /sbin/chkconfig --add clamav-milter
294 if [ -f /var/lock/subsys/clamav-milter ]; then
295 /etc/rc.d/init.d/clamd restart >&2
297 echo "Run \"/etc/rc.d/init.d/clamav-milter start\" to start Clam Antivirus daemon." >&2
301 if [ "$1" = "0" ]; then
302 if [ -f /var/lock/subsys/clamav-milter ]; then
303 /etc/rc.d/init.d/clamav-milter stop
305 /sbin/chkconfig --del clamav-milter
308 %post libs -p /sbin/ldconfig
309 %postun libs -p /sbin/ldconfig
311 %post database -p %{_sbindir}/%{name}-post-updatedb
314 %defattr(644,root,root,755)
315 %doc AUTHORS ChangeLog FAQ NEWS README TODO
316 %attr(755,root,root) %{_bindir}/clamdscan
317 %attr(755,root,root) %{_bindir}/clamscan
318 %attr(755,root,root) %{_bindir}/freshclam
319 %attr(755,root,root) %{_bindir}/sigtool
320 %attr(755,root,root) %{_sbindir}/clamd
321 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
322 %attr(755,clamav,root) %dir /var/lib/%{name}
323 %attr(640,clamav,root) %ghost %{_var}/log/freshclam.log
324 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
326 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
327 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/clamd.conf
328 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/freshclam.conf
330 %attr(754,root,root) /etc/rc.d/init.d/clamd
331 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
332 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/clamav
334 %{_mandir}/man8/clamd*
338 %defattr(644,root,root,755)
339 %config(noreplace) %{_sysconfdir}/sysconfig/clamav-milter
340 %attr(755,root,root) /etc/rc.d/init.d/clamav-milter
341 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
342 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
343 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
344 %attr(755,root,root) %{_sbindir}/clamav-milter
345 %{_mandir}/man8/clamav-milter.8*
346 %attr(700,clamav,clamav) /var/spool/clamav/
350 %defattr(644,root,root,755)
351 %attr(755,root,root) %{_libdir}/lib*.so.*.*
354 %defattr(644,root,root,755)
355 %attr(755,root,root) %{_bindir}/clamav-config
356 %attr(755,root,root) %{_libdir}/lib*.so
359 %{_pkgconfigdir}/*.pc
362 %defattr(644,root,root,755)
366 %defattr(644,root,root,755)
367 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
368 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.cvd