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
16 Source0: http://heanet.dl.sourceforge.net/clamav/%{name}-%{version}.tar.gz
17 # Source0-md5: 59bf21e169a35d7e9c27a34435f9b870
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: cee37166f11f509143d61b0e9d3cfeff
28 # Source6-size: 100250
29 Source7: http://db.local.clamav.net/main.cvd
30 # Source7-md5: f006a1f55722c2ff9d50e61cfb938bc7
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 BuildRequires: bzip2-devel
42 %{?with_curl:BuildRequires: curl-devel}
43 BuildRequires: gmp-devel
44 %{?with_milter:BuildRequires: libwrap-devel}
45 BuildRequires: libtool
46 BuildRequires: rpmbuild(macros) >= 1.159
47 %{?with_milter:BuildRequires: sendmail-devel >= 8.11}
48 BuildRequires: zlib-devel
49 Requires(pre): /bin/id
50 Requires(pre): /usr/bin/getgid
51 Requires(pre): /usr/sbin/groupadd
52 Requires(pre): /usr/sbin/useradd
53 Requires(postun): /usr/sbin/groupdel
54 Requires(postun): /usr/sbin/userdel
55 Requires(postun): sed >= 4.0
56 Requires(postun,pre): /usr/sbin/usermod
57 Requires(post,preun): /sbin/chkconfig
58 Requires: /usr/sbin/usermod
59 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
61 Provides: group(clamav)
62 Provides: user(clamav)
63 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
66 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
67 AMaViS, compressed files, on-access scanning and includes a program
68 for auto-updating with support for digital signatures. The virus
69 database has over 25000 viruses, worms and trojans signatures. The
70 scanner is multithreaded, written in C, and POSIX compliant.
73 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
74 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
75 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
76 Baza wirusów zawiera ponad 25000 sygnatur. Skaner jest wielow±tkowy,
77 napisany w C i zgodny z POSIXem.
80 Summary: Shared libraries for clamav
81 Summary(pl): Biblioteki dzielone clamav
85 Shared libraries for clamav.
87 %description libs -l pl
88 Biblioteki dzielone clamav.
91 Summary: ClamAV filter using milter interface
92 Summary(pl): Filtr ClamAV korzystaj±cy z interfejsu milter
94 Requires: %{name} = %{epoch}:%{version}-%{release}
95 Requires: sendmail >= 8.11
96 Requires: tcp_wrappers
99 ClamAV sendmail filter using MILTER interface.
101 %description milter -l pl
102 Filtr ClamAV dla sendmaila korzystaj±cy z interfejsu MILTER.
105 Summary: clamav - Development header files and libraries
106 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
107 Group: Development/Libraries
108 Requires: %{name}-libs = %{epoch}:%{version}-%{release}
109 Requires: bzip2-devel
114 This package contains the development header files and libraries
115 necessary to develop clamav client applications.
117 %description devel -l pl
118 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
122 Summary: clamav static libraris
123 Summary(pl): Biblioteki statyczne clamav
124 Group: Development/Libraries
125 Requires: %{name}-devel = %{epoch}:%{version}-%{release}
128 clamav static libraries.
130 %description static -l pl
131 Biblioteki statyczne clamav.
134 Summary: Virus database for clamav
135 Summary(pl): Bazy wirusów dla clamav
137 Version: %{version}.%{database_version}
140 %description database
141 Virus database for clamav (updated %{database_version}).
143 %description database -l pl
144 Bazy wirusów dla clamav (aktualizowana %{database_version}).
153 # kill old libtool.m4 copy
154 head -n 489 acinclude.m4 > acinclude.m4.tmp
155 tail -n +4064 acinclude.m4 >> acinclude.m4.tmp
156 mv -f acinclude.m4.tmp acinclude.m4
166 %{!?with_curl:--without-libcurl} \
167 %{?with_milter:--enable-milter} \
168 --with-dbdir=/var/lib/%{name}
172 rm -rf $RPM_BUILD_ROOT
173 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,logrotate.d} \
174 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/{log,spool/clamav}}
177 DESTDIR=$RPM_BUILD_ROOT
178 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
180 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
181 5 * * * * root %{_sbindir}/clamav-cron-updatedb
184 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
186 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
187 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
189 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
190 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
191 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
192 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
193 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}
194 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}
195 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
197 # NOTE: clamd uses sane rights to it's clamd.pid file
198 # So better keep it dir
199 # If it is fixed use of dir will be unecesary
200 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
202 touch $RPM_BUILD_ROOT%{_var}/log/freshclam.log
205 rm -rf $RPM_BUILD_ROOT
207 %triggerin -- amavis-ng
208 AMAVIS=$(/usr/bin/getgid amavis)
210 if [ $RESULT -eq 0 ]; then
211 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
212 echo "adding clamav to amavis group GID=$AMAVIS"
215 %triggerin -- amavisd-new
216 AMAVIS=$(/usr/bin/getgid amavis)
218 if [ $RESULT -eq 0 ]; then
219 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
220 echo "adding clamav to amavis group GID=$AMAVIS"
223 %triggerin -- amavisd
224 AMAVIS=$(/usr/bin/getgid amavis)
226 if [ $RESULT -eq 0 ]; then
227 echo "adding clamav to amavis group GID=$AMAVIS"
228 /usr/sbin/usermod -G amavis clamav 1>&2
232 if [ -n "`/usr/bin/getgid clamav`" ]; then
233 if [ "`/usr/bin/getgid clamav`" != 43 ]; then
234 echo "Error: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
238 echo "Adding group clamav GID=43"
239 /usr/sbin/groupadd -g 43 clamav
241 if [ -n "`/bin/id -u clamav 2>/dev/null`" ]; then
242 if [ "`/bin/id -u clamav`" != 43 ]; then
243 echo "Error: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
247 echo "Adding user clamav UID=43"
248 /usr/sbin/useradd -u 43 -d /tmp -s /bin/false \
249 -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
250 if [ -n "`/usr/bin/getgid amavis`" ]; then
251 echo "adding clamav to amavis group"
252 /usr/sbin/usermod -G amavis clamav 1>&2
257 /sbin/chkconfig --add clamd
258 if [ -f /var/lock/subsys/clamd ]; then
259 /etc/rc.d/init.d/clamd restart >&2
261 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
263 touch %{_var}/log/freshclam.log
264 chown clamav:root %{_var}/log/freshclam.log
265 chmod 640 %{_var}/log/freshclam.log
268 if [ "$1" = "0" ]; then
269 if [ -f /var/lock/subsys/clamd ]; then
270 /etc/rc.d/init.d/clamd stop
272 /sbin/chkconfig --del clamd
276 if [ "$1" = "0" ]; then
281 %triggerpostun -- %{name} <= 0.75.1
282 if [ -f /etc/clamav.conf.rpmsave ]; then
283 echo "Renaming config to new name /etc/clamd.conf"
284 mv -f /etc/clamd.conf /etc/clamd.conf.rpmnew
285 mv -f /etc/clamav.conf.rpmsave /etc/clamd.conf
286 echo "Changing config location in freshclam config"
287 sed -i -e 's/clamav.conf/clamd.conf/' /etc/freshclam.conf
292 /sbin/chkconfig --add clamav-milter
293 if [ -f /var/lock/subsys/clamav-milter ]; then
294 /etc/rc.d/init.d/clamd restart >&2
296 echo "Run \"/etc/rc.d/init.d/clamav-milter start\" to start Clam Antivirus daemon." >&2
300 if [ "$1" = "0" ]; then
301 if [ -f /var/lock/subsys/clamav-milter ]; then
302 /etc/rc.d/init.d/clamav-milter stop
304 /sbin/chkconfig --del clamav-milter
307 %post libs -p /sbin/ldconfig
308 %postun libs -p /sbin/ldconfig
310 %post database -p %{_sbindir}/%{name}-post-updatedb
313 %defattr(644,root,root,755)
314 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
315 %attr(755,root,root) %{_bindir}/clamdscan
316 %attr(755,root,root) %{_bindir}/clamscan
317 %attr(755,root,root) %{_bindir}/freshclam
318 %attr(755,root,root) %{_bindir}/sigtool
319 %attr(755,root,root) %{_sbindir}/clamd
320 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
321 %attr(755,clamav,root) %dir /var/lib/%{name}
322 %attr(640,clamav,root) %ghost %{_var}/log/freshclam.log
323 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
325 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
326 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/clamd.conf
327 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/freshclam.conf
329 %attr(754,root,root) /etc/rc.d/init.d/clamd
330 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
331 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/clamav
333 %{_mandir}/man8/clamd*
337 %defattr(644,root,root,755)
338 %config(noreplace) %{_sysconfdir}/sysconfig/clamav-milter
339 %attr(755,root,root) /etc/rc.d/init.d/clamav-milter
340 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
341 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
342 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
343 %attr(755,root,root) %{_sbindir}/clamav-milter
344 %{_mandir}/man8/clamav-milter.8*
345 %attr(700,clamav,clamav) /var/spool/clamav/
349 %defattr(644,root,root,755)
350 %attr(755,root,root) %{_libdir}/lib*.so.*.*
353 %defattr(644,root,root,755)
354 %attr(755,root,root) %{_bindir}/clamav-config
355 %attr(755,root,root) %{_libdir}/lib*.so
358 %{_pkgconfigdir}/*.pc
361 %defattr(644,root,root,755)
365 %defattr(644,root,root,755)
366 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
367 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.cvd