2 # Make freshclam (script and daemon)
5 %bcond_without milter # build without 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
15 Source0: http://heanet.dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
16 # Source0-md5: 59bf21e169a35d7e9c27a34435f9b870
17 # Source0-size: 2668125
19 Source2: %{name}.sysconfig
20 Source3: %{name}-milter.init
21 Source4: %{name}-cron-updatedb
22 Source5: %{name}.logrotate
23 # Remember to update date after databases upgrade
24 %define database_version 20041019
25 Source6: http://db.local.clamav.net/daily.cvd
26 # Source6-md5: cee37166f11f509143d61b0e9d3cfeff
27 # Source6-size: 100250
28 Source7: http://db.local.clamav.net/main.cvd
29 # Source7-md5: f006a1f55722c2ff9d50e61cfb938bc7
30 # Source7-size: 1284637
31 Source8: %{name}-post-updatedb
32 Source9: %{name}-milter.sysconfig
33 Patch0: %{name}-pld_config.patch
34 Patch1: %{name}-no_auto_libwrap.patch
35 Patch2: %{name}-nolibs.patch
36 Patch3: %{name}-clamd_conf.patch
37 URL: http://www.clamav.net/
38 BuildRequires: autoconf
39 BuildRequires: automake
40 %{?with_curl:BuildRequires: curl-devel}
41 BuildRequires: gmp-devel
42 %{?with_milter:BuildRequires: libwrap-devel}
43 BuildRequires: libtool
44 BuildRequires: rpmbuild(macros) >= 1.159
45 %{?with_milter:BuildRequires: sendmail-devel >= 8.11}
46 BuildRequires: zlib-devel
47 Requires(pre): /bin/id
48 Requires(pre): /usr/bin/getgid
49 Requires(pre): /usr/sbin/groupadd
50 Requires(pre): /usr/sbin/useradd
51 Requires(postun): /usr/sbin/groupdel
52 Requires(postun): /usr/sbin/userdel
53 Requires(postun): sed >= 4.0
54 Requires(postun,pre): /usr/sbin/usermod
55 Requires(post,preun): /sbin/chkconfig
56 Requires: /usr/sbin/usermod
57 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
59 Provides: group(clamav)
60 Provides: user(clamav)
61 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
64 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
65 AMaViS, compressed files, on-access scanning and includes a program
66 for auto-updating with support for digital signatures. The virus
67 database has over 25000 viruses, worms and trojans signatures. The
68 scanner is multithreaded, written in C, and POSIX compliant.
71 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
72 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
73 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
74 Baza wirusów zawiera ponad 25000 sygnatur. Skaner jest wielow±tkowy,
75 napisany w C i zgodny z POSIXem.
78 Summary: Shared libraries for clamav
79 Summary(pl): Biblioteki dzielone clamav
83 Shared libraries for clamav.
85 %description libs -l pl
86 Biblioteki dzielone clamav.
89 Summary: ClamAV filter using milter interface
90 Summary(pl): Filtr ClamAV korzystaj±cy z interfejsu milter
92 Requires: %{name} = %{epoch}:%{version}-%{release}
93 Requires: sendmail >= 8.11
94 Requires: tcp_wrappers
97 ClamAV sendmail filter using MILTER interface.
99 %description -l pl milter
100 Filtr ClamAV dla sendmaila korzystaj±cy z interfejsu MILTER.
103 Summary: clamav - Development header files and libraries
104 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
105 Group: Development/Libraries
106 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
107 Requires: bzip2-devel
112 This package contains the development header files and libraries
113 necessary to develop clamav client applications.
115 %description devel -l pl
116 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
120 Summary: clamav static libraris
121 Summary(pl): Biblioteki statyczne clamav
122 Group: Development/Libraries
123 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
126 clamav static libraries.
128 %description static -l pl
129 Biblioteki statyczne clamav.
132 Summary: Virus database for clamav
133 Summary(pl): Bazy wirusów dla clamav
135 Version: %{version}.%{database_version}
138 %description database
139 Virus database for clamav (updated %{database_version}).
141 %description database -l pl
142 Bazy wirusów dla clamav (aktualizowana %{database_version}).
151 # kill old libtool.m4 copy
152 head -n 489 acinclude.m4 > acinclude.m4.tmp
153 tail -n +4064 acinclude.m4 >> acinclude.m4.tmp
154 mv -f acinclude.m4.tmp acinclude.m4
164 %{!?with_curl:--without-libcurl} \
165 %{?with_milter:--enable-milter} \
166 --with-dbdir=/var/lib/%{name}
170 rm -rf $RPM_BUILD_ROOT
171 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,logrotate.d} \
172 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/{log,spool/clamav}}
175 DESTDIR=$RPM_BUILD_ROOT
176 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
178 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
179 5 * * * * root %{_sbindir}/clamav-cron-updatedb
182 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
184 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
185 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
187 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
188 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
189 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
190 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
191 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}
192 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}
193 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
195 # NOTE: clamd uses sane rights to it's clamd.pid file
196 # So better keep it dir
197 # If it is fixed use of dir will be unecesary
198 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
200 touch $RPM_BUILD_ROOT%{_var}/log/freshclam.log
203 rm -rf $RPM_BUILD_ROOT
205 %triggerin -- amavis-ng
206 AMAVIS=$(/usr/bin/getgid amavis)
208 if [ $RESULT -eq 0 ]; then
209 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
210 echo "adding clamav to amavis group GID=$AMAVIS"
213 %triggerin -- amavisd-new
214 AMAVIS=$(/usr/bin/getgid amavis)
216 if [ $RESULT -eq 0 ]; then
217 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
218 echo "adding clamav to amavis group GID=$AMAVIS"
221 %triggerin -- amavisd
222 AMAVIS=$(/usr/bin/getgid amavis)
224 if [ $RESULT -eq 0 ]; then
225 echo "adding clamav to amavis group GID=$AMAVIS"
226 /usr/sbin/usermod -G amavis clamav 1>&2
230 if [ -n "`/usr/bin/getgid clamav`" ]; then
231 if [ "`/usr/bin/getgid clamav`" != 43 ]; then
232 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
236 echo "Adding group clamav GID=43"
237 /usr/sbin/groupadd -g 43 clamav
239 if [ -n "`/bin/id -u clamav 2>/dev/null`" ]; then
240 if [ "`/bin/id -u clamav`" != 43 ]; then
241 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
245 echo "Adding user clamav UID=43"
246 /usr/sbin/useradd -u 43 -d /tmp -s /bin/false \
247 -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
248 if [ -n "`/usr/bin/getgid amavis`" ]; then
249 echo "adding clamav to amavis group"
250 /usr/sbin/usermod -G amavis clamav 1>&2
255 /sbin/chkconfig --add clamd
256 if [ -f /var/lock/subsys/clamd ]; then
257 /etc/rc.d/init.d/clamd restart >&2
259 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
261 touch %{_var}/log/freshclam.log
262 chown clamav:root %{_var}/log/freshclam.log
263 chmod 640 %{_var}/log/freshclam.log
266 if [ "$1" = "0" ]; then
267 if [ -f /var/lock/subsys/clamd ]; then
268 /etc/rc.d/init.d/clamd stop
270 /sbin/chkconfig --del clamd
274 if [ "$1" = "0" ]; then
279 %triggerpostun -- %{name} <= 0.75.1
280 if [ -f /etc/clamav.conf.rpmsave ]; then
281 echo "Renaming config to new name /etc/clamd.conf"
282 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
283 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
284 echo "Changing config location in freshclam config"
285 sed -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
290 /sbin/chkconfig --add clamav-milter
291 if [ -f /var/lock/subsys/clamav-milter ]; then
292 /etc/rc.d/init.d/clamd restart >&2
294 echo "Run \"/etc/rc.d/init.d/clamav-milter start\" to start Clam Antivirus daemon." >&2
298 if [ "$1" = "0" ]; then
299 if [ -f /var/lock/subsys/clamav-milter ]; then
300 /etc/rc.d/init.d/clamav-milter stop
302 /sbin/chkconfig --del clamav-milter
305 %post libs -p /sbin/ldconfig
306 %postun libs -p /sbin/ldconfig
308 %post database -p %{_sbindir}/%{name}-post-updatedb
311 %defattr(644,root,root,755)
312 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
313 %attr(755,root,root) %{_bindir}/clamdscan
314 %attr(755,root,root) %{_bindir}/clamscan
315 %attr(755,root,root) %{_bindir}/freshclam
316 %attr(755,root,root) %{_bindir}/sigtool
317 %attr(755,root,root) %{_sbindir}/clamd
318 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
319 %attr(755,clamav,root) %dir /var/lib/%{name}
320 %attr(640,clamav,root) %ghost %{_var}/log/freshclam.log
321 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
323 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
324 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/clamd.conf
325 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/freshclam.conf
327 %attr(754,root,root) /etc/rc.d/init.d/clamd
328 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
329 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/clamav
331 %{_mandir}/man8/clamd*
335 %defattr(644,root,root,755)
336 %config(noreplace) %{_sysconfdir}/sysconfig/clamav-milter
337 %attr(755,root,root) /etc/rc.d/init.d/clamav-milter
338 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
339 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
340 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
341 %attr(755,root,root) %{_sbindir}/clamav-milter
342 %{_mandir}/man8/clamav-milter.8*
343 %attr(700,clamav,clamav) /var/spool/clamav/
347 %defattr(644,root,root,755)
348 %attr(755,root,root) %{_libdir}/lib*.so.*.*
351 %defattr(644,root,root,755)
352 %attr(755,root,root) %{_bindir}/clamav-config
353 %attr(755,root,root) %{_libdir}/lib*.so
356 %{_pkgconfigdir}/*.pc
359 %defattr(644,root,root,755)
363 %defattr(644,root,root,755)
364 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
365 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.cvd