2 # Make freshclam (script and daemon)
5 %bcond_with milter # without milter subpackage
7 Summary: An anti-virus utility for Unix
8 Summary(pl): Antywirusowe narzêdzie dla Uniksów
14 Source0: http://dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
15 # Source0-md5: 2c85b7957eba9fd9e9ff8c2537ae006f
17 Source2: %{name}.sysconfig
18 Source3: %{name}-milter.init
19 Source4: %{name}-cron-updatedb
20 Source5: %{name}.logrotate
21 # Remember to update date after databases upgrade
22 %define database_version 20040925
23 Source6: http://db.local.clamav.net/daily.cvd
24 # Source6-md5: 33008e54fb1d1a987f9953a0fd245d20
25 Source7: http://db.local.clamav.net/main.cvd
26 # Source7-md5: f006a1f55722c2ff9d50e61cfb938bc7
27 Source8: %{name}-post-updatedb
28 Source9: %{name}-milter.sysconfig
29 Patch0: %{name}-pld_config.patch
30 Patch1: %{name}-no_auto_libwrap.patch
31 Patch2: %{name}-nolibs.patch
32 URL: http://www.clamav.net/
33 BuildRequires: autoconf
34 BuildRequires: automake
35 BuildRequires: gmp-devel
36 %{?with_milter:BuildRequires: libwrap-devel}
37 BuildRequires: libtool
38 BuildRequires: rpmbuild(macros) >= 1.159
39 %{?with_milter:BuildRequires: sendmail-devel >= 8.11}
40 BuildRequires: zlib-devel
41 Requires(pre): /bin/id
42 Requires(pre): /usr/bin/getgid
43 Requires(pre): /usr/sbin/groupadd
44 Requires(pre): /usr/sbin/useradd
45 Requires(postun): /usr/sbin/groupdel
46 Requires(postun): /usr/sbin/userdel
47 Requires(postun,pre): /usr/sbin/usermod
48 Requires(post,preun): /sbin/chkconfig
49 Requires: /usr/sbin/usermod
50 Requires: %{name}-libs = %{version}-%{release}
52 Provides: group(clamav)
53 Provides: user(clamav)
54 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
58 AMaViS, compressed files, on-access scanning and includes a program
59 for auto-updating with support for digital signatures. The virus
60 database has over 20000 viruses, worms and trojans signatures. The
61 scanner is multithreaded, written in C, and POSIX compliant.
64 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
65 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
66 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
67 Baza wirusów zawiera ponad 20000 sygnatur. Skaner jest wielow±tkowy,
68 napisany w C i zgodny z POSIXem.
71 Summary: Shared libraries for clamav
72 Summary(pl): Biblioteki dzielone clamav
76 Shared libraries for clamav.
78 %description libs -l pl
79 Biblioteki dzielone clamav.
82 Summary: ClamAV filter using milter interface
83 Summary(pl): Filtr ClamAV korzystaj±cy z interfejsu milter
85 Requires: %{name} = %{epoch}:%{version}-%{release}
86 Requires: sendmail >= 8.11
87 Requires: tcp_wrappers
90 ClamAV sendmail filter using MILTER interface.
92 %description -l pl milter
93 Filtr ClamAV dla sendmaila korzystaj±cy z interfejsu MILTER.
96 Summary: clamav - Development header files and libraries
97 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
98 Group: Development/Libraries
99 Requires: %{name}-libs = %{version}-%{release}
100 Requires: bzip2-devel
105 This package contains the development header files and libraries
106 necessary to develop clamav client applications.
108 %description devel -l pl
109 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
113 Summary: clamav static libraris
114 Summary(pl): Biblioteki statyczne clamav
115 Group: Development/Libraries
116 Requires: %{name}-devel = %{version}-%{release}
119 clamav static libraries.
121 %description static -l pl
122 Biblioteki statyczne clamav.
125 Summary: Virus database for clamav
126 Summary(pl): Bazy wirusów dla clamav
128 Version: %{version}.%{database_version}
131 %description database
132 Virus database for clamav (updated %{database_version}).
134 %description database -l pl
135 Bazy wirusów dla clamav (aktualizowana %{database_version}).
143 # kill old libtool.m4 copy
144 head -n 489 acinclude.m4 > acinclude.m4.tmp
145 tail -n +4064 acinclude.m4 >> acinclude.m4.tmp
146 mv -f acinclude.m4.tmp acinclude.m4
156 %{?with_milter:--enable-milter} \
157 --with-dbdir=/var/lib/%{name}
161 rm -rf $RPM_BUILD_ROOT
162 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,logrotate.d} \
163 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/{log,spool/clamav}}
166 DESTDIR=$RPM_BUILD_ROOT
167 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
169 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
170 5 * * * * root %{_sbindir}/clamav-cron-updatedb
173 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
175 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
176 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
178 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
179 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
180 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
181 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
182 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}
183 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}
184 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
186 # NOTE: clamd uses sane rights to it's clamd.pid file
187 # So better keep it dir
188 # If it is fixed use of dir will be unecesary
189 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
191 touch $RPM_BUILD_ROOT%{_var}/log/freshclam.log
194 rm -rf $RPM_BUILD_ROOT
196 %triggerin -- amavis-ng
197 AMAVIS=$(/usr/bin/getgid amavis)
199 if [ $RESULT -eq 0 ]; then
200 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
201 echo "adding clamav to amavis group GID=$AMAVIS"
204 %triggerin -- amavisd-new
205 AMAVIS=$(/usr/bin/getgid amavis)
207 if [ $RESULT -eq 0 ]; then
208 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
209 echo "adding clamav to amavis group GID=$AMAVIS"
212 %triggerin -- amavisd
213 AMAVIS=$(/usr/bin/getgid amavis)
215 if [ $RESULT -eq 0 ]; then
216 echo "adding clamav to amavis group GID=$AMAVIS"
217 /usr/sbin/usermod -G amavis clamav 1>&2
221 if [ -n "`/usr/bin/getgid clamav`" ]; then
222 if [ "`/usr/bin/getgid clamav`" != 43 ]; then
223 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
227 echo "Adding group clamav GID=43"
228 /usr/sbin/groupadd -g 43 clamav
230 if [ -n "`/bin/id -u clamav 2>/dev/null`" ]; then
231 if [ "`/bin/id -u clamav`" != 43 ]; then
232 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
236 echo "Adding user clamav UID=43"
237 /usr/sbin/useradd -u 43 -d /tmp -s /bin/false \
238 -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
239 if [ -n "`/usr/bin/getgid amavis`" ]; then
240 echo "adding clamav to amavis group
241 /usr/sbin/usermod -G amavis clamav 1>&2
246 /sbin/chkconfig --add clamd
247 if [ -f /var/lock/subsys/clamd ]; then
248 /etc/rc.d/init.d/clamd restart >&2
250 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
252 touch %{_var}/log/freshclam.log
253 chown clamav:root %{_var}/log/freshclam.log
254 chmod 640 %{_var}/log/freshclam.log
257 if [ "$1" = "0" ]; then
258 if [ -f /var/lock/subsys/clamd ]; then
259 /etc/rc.d/init.d/clamd stop
261 /sbin/chkconfig --del clamd
265 if [ "$1" = "0" ]; then
272 /sbin/chkconfig --add clamav-milter
273 if [ -f /var/lock/subsys/clamav-milter ]; then
274 /etc/rc.d/init.d/clamd restart >&2
276 echo "Run \"/etc/rc.d/init.d/clamav-milter start\" to start Clam Antivirus daemon." >&2
280 if [ "$1" = "0" ]; then
281 if [ -f /var/lock/subsys/clamav-milter ]; then
282 /etc/rc.d/init.d/clamav-milter stop
284 /sbin/chkconfig --del clamav-milter
287 %post libs -p /sbin/ldconfig
288 %postun libs -p /sbin/ldconfig
290 %post database -p %{_sbindir}/%{name}-post-updatedb
293 %defattr(644,root,root,755)
294 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
295 %attr(755,root,root) %{_bindir}/clamdscan
296 %attr(755,root,root) %{_bindir}/clamscan
297 %attr(755,root,root) %{_bindir}/freshclam
298 %attr(755,root,root) %{_bindir}/sigtool
299 %attr(755,root,root) %{_sbindir}/clamd
300 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
301 %attr(755,clamav,root) %dir /var/lib/%{name}
302 %attr(640,clamav,root) %ghost %{_var}/log/freshclam.log
303 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
305 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
306 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/clamav.conf
307 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/freshclam.conf
309 %attr(754,root,root) /etc/rc.d/init.d/clamd
310 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
311 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/clamav
313 %{_mandir}/man8/clamd*
317 %defattr(644,root,root,755)
318 %config(noreplace) %{_sysconfdir}/sysconfig/clamav-milter
319 %attr(755,root,root) /etc/rc.d/init.d/clamav-milter
320 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
321 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
322 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
323 %attr(755,root,root) %{_sbindir}/clamav-milter
324 %{_mandir}/man8/clamav-milter.8*
325 %attr(700,clamav,clamav) /var/spool/clamav/
329 %defattr(644,root,root,755)
330 %attr(755,root,root) %{_libdir}/lib*.so.*.*
333 %defattr(644,root,root,755)
334 %attr(755,root,root) %{_bindir}/clamav-config
335 %attr(755,root,root) %{_libdir}/lib*.so
338 %{_pkgconfigdir}/*.pc
341 %defattr(644,root,root,755)
345 %defattr(644,root,root,755)
346 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
347 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.cvd