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: 5c02d52c361f04098a9956478f8654a0
16 # Source0-size: 2668125
18 Source2: %{name}.sysconfig
19 Source3: %{name}-milter.init
20 Source4: %{name}-cron-updatedb
21 Source5: %{name}.logrotate
22 # Remember to update date after databases upgrade
23 %define database_version 20041016
24 Source6: http://db.local.clamav.net/daily.cvd
25 # Source6-md5: 0407cabd808a894c5fdc6b4e79dff265
26 # Source6-size: 100250
27 Source7: http://db.local.clamav.net/main.cvd
28 # Source7-md5: f006a1f55722c2ff9d50e61cfb938bc7
29 # Source7-size: 1284637
30 Source8: %{name}-post-updatedb
31 Source9: %{name}-milter.sysconfig
32 Patch0: %{name}-pld_config.patch
33 Patch1: %{name}-no_auto_libwrap.patch
34 Patch2: %{name}-nolibs.patch
35 URL: http://www.clamav.net/
36 BuildRequires: autoconf
37 BuildRequires: automake
38 BuildRequires: gmp-devel
39 %{?with_milter:BuildRequires: libwrap-devel}
40 BuildRequires: libtool
41 BuildRequires: rpmbuild(macros) >= 1.159
42 %{?with_milter:BuildRequires: sendmail-devel >= 8.11}
43 BuildRequires: zlib-devel
44 Requires(pre): /bin/id
45 Requires(pre): /usr/bin/getgid
46 Requires(pre): /usr/sbin/groupadd
47 Requires(pre): /usr/sbin/useradd
48 Requires(postun): /usr/sbin/groupdel
49 Requires(postun): /usr/sbin/userdel
50 Requires(postun,pre): /usr/sbin/usermod
51 Requires(post,preun): /sbin/chkconfig
52 Requires: /usr/sbin/usermod
53 Requires: %{name}-libs = %{version}-%{release}
55 Provides: group(clamav)
56 Provides: user(clamav)
57 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
60 Clam Antivirus is a powerful anti-virus scanner for Unix. It supports
61 AMaViS, compressed files, on-access scanning and includes a program
62 for auto-updating with support for digital signatures. The virus
63 database has over 20000 viruses, worms and trojans signatures. The
64 scanner is multithreaded, written in C, and POSIX compliant.
67 Clam Antivirus jest potê¿nym skanerem antywirusowym dla systemów
68 uniksowych. Wspiera on AMaViSa, skompresowane pliki, skanowanie
69 "on-access" i posiada system bezpiecznej, automatycznej aktualizacji.
70 Baza wirusów zawiera ponad 20000 sygnatur. Skaner jest wielow±tkowy,
71 napisany w C i zgodny z POSIXem.
74 Summary: Shared libraries for clamav
75 Summary(pl): Biblioteki dzielone clamav
79 Shared libraries for clamav.
81 %description libs -l pl
82 Biblioteki dzielone clamav.
85 Summary: ClamAV filter using milter interface
86 Summary(pl): Filtr ClamAV korzystaj±cy z interfejsu milter
88 Requires: %{name} = %{epoch}:%{version}-%{release}
89 Requires: sendmail >= 8.11
90 Requires: tcp_wrappers
93 ClamAV sendmail filter using MILTER interface.
95 %description -l pl milter
96 Filtr ClamAV dla sendmaila korzystaj±cy z interfejsu MILTER.
99 Summary: clamav - Development header files and libraries
100 Summary(pl): clamav - Pliki nag³ówkowe i biblioteki dla programistów
101 Group: Development/Libraries
102 Requires: %{name}-libs = %{version}-%{release}
103 Requires: bzip2-devel
108 This package contains the development header files and libraries
109 necessary to develop clamav client applications.
111 %description devel -l pl
112 Pliki nag³ówkowe i biblioteki konieczne do kompilacji aplikacji
116 Summary: clamav static libraris
117 Summary(pl): Biblioteki statyczne clamav
118 Group: Development/Libraries
119 Requires: %{name}-devel = %{version}-%{release}
122 clamav static libraries.
124 %description static -l pl
125 Biblioteki statyczne clamav.
128 Summary: Virus database for clamav
129 Summary(pl): Bazy wirusów dla clamav
131 Version: %{version}.%{database_version}
134 %description database
135 Virus database for clamav (updated %{database_version}).
137 %description database -l pl
138 Bazy wirusów dla clamav (aktualizowana %{database_version}).
146 # kill old libtool.m4 copy
147 head -n 489 acinclude.m4 > acinclude.m4.tmp
148 tail -n +4064 acinclude.m4 >> acinclude.m4.tmp
149 mv -f acinclude.m4.tmp acinclude.m4
159 %{?with_milter:--enable-milter} \
160 --with-dbdir=/var/lib/%{name}
164 rm -rf $RPM_BUILD_ROOT
165 install -d $RPM_BUILD_ROOT%{_sysconfdir}/{rc.d/init.d,sysconfig,logrotate.d} \
166 $RPM_BUILD_ROOT{%{_sysconfdir}/cron.d,%{_var}/{log,spool/clamav}}
169 DESTDIR=$RPM_BUILD_ROOT
170 %{!?with_milter:rm -f $RPM_BUILD_ROOT%{_mandir}/man8/clamav-milter.8*}
172 cat <<EOF >$RPM_BUILD_ROOT%{_sysconfdir}/cron.d/%{name}
173 5 * * * * root %{_sbindir}/clamav-cron-updatedb
176 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamd
178 install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/clamav-milter
179 install %{SOURCE9} $RPM_BUILD_ROOT/etc/sysconfig/clamav-milter
181 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/clamd
182 install %{SOURCE4} $RPM_BUILD_ROOT%{_sbindir}/clamav-cron-updatedb
183 install etc/*.conf $RPM_BUILD_ROOT%{_sysconfdir}
184 install %{SOURCE5} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
185 install %{SOURCE6} $RPM_BUILD_ROOT/var/lib/%{name}
186 install %{SOURCE7} $RPM_BUILD_ROOT/var/lib/%{name}
187 install %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}
189 # NOTE: clamd uses sane rights to it's clamd.pid file
190 # So better keep it dir
191 # If it is fixed use of dir will be unecesary
192 install -d $RPM_BUILD_ROOT%{_var}/run/%{name}
194 touch $RPM_BUILD_ROOT%{_var}/log/freshclam.log
197 rm -rf $RPM_BUILD_ROOT
199 %triggerin -- amavis-ng
200 AMAVIS=$(/usr/bin/getgid amavis)
202 if [ $RESULT -eq 0 ]; then
203 /usr/sbin/usermod -G amavis clamav 1>&2 > /dev/null
204 echo "adding clamav to amavis group GID=$AMAVIS"
207 %triggerin -- amavisd-new
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
216 AMAVIS=$(/usr/bin/getgid amavis)
218 if [ $RESULT -eq 0 ]; then
219 echo "adding clamav to amavis group GID=$AMAVIS"
220 /usr/sbin/usermod -G amavis clamav 1>&2
224 if [ -n "`/usr/bin/getgid clamav`" ]; then
225 if [ "`/usr/bin/getgid clamav`" != 43 ]; then
226 echo "Warning: group clamav doesn't have gid=43. Correct this before installing clamav" 1>&2
230 echo "Adding group clamav GID=43"
231 /usr/sbin/groupadd -g 43 clamav
233 if [ -n "`/bin/id -u clamav 2>/dev/null`" ]; then
234 if [ "`/bin/id -u clamav`" != 43 ]; then
235 echo "Warning: user clamav doesn't have uid=43. Correct this before installing clamav" 1>&2
239 echo "Adding user clamav UID=43"
240 /usr/sbin/useradd -u 43 -d /tmp -s /bin/false \
241 -c "Clam Anti Virus Checker" -g clamav clamav 1>&2
242 if [ -n "`/usr/bin/getgid amavis`" ]; then
243 echo "adding clamav to amavis group
244 /usr/sbin/usermod -G amavis clamav 1>&2
249 /sbin/chkconfig --add clamd
250 if [ -f /var/lock/subsys/clamd ]; then
251 /etc/rc.d/init.d/clamd restart >&2
253 echo "Run \"/etc/rc.d/init.d/clamd start\" to start Clam Antivirus daemon." >&2
255 touch %{_var}/log/freshclam.log
256 chown clamav:root %{_var}/log/freshclam.log
257 chmod 640 %{_var}/log/freshclam.log
260 if [ "$1" = "0" ]; then
261 if [ -f /var/lock/subsys/clamd ]; then
262 /etc/rc.d/init.d/clamd stop
264 /sbin/chkconfig --del clamd
268 if [ "$1" = "0" ]; then
275 /sbin/chkconfig --add clamav-milter
276 if [ -f /var/lock/subsys/clamav-milter ]; then
277 /etc/rc.d/init.d/clamd restart >&2
279 echo "Run \"/etc/rc.d/init.d/clamav-milter start\" to start Clam Antivirus daemon." >&2
283 if [ "$1" = "0" ]; then
284 if [ -f /var/lock/subsys/clamav-milter ]; then
285 /etc/rc.d/init.d/clamav-milter stop
287 /sbin/chkconfig --del clamav-milter
290 %post libs -p /sbin/ldconfig
291 %postun libs -p /sbin/ldconfig
293 %post database -p %{_sbindir}/%{name}-post-updatedb
296 %defattr(644,root,root,755)
297 %doc AUTHORS ChangeLog FAQ NEWS README TODO docs/html/
298 %attr(755,root,root) %{_bindir}/clamdscan
299 %attr(755,root,root) %{_bindir}/clamscan
300 %attr(755,root,root) %{_bindir}/freshclam
301 %attr(755,root,root) %{_bindir}/sigtool
302 %attr(755,root,root) %{_sbindir}/clamd
303 %attr(755,root,root) %{_sbindir}/clamav-cron-updatedb
304 %attr(755,clamav,root) %dir /var/lib/%{name}
305 %attr(640,clamav,root) %ghost %{_var}/log/freshclam.log
306 %attr(750,clamav,clamav) %dir %{_var}/run/%{name}
308 %attr(640,root,root) %{_sysconfdir}/cron.d/%{name}
309 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/clamd.conf
310 %attr(644,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/freshclam.conf
312 %attr(754,root,root) /etc/rc.d/init.d/clamd
313 %attr(640,root,root) %config(noreplace) %verify(not md5 size mtime) /etc/sysconfig/clamd
314 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/logrotate.d/clamav
316 %{_mandir}/man8/clamd*
320 %defattr(644,root,root,755)
321 %config(noreplace) %{_sysconfdir}/sysconfig/clamav-milter
322 %attr(755,root,root) /etc/rc.d/init.d/clamav-milter
323 #%attr(755,root,root) %{_sysconfdir}/cron.daily/clamav-milter
324 #%attr(755,root,root) %{_sysconfdir}/log.d/scripts/services/clamav-milter
325 #%{_sysconfdir}/log.d/conf/services/clamav-milter.conf
326 %attr(755,root,root) %{_sbindir}/clamav-milter
327 %{_mandir}/man8/clamav-milter.8*
328 %attr(700,clamav,clamav) /var/spool/clamav/
332 %defattr(644,root,root,755)
333 %attr(755,root,root) %{_libdir}/lib*.so.*.*
336 %defattr(644,root,root,755)
337 %attr(755,root,root) %{_bindir}/clamav-config
338 %attr(755,root,root) %{_libdir}/lib*.so
341 %{_pkgconfigdir}/*.pc
344 %defattr(644,root,root,755)
348 %defattr(644,root,root,755)
349 %attr(755,root,root) %{_sbindir}/clamav-post-updatedb
350 %attr(644,clamav,root) %verify(not md5 size mtime) /var/lib/%{name}/*.cvd